linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: Axel Rasmussen <axelrasmussen@google.com>, bpf <bpf@vger.kernel.org>
Cc: linux-mm <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Nicolas Saenz Julienne <nsaenzju@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: mmap_lock: replace get_memcg_path_buf() with on-stack buffer
Date: Sat, 22 Jun 2024 14:57:20 +0900	[thread overview]
Message-ID: <1a48d05c-539b-4d5d-9375-f2aaa5fa0dd4@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <CAJHvVcgfgjPQMxRn09+QKV0G-6AOS6UA7hMbtu2azMquMW4JCA@mail.gmail.com>

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@google.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.



  reply	other threads:[~2024-06-22  5:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-21  1:08 Tetsuo Handa
2024-06-21 23:03 ` Axel Rasmussen
2024-06-22  5:57   ` Tetsuo Handa [this message]
2024-06-27 21:41     ` Axel Rasmussen

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=1a48d05c-539b-4d5d-9375-f2aaa5fa0dd4@I-love.SAKURA.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=bpf@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nsaenzju@redhat.com \
    /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