[openib-general] svn patches.

Greg KH
Wed Apr 28 15:18:26 PDT 2004


On Wed, Apr 28, 2004 at 03:12:28PM -0700, Roland Dreier wrote:
> 
>     Roland> Hotplug is an even bigger can of worms.  I don't know what
>     Roland> the heck we do for stuff like userspace processes that
>     Roland> have registered memory with an HCA that is no longer
>     Roland> attached to the system.
> 
>     Greg> If you use pci_register_driver() everything will work just
>     Greg> fine.  The driver has to tell userspace that it's resources
>     Greg> are now gone just before the card goes away, just like it
>     Greg> happens if you unload the module.
> 
> But the card can now go away with a nonzero reference count...

Yup, as the user told the card to go away.

> With typical hotplug PCI hardware, what happens to a userspace process
> that writes to a PCI devices mmio region after the device is no longer
> there?  Is the write silently discarded or does the process get some
> sort of fault?

It's up to the operator to make sure all userspace stuff is taken care
of before powering down the pci card (unmounting filesystems, etc.)  So
the driver doesn't have to worry about this.

Actually the 2.6 scsi layer has gotten a lot better at dropping a
controller while things are still mounted, so it doesn't oops anymore :)

As for mmio accesses, I don't really know.  They should probably just
fail as the memory isn't valid anymore.

>     Greg> Also, why is the memory model backwards from the traditional
>     Greg> Unix mmap model?  (kernel gives out the memory to the user,
>     Greg> the user never gives a memory chunk to the kernel.)  Is
>     Greg> there some IB reason for this that I'm missing?
> 
> Unfortunately this is deeply embedded in the IB spec.  A userspace
> consumer can call the register memory verb on any virtual address
> space it owns.  It does make sense too: otherwise the IB driver ends
> up reinventing interfaces to give user processes hugetlb pages, etc.

Ick.  Oh well, thanks for explaining it.

greg k-h

-- 
To unsubscribe send an email with subject unsubscribe to openib-general at openib.org.
Please contact moderator at openib.org for questions.




More information about the openib-general mailing list