[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1a48d05c-539b-4d5d-9375-f2aaa5fa0dd4@I-love.SAKURA.ne.jp>
Date: Sat, 22 Jun 2024 14:57:20 +0900
From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To: Axel Rasmussen <axelrasmussen@...gle.com>, bpf <bpf@...r.kernel.org>
Cc: linux-mm <linux-mm@...ck.org>, Andrew Morton <akpm@...ux-foundation.org>,
Nicolas Saenz Julienne <nsaenzju@...hat.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: mmap_lock: replace get_memcg_path_buf() with on-stack
buffer
On 2024/06/22 8:03, Axel Rasmussen wrote:
> No objections. Looking back all the way to the first version [1] the
> buffers were already percpu, instead of on the stack like this. IOW,
> there was no on-list discussion about why this shouldn't go on the
> stack. It has been a while, but if memory serves I opted to do it that
> way just out of paranoia around putting large buffers on the stack.
> But, I agree 256 bytes isn't all that large.
>
> That v1 patch wasn't all that complex, but then again it didn't deal
> with various edge cases properly :) so it has grown significantly more
> complex over time. Reconsidering the approach seems reasonable now,
> given how much code this removes.
>
> This change looks straightforwardly correct to me. You can take:
>
> Reviewed-by: Axel Rasmussen <axelrasmussen@...gle.com>
Thank you. One question. CONTEXT_COUNT was defined as below.
>> -/*
>> - * How many contexts our trace events might be called in: normal, softirq, irq,
>> - * and NMI.
>> - */
>> -#define CONTEXT_COUNT 4
Is there possibility that this function (or in general, trace events) is called from NMI
context? If yes, I worry that functions called from get_mm_memcg_path() are not NMI-safe.
Original change at
https://lkml.kernel.org/r/3e9b2a54-73d4-48cb-a510-d17984c97a45@I-love.SAKURA.ne.jp was
posted due to worrying about NMI safety.
Powered by blists - more mailing lists