[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANn89iJbQ8rO8Mr-OaUcfXpcKiWEupuaT931NOsphQ-8BuPs5w@mail.gmail.com>
Date: Tue, 30 May 2023 12:06:19 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
Cc: Jakub Kicinski <kuba@...nel.org>,
Dmitry Vyukov <dvyukov@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ref_tracker: add stack_depot_save() failure handling to ref_tracker_alloc()
On Tue, May 30, 2023 at 11:52 AM Tetsuo Handa
<penguin-kernel@...ove.sakura.ne.jp> wrote:
>
> On 2023/05/30 16:22, Eric Dumazet wrote:
> >>> Therefore, assume that stack_depot_save(GFP_KERNEL | __GFP_NOFAIL) from
> >>> ref_tracker_alloc() can silently fail, and emit "unreliable refcount
> >>> tracker." message.
> >
> > Note: I never assumed stack_depot_save() would enforce/use NOFAIL.
>
> Hmm, I misread this function.
>
> if (gfp & __GFP_DIRECT_RECLAIM)
> gfp_mask |= __GFP_NOFAIL; // Or'ing to "gfp_mask" than "gfp".
> *trackerp = tracker = kzalloc(sizeof(*tracker), gfp_mask); // <= This is "gfp_mask".
> tracker->alloc_stack_handle = stack_depot_save(entries, nr_entries, gfp); // <= This is "gfp".
>
> So, stack_depot_save(GFP_KERNEL | __GFP_NOFAIL) is not happening.
Yes.1
>
> Then, question becomes whether we want tracker->alloc_stack_handle != NULL or not.
> If tracker->alloc_stack_handle == NULL is still useful, this patch will be useless...
>
I think it is useful to have the tracker (as Jakub hinted).
It is better than nothing.
We even might be able to allocate memory later for the
free_stack_handle which could give us
developers enough clues for bug hunting.
Thanks.
Powered by blists - more mailing lists