linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Beau Belgrave <beaub@linux.microsoft.com>,
	 Chengming Zhou <zhouchengming@bytedance.com>,
	Huang Yiwei <quic_hyiwei@quicinc.com>,
	 John Garry <john.g.garry@oracle.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	 Thorsten Blum <thorsten.blum@toblux.com>,
	Vincent Donnefort <vdonnefort@google.com>,
	 linke li <lilinke99@qq.com>,
	Daniel Bristot de Oliveira <bristot@redhat.com>
Subject: Re: [GIT PULL] tracing: Updates for v6.9
Date: Sat, 16 Mar 2024 11:18:02 -0700	[thread overview]
Message-ID: <CAHk-=wg0g7YN7htrhQ7GNRbRb5+WtMJv8MuoqBJhY6iARD7E9Q@mail.gmail.com> (raw)
In-Reply-To: <CAHk-=wh5wWeib7+kVHpBVtUn7kx7GGadWqb5mW5FYTdewEfL=w@mail.gmail.com>

On Sat, 16 Mar 2024 at 09:59, Linus Torvalds
<torvalds@linux-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

  reply	other threads:[~2024-03-16 18:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-15 16:29 [GIT PULL] tracing: Updates for v6.9 Steven Rostedt
2024-03-16 16:31 ` Linus Torvalds
2024-03-16 16:59   ` Linus Torvalds
2024-03-16 18:18     ` Linus Torvalds [this message]
2024-03-16 18:20     ` Steven Rostedt
2024-03-16 18:42       ` Linus Torvalds
2024-03-16 20:00         ` Borislav Petkov
2024-03-16 20:42           ` Linus Torvalds
2024-03-16 21:07             ` Borislav Petkov
2024-03-17 12:14         ` Steven Rostedt

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='CAHk-=wg0g7YN7htrhQ7GNRbRb5+WtMJv8MuoqBJhY6iARD7E9Q@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=beaub@linux.microsoft.com \
    --cc=bristot@redhat.com \
    --cc=john.g.garry@oracle.com \
    --cc=lilinke99@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=quic_hyiwei@quicinc.com \
    --cc=rdunlap@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=thorsten.blum@toblux.com \
    --cc=vdonnefort@google.com \
    --cc=zhouchengming@bytedance.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;
as well as URLs for NNTP newsgroup(s).