DragonFly BSD
DragonFly kernel List (threaded) for 2011-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: udp mpsafe


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 13 Jan 2011 11:33:32 -0800 (PST)

:Hi all,
:
:Please review the devel^2 ~ devel^5 (inclusive) at:
:http://gitweb.dragonflybsd.org/~sephe/dragonfly.git/shortlog/refs/heads/devel
:
: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,
:sephe

    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.

						-Matt



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]