lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1331212113.11248.392.camel@twins>
Date:	Thu, 08 Mar 2012 14:08:33 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Lai Jiangshan <laijs@...fujitsu.com>
Cc:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	linux-kernel@...r.kernel.org, mingo@...e.hu, dipankar@...ibm.com,
	akpm@...ux-foundation.org, mathieu.desnoyers@...ymtl.ca,
	josh@...htriplett.org, niv@...ibm.com, tglx@...utronix.de,
	rostedt@...dmis.org, Valdis.Kletnieks@...edu, dhowells@...hat.com,
	eric.dumazet@...il.com, darren@...art.com, fweisbec@...il.com,
	patches@...aro.org
Subject: Re: [RFC PATCH 5/5 single-thread-version] implement per-domain
 single-thread state machine call_srcu()

On Wed, 2012-03-07 at 11:54 +0800, Lai Jiangshan wrote:
> This patch is on the top of the 4 previous patches(1/6, 2/6, 3/6, 4/6).
> 
> o       state machine is light way and single-threaded, it is preemptible when checking.
> 
> o       state machine is a work_struct. So, there is no thread occupied
>         by SRCU when the srcu is not actived(no callback). And it does
>         not sleep(avoid to occupy a thread when sleep).
> 
> o       state machine is the only thread can flip/check/write(*) the srcu_struct,
>         so we don't need any mutex.
>         (write(*): except ->per_cpu_ref, ->running, ->batch_queue)
> 
> o       synchronize_srcu() is always call call_srcu().
>         synchronize_srcu_expedited() is also.
>         It is OK for mb()-based srcu are extremely fast.
> 
> o       In current kernel, we can expect that there are only 1 callback per gp.
>         so callback is probably called in the same CPU when it is queued.
> 
> The trip of a callback:
>         1) ->batch_queue when call_srcu()
> 
>         2) ->batch_check0 when try to do check_zero
> 
>         3) ->batch_check1 after finish its first check_zero and the flip
> 
>         4) ->batch_done after finish its second check_zero
> 
> The current requirement of the callbacks:
>         The callback will be called inside process context.
>         The callback should be fast without any sleeping path.
> 
> Signed-off-by: Lai Jiangshan <laijs@...fujitsu.com> 

Aside from the nit on srcu_advance_batches() this seems like a nice
implementation. Thanks!

I didn't fully verify the srcu state machine, but it looks about
right :-)

Acked-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ