Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [lttng-dev] [RFC] re-document rculfstack and even rename it
Date: Thu, 11 Oct 2012 14:22:55 -0400	[thread overview]
Message-ID: <20121011182255.GA19783@Krystal> (raw)
In-Reply-To: <50752928.3050006@cn.fujitsu.com>

* Lai Jiangshan (laijs at cn.fujitsu.com) wrote:
> rculfstack is not really require RCU-only.
> 
> 1) cds_lfs_push_rcu() don't need any lock, don't need RCU nor other locks.

Good point ! I even documented this peculiarness in the
comment at the top of _cds_lfs_push_rcu().

> 2) cds_lfs_pop_rcu() don't only one of the following synchronization(not only RCU):
> 	A) use rcu_read_lock() to protect cds_lfs_pop_rcu() and use synchronize_rcu()
>            or call_rcu() to free the popped node. (current comments said we need this
>            synchronization, and thus we named this struct with rcu prefix. But actually,
> 	   the followings are OK, and are more popular/friendly)
> 	B) use mutexs/locks to protect cds_lfs_pop_rcu(), we can free to free/modify the
> 	   popped node any time, we don't need any synchronization when free them.
> 	C) only ONE thread can call cds_lfs_pop_rcu(). (multi-providers-single customer)
> 	D) others, like read-write locks.
> 
> I consider B) and C) are more popular. In linux kernel,
> kernel/task_work.c uses a hybird ways of B) and C).
> 
> I suggest to rename it, Or document B) and C) at least.

Yes, agreed! Do you suggest we introduce a "lfstack", and slowly
deprecate rculfstack ?

We could then document the various ways to protect "pop", and also
implement a "splice" operation while we are there.

Thoughts ?

Thanks,

Mathieu

> 
> Thanks,
> Lai
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com



  parent reply	other threads:[~2012-10-11 18:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-10  7:52 Lai Jiangshan
2012-10-10 14:59 ` Paul E. McKenney
2012-10-11 18:22 ` Mathieu Desnoyers [this message]
2012-10-12  2:25   ` Lai Jiangshan

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=20121011182255.GA19783@Krystal \
    --to=mathieu.desnoyers@efficios.com \
    /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