[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZuFmWuUK8POsihzf@pc636>
Date: Wed, 11 Sep 2024 11:43:54 +0200
From: Uladzislau Rezki <urezki@...il.com>
To: "Paul E. McKenney" <paulmck@...nel.org>
Cc: "Uladzislau Rezki (Sony)" <urezki@...il.com>,
Vlastimil Babka <vbabka@...e.cz>, RCU <rcu@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Neeraj upadhyay <Neeraj.Upadhyay@....com>,
Boqun Feng <boqun.feng@...il.com>,
Joel Fernandes <joel@...lfernandes.org>,
Frederic Weisbecker <frederic@...nel.org>,
Oleksiy Avramchenko <oleksiy.avramchenko@...y.com>
Subject: Re: [PATCH v2] rcu/kvfree: Add kvfree_rcu_barrier() API
On Tue, Sep 10, 2024 at 08:42:54AM -0700, Paul E. McKenney wrote:
> On Tue, Aug 20, 2024 at 05:59:35PM +0200, Uladzislau Rezki (Sony) wrote:
> > Add a kvfree_rcu_barrier() function. It waits until all
> > in-flight pointers are freed over RCU machinery. It does
> > not wait any GP completion and it is within its right to
> > return immediately if there are no outstanding pointers.
> >
> > This function is useful when there is a need to guarantee
> > that a memory is fully freed before destroying memory caches.
> > For example, during unloading a kernel module.
> >
> > Signed-off-by: Uladzislau Rezki (Sony) <urezki@...il.com>
> > Signed-off-by: Vlastimil Babka <vbabka@...e.cz>
>
> As a follow-on patch, once kvfree_rcu_barrier() is accepted into
> mainline, should we add a call to kvfree_rcu_barrier() to the
> rcu_barrier_throttled() function in kernel/rcu/tree.c?
>
> This would allow the do_rcu_barrier module parameter to be used to clear
> out kfree_rcu() as well as call_rcu() work. This would be useful to
> people running userspace benchmarks that cause the kernel to do a lot
> of kfree_rcu() calls. Always good to avoid messing up the results from
> the current run due to deferred work from the previous run. Even better
> would be to actually account for the deferred work, but do_rcu_barrier
> can help with that as well. ;-)
>
> Thoughts?
>
Makes sense. To be make sure that all objects are flushed. And as you
mentioned it is good to have it for benchmarking as a return to a baseline
point.
One issue is probably a "name" which would be common for both:
rcu_barrier()
kvfree_rcu_barrier()
i mean /sys/module/rcutree/parameters/do_rcu_barrier. From how i
would see it, it is supposed to trigger just rcu_barrier() API.
--
Uladzislau Rezki
Powered by blists - more mailing lists