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 09:59:57 -0700	[thread overview]
Message-ID: <CAHk-=wh5wWeib7+kVHpBVtUn7kx7GGadWqb5mW5FYTdewEfL=w@mail.gmail.com> (raw)
In-Reply-To: <CAHk-=wg24KPFfeNwYdsD0e79MP4QhO3VaWkh0buPSD0M=141xQ@mail.gmail.com>

On Sat, 16 Mar 2024 at 09:31, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> So instead of merging a new feature that was mis-designed and is
> already having code working around its mis-design, I'm not merging it
> at all.

Here's a clue: when hacking up VFS code, ask for ACK's from the VFS people.

And when hacking up MM code, make damn sure that you have VM people involved.

No more of this "random code that happens to work in my tests"
garbage. Yes, I'm sure that others have done this same disgusting page
counting hack and this was copied-and-pasted from some other
disgusting source, but because of all the history, I'm now looking at
tracing pulls arefully, and I'm simply not allowing any broken hacks.

So in addition to getting actual VM people to help you with mapping
stuff (hard requirement), I would also suggest:

 - your allocation has to be live over the whole mmap (and that's due
to other fundamental issues - you're not even trying to deal with
actual dynamic allocations and thank Cthulhu for that), and the code
is literally designed that way, so then faulting pages in one at a
time and refcounting them one at a time is just pointless and wrong.
Just do it all at mmap time.

 - I'd suggest marking it all VM_DONTCOPY | VM_IO | VM_DONTEXPAND to
not let people play games with the mapping.

 - avoid all the sub-page ref-counts entirely by using VM_PFNMAP, and
use vm_insert_pages()

and a random note:

 - from a TLB pressure standpoint, it might be a good idea to try to
keep the page table entries naturally aligned, so putting that one
status page at the beginning is likely a bad idea. It will typically
mean that hardware that can silently use larger TLB entries for
aligned pages won't be able to do so.

but the effect of that is likely fairly small.

                Linus

  reply	other threads:[~2024-03-16 17:00 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 [this message]
2024-03-16 18:18     ` Linus Torvalds
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-=wh5wWeib7+kVHpBVtUn7kx7GGadWqb5mW5FYTdewEfL=w@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).