udp mpsafe

Matthew Dillon dillon at apollo.backplane.com
Thu Jan 13 11:39:02 PST 2011

:Hi all,
:Please review the devel^2 ~ devel^5 (inclusive) at:
:The modification/accessing to the udbinfo is protected by two mechanism:
:1) netisr barrier, which prevents code running in netisr from
:accessing udbinfo when the modification is going to happen
:2) serializer, which prevents code not running in netisr (e.g. sysctl,
:interface detaching) from accessing udbinfo when the modification is
:going to happen
:1) makes the udp input/output path lock free.
:Best Regards,

    I've been looking at this.  It merges cleanly into master.  It looks
    commitable but I do have two concerns:

    * The barrier is going to be very very expensive on machines with lots
      of cpus.

    * The sysctl callback (in_pcblist_global_nomarker()) is being called
      with the udbinfo locked.  Since the sysctl does a copyout to userland
      it is possible for userland to deadlock the kernel due to the lock
      being held during the copyout.

    My recommendation is to perhaps make the udbinfo_lock() a lwkt_token
    and not a hard serializer.  That will solve the sysctl/copyout issue.

    I'm not sure re: the barrier.


More information about the Kernel mailing list