b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: "Linus Lüssing" <linus.luessing@web.de>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] NDP patches v4
Date: Wed, 12 Jan 2011 16:32:22 +0100	[thread overview]
Message-ID: <20110112153222.GA24766@Sellars> (raw)
In-Reply-To: <201101051312.34513.lindner_marek@yahoo.de>

On Wed, Jan 05, 2011 at 01:12:33PM +0100, Marek Lindner wrote:
> 
> Hi Linus,
> 
> great that you embraced the feedback that quickly. As discussed in Berlin I'll 
> go through your patches once I have a little bit more room to manoeuvre (next 
> week is rather packed).
> 
> > Would be great if someone could check the usage of rcu-locking +
> > refcounting. I was also a little confused because in
> > "Documentation/RCU/listRCU.txt" list_del_rcu() and list_add_rcu() are not
> > protected with a spinlock for the list here, but in the batman-adv code we
> > are usually having those extra locks. Do I have to leave those spinlocks
> > or can I remove them for adding/deleting entries in the neigh_list?
> 
> I don't understand why you think there are no locks. Did you read the text 
> around the examples (Documentation/RCU/listRCU.txt) ? I mean, below the first 
> example (which indeed does not contain spinlocks) it is written:
> 
> Normally, the write_lock() and write_unlock() would be replaced by
> a spin_lock() and a spin_unlock(), but in this case, all callers hold
> audit_netlink_sem, so no additional locking is required.  The auditsc_lock
> can therefore be eliminated, since use of RCU eliminates the need for
> writers to exclude readers.  Normally, the write_lock() calls would
> be converted into spin_lock() calls.
> 
> If you check the following example you'll find spinlocks or search for 
> list_del_rcu() in the kernel sources to find more usage scenarios.
> 
> Regards,
> Marek
> 

Oki doki, thanks. I was a little confused by the example at that
section and couldn't find any other references to "audit_netlink_sem" (though
it is/was probably just a common semaphore, I guess). Ok,
quick searching of list_del_rcu() in the kernel code (via http://lxr.linux.no/linux)
cleared things up.

Cheers, Linus

  reply	other threads:[~2011-01-12 15:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-31 15:46 [B.A.T.M.A.N.] NDP patches v4 Linus Lüssing
2010-12-31 15:46 ` [B.A.T.M.A.N.] [PATCH 01/10] batman-adv: Rename packet type / structure / functions for OGMs Linus Lüssing
2010-12-31 15:46 ` [B.A.T.M.A.N.] [PATCH 02/10] batman-adv: Adding workqueue for new ndp packets Linus Lüssing
2010-12-31 15:46 ` [B.A.T.M.A.N.] [PATCH 03/10] batman-adv: Send neighbor discovery packets Linus Lüssing
2010-12-31 15:46 ` [B.A.T.M.A.N.] [PATCH 04/10] batman-adv: Creating neighbor structures, updating LQs Linus Lüssing
2010-12-31 15:46 ` [B.A.T.M.A.N.] [PATCH 05/10] batman-adv: Purge outdated ndp neighbours Linus Lüssing
2010-12-31 15:46 ` [B.A.T.M.A.N.] [PATCH 06/10] batman-adv: Adding ndp debugfs output Linus Lüssing
2010-12-31 15:46 ` [B.A.T.M.A.N.] [PATCH 07/10] batman-adv: Adding batman_if specific sysfs wrapper macros for UINT Linus Lüssing
2010-12-31 15:46 ` [B.A.T.M.A.N.] [PATCH 08/10] batman-adv: Adding sysfs parameter for ndp interval Linus Lüssing
2010-12-31 15:46 ` [B.A.T.M.A.N.] [PATCH 09/10] batman-adv: Use local tq values determined by NDP on OGMs Linus Lüssing
2010-12-31 15:46 ` [B.A.T.M.A.N.] [PATCH 10/10] batman-adv: Use rcu locking + ref-counting for neigh_list Linus Lüssing
2011-01-02  1:27   ` Linus Lüssing
2011-01-05 12:12 ` [B.A.T.M.A.N.] NDP patches v4 Marek Lindner
2011-01-12 15:32   ` Linus Lüssing [this message]
2011-01-12 15:48     ` [B.A.T.M.A.N.] NDP patches v4y Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110112153222.GA24766@Sellars \
    --to=linus.luessing@web.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).