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: <20230907144924.272e2f2sckprbvca@revolver>
Date:   Thu, 7 Sep 2023 10:49:24 -0400
From:   "Liam R. Howlett" <Liam.Howlett@...cle.com>
To:     Jaeseon Sim <jason.sim@...sung.com>
Cc:     Matthew Wilcox <willy@...radead.org>,
        Peng Zhang <zhangpeng.00@...edance.com>,
        "surenb@...gle.com" <surenb@...gle.com>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "jaewon31.kim@...il.com" <jaewon31.kim@...il.com>,
        "maple-tree@...ts.infradead.org" <maple-tree@...ts.infradead.org>
Subject: Re: [PATCH] maple_tree: use GFP_KERNEL on mas_node_count

* Jaeseon Sim <jason.sim@...sung.com> [230907 00:41]:
> > On Thu, Sep 07, 2023 at 12:02:02PM +0800, Peng Zhang wrote:
> > > 
> > > 
> > > 在 2023/9/7 11:49, Matthew Wilcox 写道:
> > > > On Thu, Sep 07, 2023 at 12:39:14PM +0900, 심재선 wrote:
> > > > > Use GFP_KERNEL on mas_node_count instead of GFP_NOWAIT | __GFP_NOWARN
> > > > > in order to allow memory reclaim.
> > > There are many paths that call maple tree's mas_node_count(). Some paths
> > > cannot reclaim memory.
> > 
> > Right ... but we should be handling the ENOMEM inside the maple tree and
> > allocating some nodes with GFP_KERNEL instead of failing fork().
> > 
> > > > What testing did you do of this patch?  In particular, did you try it
> > > > with lockdep enabled?
> I did power on/off test with this patch.
> I did not try it with lockdep enabled.

To accomplish the same result, but with a much smaller scope that will
work with lockdep, I would suggest changing mas_expected_entries() to
use mas_node_count_gfp() (which already exists) and pass in GFP_KERNEL.

Since fork is the only current user of mas_expected_entries(), this
won't break other users and we can deal with changing it for others if
it is needed.

If we do go this route, please add a note in the documentation about
using GFP_KERNEL.

Willy, does that work for you?

Thanks,
Liam

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ