Re: [PATCH 1/1] rcu/kvfree: Add debug check of GP ready for ptrs in a list

From: Uladzislau Rezki
Date: Wed Apr 05 2023 - 05:10:52 EST


On Tue, Apr 04, 2023 at 05:00:13PM -0700, Paul E. McKenney wrote:
> On Tue, Apr 04, 2023 at 04:13:00PM +0200, Uladzislau Rezki (Sony) wrote:
> > Triiger a warning if a grace period is not passed yet for
> > objects queued on a linked list via rcu_head structures.
> >
> > Once detached, take a full snapsot of GP sequnces to check
> > later that a grace period is passed and it is safe to free
> > all pointers.
> >
> > Based on latest 'dev' branch.
> >
> > Signed-off-by: Uladzislau Rezki (Sony) <urezki@xxxxxxxxx>
>
> Very good, thank you!
>
> I queued the patch wordsmithed as shown below for review and further
> testing. Please check for any errors.
>
> How should we go about testing this code? The way that it would get
> exercised in production would be during an out-of-memory event, correct?
>
Either by flooding kfree_rcu() calls by many threads or simulate a
low memory condition. I applied i high pressure using 1 000 000 frees
by 64 kthreads on 64 CPUs system.

IMHO, we have two GP checks, one for bulk and another one for list
and it looks like enough at least from my point of view.

--
Uladzislau Rezki