public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] TOMOYO: Add garbage collector support. (v3)
Date: Wed, 17 Jun 2009 14:28:43 +0200	[thread overview]
Message-ID: <1245241723.6704.10.camel@laptop> (raw)
In-Reply-To: <200906172019.EAE00032.OLOJFQVMtFOFSH@I-love.SAKURA.ne.jp>

On Wed, 2009-06-17 at 20:19 +0900, Tetsuo Handa wrote:
> Paul E. McKenney wrote ( http://lkml.org/lkml/2009/5/27/2 ) :
> > I would also recommend the three-part LWN series as a starting point:
> > 
> > #       http://lwn.net/Articles/262464/ (What is RCU, Fundamentally?)
> > #       http://lwn.net/Articles/263130/ (What is RCU's Usage?)
> > #       http://lwn.net/Articles/264090/ (What is RCU's API?)
> I've read these articles. They are very good.
> 
> I came up with an idea that we may be able to implement GC while readers are
> permitted to sleep but no read locks are required.
> 
> The idea is to have two counters which hold the number of readers currently
> reading the list, one is active and the other is inactive. Reader increments
> the currently active counter before starts reading and decrements that counter
> after finished reading. GC swaps active counter and inactive counter and waits
> for previously active counter's count to become 0 before releasing elements
> removed from the list.
> Code is shown below.
> 
> atomic_t users_counter[2];
> atomic_t users_counter_idx;
> DEFINE_MUTEX(updator_mutex);
> DEFINE_MUTEX(gc_mutex);

Sounds like an utter scalability nightmare to me though.

Why not 'simply' use SRCU or always provide an preemptible RCU domain
using:

rcu_read_lock_preempt()
rcu_read_unlock_preempt()
call_rcu_preempt()
etc.

along with the already existing

*{,_bh,_sched} variants

That way PREEMPT_RCU would only affect the implementation of the regular
RCU implementation, it being either _sched or _preempt.


  parent reply	other threads:[~2009-06-17 12:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-17 11:19 [PATCH] TOMOYO: Add garbage collector support. (v3) Tetsuo Handa
2009-06-17 11:21 ` [PATCH 1/3] TOMOYO: Move sleeping operations to outside the semaphore Tetsuo Handa
2009-06-17 11:22 ` [PATCH 2/3] TOMOYO: Replace tomoyo_save_name() with tomoyo_get_name()/tomoyo_put_name() Tetsuo Handa
2009-06-17 11:23 ` [PATCH 3/3] TOMOYO: Add RCU-like garbage collector Tetsuo Handa
2009-06-17 12:28 ` Peter Zijlstra [this message]
2009-06-17 16:31 ` [PATCH] TOMOYO: Add garbage collector support. (v3) Paul E. McKenney
2009-06-18  5:34   ` Tetsuo Handa
2009-06-18  6:45     ` [PATCH 3/3] TOMOYO: Add SRCU based garbage collector Tetsuo Handa
2009-06-18 16:05       ` Paul E. McKenney
2009-06-18 15:28     ` [PATCH] TOMOYO: Add garbage collector support. (v3) Paul E. McKenney
2009-06-19  4:57       ` Tetsuo Handa
2009-06-20  1:28         ` Paul E. McKenney
2009-06-20  7:04           ` Tetsuo Handa
2009-06-21  4:07             ` Paul E. McKenney
  -- strict thread matches above, loose matches on Subject: below --
2009-06-02  1:39 Tetsuo Handa
2009-06-02  1:57 ` Tetsuo Handa

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=1245241723.6704.10.camel@laptop \
    --to=peterz@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /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