mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Uladzislau Rezki <urezki@gmail.com>
Cc: Vlastimil Babka <vbabka@suse.cz>, RCU <rcu@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Neeraj upadhyay <Neeraj.Upadhyay@amd.com>,
	Boqun Feng <boqun.feng@gmail.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	Frederic Weisbecker <frederic@kernel.org>,
	Oleksiy Avramchenko <oleksiy.avramchenko@sony.com>
Subject: Re: [PATCH 1/4] rcu/kvfree: Support dynamic rcu_head for single argument objects
Date: Wed, 28 Aug 2024 11:00:12 -0700	[thread overview]
Message-ID: <184844f5-71fd-4b62-bf86-87cdff3aa546@paulmck-laptop> (raw)
In-Reply-To: <Zs9Xm6VKcpMkWbLE@pc636>

On Wed, Aug 28, 2024 at 07:00:11PM +0200, Uladzislau Rezki wrote:
> On Wed, Aug 28, 2024 at 04:58:48PM +0200, Vlastimil Babka wrote:
> > On 8/28/24 13:09, Uladzislau Rezki (Sony) wrote:
> > > Add a support of dynamically attaching an rcu_head to an object
> > > which gets freed via the single argument of kvfree_rcu(). This is
> > > used in the path, when a page allocation fails due to a high memory
> > > pressure.
> > > 
> > > The basic idea behind of this is to minimize a hit of slow path
> > > which requires a caller to wait until a grace period is passed.
> > > 
> > > Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
> > 
> > So IIUC it's a situation where we can't allocate a page, but we hope the
> > kmalloc-32 slab has still free objects to give us dyn_rcu_head's before it
> > would have to also make a page allocation?
> > 
> Yes, you understood it correctly :)
> 
> >
> > So that may really be possible and there might potentially be many such
> > objects, but I wonder if there's really a benefit. The system is struggling
> > for memory and the single-argument caller specifically is _mightsleep so it
> > could e.g. instead go direct reclaim a page rather than start depleting the
> > kmalloc-32 slab, no?
> > 
> This is a good question about benefit and i need to say that i do not
> have a strong opinion here. I post this patch to get some opinions about
> it. This "dynamic attaching" we discussed with RCU folk a few years ago
> and decided not to go with it. I have not found an information why.

If I remember correctly, I asked "How are you testing this?", which
was then taken as a criticism rather than a question.  ;-)

No one has reported an OOM-related problem with the code in its current
form, for what little that is worth.

							Thanx, Paul

> The page request path, which is "normal/fast", can lead to a "light"
> direct reclaim, if still fails, then we are in a high pressure situation.
> Depleting a slab is probably not worth it, especially that the patch in
> this series:
> 
> [PATCH 4/4] rcu/kvfree: Switch to expedited version in slow path
> 
> switches to more faster synchronize_rcu() version to speedup a reclaim.
> 
> + this [PATCH 3/4] rcu/kvfree: Use polled API in a slow path
> which also improves a slow path in terms of that a GP might be already
> passed for the object being freed.
> 
> I am totally OK to drop this patch. This is fine to me.
> 
> --
> Uladzislau Rezki

      reply	other threads:[~2024-08-28 18:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28 11:09 Uladzislau Rezki (Sony)
2024-08-28 11:09 ` [PATCH 2/4] rcu/kvfree: Add a switcher for dynamic rcu_head Uladzislau Rezki (Sony)
2024-08-28 11:09 ` [PATCH 3/4] rcu/kvfree: Use polled API in a slow path Uladzislau Rezki (Sony)
2024-08-28 11:09 ` [PATCH 4/4] rcu/kvfree: Switch to expedited version in " Uladzislau Rezki (Sony)
2024-08-28 14:58 ` [PATCH 1/4] rcu/kvfree: Support dynamic rcu_head for single argument objects Vlastimil Babka
2024-08-28 17:00   ` Uladzislau Rezki
2024-08-28 18:00     ` Paul E. McKenney [this message]

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=184844f5-71fd-4b62-bf86-87cdff3aa546@paulmck-laptop \
    --to=paulmck@kernel.org \
    --cc=Neeraj.Upadhyay@amd.com \
    --cc=boqun.feng@gmail.com \
    --cc=frederic@kernel.org \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleksiy.avramchenko@sony.com \
    --cc=rcu@vger.kernel.org \
    --cc=urezki@gmail.com \
    --cc=vbabka@suse.cz \
    /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

all inboxes | Powered by JetHome®