linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
To: Jaeseon Sim <jason.sim@samsung.com>
Cc: Matthew Wilcox <willy@infradead.org>,
	Peng Zhang <zhangpeng.00@bytedance.com>,
	"surenb@google.com" <surenb@google.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"jaewon31.kim@gmail.com" <jaewon31.kim@gmail.com>,
	"maple-tree@lists.infradead.org" <maple-tree@lists.infradead.org>
Subject: Re: [PATCH] maple_tree: use GFP_KERNEL on mas_node_count
Date: Thu, 7 Sep 2023 10:49:24 -0400	[thread overview]
Message-ID: <20230907144924.272e2f2sckprbvca@revolver> (raw)
In-Reply-To: <20230907044119epcms1p3ff1dd04b02119ff11b77fe40b4842afd@epcms1p3>

* Jaeseon Sim <jason.sim@samsung.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


  reply	other threads:[~2023-09-07 14:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230907033914epcms1p61c5eed4d34d5c4212436c201f33292b3@epcms1p6>
2023-09-07  3:39 ` 심재선
2023-09-07  3:49   ` Matthew Wilcox
2023-09-07  4:02     ` Peng Zhang
2023-09-07  4:10       ` Matthew Wilcox
     [not found]       ` <CGME20230907033914epcms1p61c5eed4d34d5c4212436c201f33292b3@epcms1p3>
2023-09-07  4:41         ` Jaeseon Sim
2023-09-07 14:49           ` Liam R. Howlett [this message]
     [not found]           ` <CGME20230907033914epcms1p61c5eed4d34d5c4212436c201f33292b3@epcms1p2>
2023-09-14  2:49             ` Jaeseon Sim
2023-09-14 15:31               ` Liam R. Howlett

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=20230907144924.272e2f2sckprbvca@revolver \
    --to=liam.howlett@oracle.com \
    --cc=jaewon31.kim@gmail.com \
    --cc=jason.sim@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=maple-tree@lists.infradead.org \
    --cc=surenb@google.com \
    --cc=willy@infradead.org \
    --cc=zhangpeng.00@bytedance.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