[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100331173836.GG2461@linux.vnet.ibm.com>
Date: Wed, 31 Mar 2010 10:38:36 -0700
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To: James Chapman <jchapman@...alix.com>
Cc: Stephen Hemminger <shemminger@...tta.com>, netdev@...r.kernel.org
Subject: Re: [PATCH v3 10/12] l2tp: Add L2TP ethernet pseudowire support
On Wed, Mar 31, 2010 at 10:35:29AM +0100, James Chapman wrote:
> Stephen Hemminger wrote:
> > On Tue, 30 Mar 2010 17:18:19 +0100
> > James Chapman <jchapman@...alix.com> wrote:
> >
> >> +struct l2tp_eth_net {
> >> + struct list_head l2tp_eth_dev_list;
> >> + rwlock_t l2tp_eth_lock;
> >> +};
> >
> > Reader/write locks are discouraged because they are slower than
> > spin locks. If you have lots of readers use RCU, if reading
> > is infrequent just use a spin lock.
>
> Ok. In doing the conversion of the rwlocks in l2tp_core.c, I'm finding
> that some list access primitives don't have rcu equivalents, namely
> list_is_last(), list_for_each_entry_safe(). Is this intentional? Should
> I add the missing ones in a separate patch?
The list_is_last() is RCU-safe already, since the ->next pointer is
only compared, never dereferenced. I suggest adding a comment to its
header stating that it is RCU-safe.
Feel free to create a list_for_each_entry_safe_rcu(), and I will be
happy to review it.
Thanx, Paul
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists