[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d6829f2c-1517-4ac4-a907-d6dc88f2cc44@lucifer.local>
Date: Fri, 29 Nov 2024 16:27:50 +0000
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>, Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Kan Liang <kan.liang@...ux.intel.com>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, David Hildenbrand <david@...hat.com>
Subject: Re: [PATCH v2] perf: map pages in advance
On Fri, Nov 29, 2024 at 04:03:44PM +0000, Matthew Wilcox wrote:
> On Fri, Nov 29, 2024 at 03:31:34PM +0000, Lorenzo Stoakes wrote:
> > While it is not ideal to use a VM_PFNMAP here, doing anything else will
> > result in the page_mkwrite() hook need to be provided, which requires the
> > same page->mapping hack this patch seeks to undo.
>
> Or we could map the first page read-write to begin with ... ?
This would sort of be a rejig, as then you'd just make pfn_mkwrite() always fail
and be doing essentially the same thing, only varying what prot you set on map
(you can't just set the other pages read-only in prot and not provide
pfn_mkwrite(), if you do the kernel will simply make them writable on write
fault in wp_page_reuse() :)
> Or we could implement a page_mkwrite handler, but do the permissions
> change in the driver and return VM_FAULT_NOPAGE.
Yeah interesting, that's possible, but wouldn't we need to be careful about TLB
etc. in that case since the mapping will have already been established?
I suppose we could zap then set, but that's icky...
Even if you don't pre-map this will be the case as it faults in first before
invoking page_mkwrite()...
>
> I don't think we should do the second option in this driver, but
> mentioning it because we're going to need to have A Talk about fb_defio.
>
Yes I think we're good with the current solution for perf, despite its warty
nature it works (TM).
I fear that this Talk may involve much gnashing of teeth...
Powered by blists - more mailing lists