[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wg0g7YN7htrhQ7GNRbRb5+WtMJv8MuoqBJhY6iARD7E9Q@mail.gmail.com>
Date: Sat, 16 Mar 2024 11:18:02 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Masami Hiramatsu <mhiramat@...nel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, Beau Belgrave <beaub@...ux.microsoft.com>,
Chengming Zhou <zhouchengming@...edance.com>, Huang Yiwei <quic_hyiwei@...cinc.com>,
John Garry <john.g.garry@...cle.com>, Randy Dunlap <rdunlap@...radead.org>,
Thorsten Blum <thorsten.blum@...lux.com>, Vincent Donnefort <vdonnefort@...gle.com>,
linke li <lilinke99@...com>, Daniel Bristot de Oliveira <bristot@...hat.com>
Subject: Re: [GIT PULL] tracing: Updates for v6.9
On Sat, 16 Mar 2024 at 09:59, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> - I'd suggest marking it all VM_DONTCOPY | VM_IO | VM_DONTEXPAND to
> not let people play games with the mapping.
You already did set VM_DONTCOPY (and VM_DONTDUMP is a good idea too).
And you cleared VM_MAYWRITE. Those are all good.
I'd also suggest requiring the mma[ to be MAP_SHARED.
With a read-only mapping, that doesn't really do all that much, but I
don't think you actually need the vm_ops at all once you do everything
at mmap() time, and then it causes a SIGBUS instead of a "insert zero
page".
And _technically_ it could tell the architecture code to try to align
the mapping to the cache aliasing boundaries.
Of course, because of how you insert the meta-page at the beginning of
the mapping, you end up with the actual page table entries not aligned
anyway, so it doesn't actually help the cache coloring, but it's still
conceptually the right thing to do. So even if it ends up mostly just
a "document the fact that these are shared with the kernel" flag, I
think it's a good idea.
Linus
Powered by blists - more mailing lists