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: <20200915161123.GC26745@willie-the-truck>
Date:   Tue, 15 Sep 2020 17:11:23 +0100
From:   Will Deacon <will@...nel.org>
To:     peterz@...radead.org
Cc:     Oleg Nesterov <oleg@...hat.com>, Hou Tao <houtao1@...wei.com>,
        Ingo Molnar <mingo@...hat.com>,
        Dennis Zhou <dennis@...nel.org>, Tejun Heo <tj@...nel.org>,
        Christoph Lameter <cl@...ux.com>, linux-kernel@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, Jan Kara <jack@...e.cz>
Subject: Re: [RFC PATCH] locking/percpu-rwsem: use this_cpu_{inc|dec}() for
 read_count

On Tue, Sep 15, 2020 at 06:03:44PM +0200, peterz@...radead.org wrote:
> On Tue, Sep 15, 2020 at 05:51:50PM +0200, peterz@...radead.org wrote:
> 
> > Anyway, I'll rewrite the Changelog and stuff it in locking/urgent.
> 
> How's this?
> 
> ---
> Subject: locking/percpu-rwsem: Use this_cpu_{inc,dec}() for read_count
> From: Hou Tao <houtao1@...wei.com>
> Date: Tue, 15 Sep 2020 22:07:50 +0800
> 
> From: Hou Tao <houtao1@...wei.com>
> 
> The __this_cpu*() accessors are (in general) IRQ-unsafe which, given
> that percpu-rwsem is a blocking primitive, should be just fine.
> 
> However, file_end_write() is used from IRQ context and will cause
> load-store issues.

... on architectures where the per-cpu accessors are not atomic.

> 
> Fixing it by using the IRQ-safe this_cpu_*() for operations on

Fixing => Fix ?

> read_count. This will generate more expensive code on a number of
> platforms, which might cause a performance regression for some of the
> other percpu-rwsem users.
> 
> If any such is reported, we can consider alternative solutions.
> 
> Fixes: 70fe2f48152e ("aio: fix freeze protection of aio writes")
> Signed-off-by: Hou Tao <houtao1@...wei.com>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> Link: https://lkml.kernel.org/r/20200915140750.137881-1-houtao1@huawei.com
> ---
>  include/linux/percpu-rwsem.h  |    8 ++++----
>  kernel/locking/percpu-rwsem.c |    4 ++--
>  2 files changed, 6 insertions(+), 6 deletions(-)

For the patch:

Acked-by: Will Deacon <will@...nel.org>

Will

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ