[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20131118225841.GI4138@linux.vnet.ibm.com>
Date: Mon, 18 Nov 2013 14:58:41 -0800
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To: anish singh <anish198519851985@...il.com>
Cc: 韩磊 <bonben1989@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: list_head and lock?
On Sun, Nov 17, 2013 at 05:48:14PM -0800, anish singh wrote:
> On Sun, Nov 17, 2013 at 5:19 PM, 韩磊 <bonben1989@...il.com> wrote:
> > when we delete,add,search,amend the list_head,should we use spinlock
> > or rcu in case of conflicit to list_head???
> There is no implicit locking when we use 'list' api's.You should explicitly
> do that AFAIK.
See Documentation/RCU/listRCU.txt for a summary of how to use RCU-protected
linked lists. But yes, readers need to explicitly do rcu_read_lock()
and rcu_read_unlock(), and updaters must coordinate with each others
somehow, for example, explicitly using spinlocks.
The list_head macros are about list manipulation and not so much about
synchronization.
Thanx, Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists