Messages in this thread | | | Subject | Re: [PATCH net-next-2.6] fasync: RCU locking | From | Eric Dumazet <> | Date | Wed, 14 Apr 2010 17:34:24 +0200 |
| |
Le mercredi 14 avril 2010 à 16:57 +0200, Eric Dumazet a écrit : > Le mercredi 14 avril 2010 à 16:36 +0800, Lai Jiangshan a écrit : > > > Since rcu_read_lock() protects fasync_struct *fa for us, we can access > > to @fa safely even fasync_remove_entry() is just called. > > > > But this patch does not ensure 'fa->fa_file is not freed' nor > > 'fa->fa_fd is not released', so kill_fasync_rcu() may do wrong thing > > if there is no other code ensure it. > > You are 100% right, I forgot my old attempt to RCUified struct files > failed... > > Maybe its time to finally move f_owner out of struct file, and use RCU > to free it. > > In the mean time, adding a lock in fasync_struct is more than enough. > > Thanks ! > > [PATCH net-next-2.6 v2] fasync: fine grained locking > > kill_fasync() uses a central rwlock, candidate for RCU conversion, to > avoid cache line ping pongs on SMP. > > fasync_remove_entry() and fasync_add_entry() can disable IRQS on a short > section instead during whole list scan. > > Use a spinlock per fasync_struct to synchronize fasync_{remove| > add}_entry() and kill_fasync_rcu() > > We can remove __kill_fasync() direct use in net, and rename it to > kill_fasync_rcu(). > > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> > Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Please wait for a v3 version, as net/socket.c sock_fasync() should be updated too...
-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |