[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220121075943.GB20638@worktop.programming.kicks-ass.net>
Date: Fri, 21 Jan 2022 08:59:43 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Nadav Amit <nadav.amit@...il.com>
Cc: Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
Steven Rostedt <rostedt@...dmis.org>, bsegall@...gle.com,
Mel Gorman <mgorman@...e.de>, bristot@...hat.com,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux-MM <linux-mm@...ck.org>, linux-api@...r.kernel.org,
X86 ML <x86@...nel.org>, pjt@...gle.com, posk@...gle.com,
avagin@...gle.com, Jann Horn <jannh@...gle.com>,
tdelisle@...terloo.ca, mark.rutland@....com, posk@...k.io
Subject: Re: [RFC][PATCH v2 1/5] mm: Avoid unmapping pinned pages
On Thu, Jan 20, 2022 at 10:03:44AM -0800, Nadav Amit wrote:
> > --- a/mm/mprotect.c
> > +++ b/mm/mprotect.c
> > @@ -106,6 +106,12 @@ static unsigned long change_pte_range(st
> > continue;
> >
> > /*
> > + * Can't migrate pinned pages, avoid touching them.
> > + */
> > + if (page_maybe_dma_pinned(page))
> > + continue;
> > +
> > + /*
> >
>
> I have a similar problem with userfaultfd changing protection for
> DMA-pinned pages. For userfaultfd it is important to know how many
> pages were actually modified.
>
> I am working on a vectored UFFDIO_WRITEPROTECTV that aborts once
> a pinned page is encountered, but also returns the number of pages
> that were properly protected. I still need to do some work to
> send patches for that as it requires further changes (to return
> the number of pages that were handled).
>
> But for the matter of your patch, is it possible to make this
> test generic (not migration specific) and rely on a new flag in
> cp_flags? I can of course make this change later if you prefer it
> this way.
I have no objection to making it apply more widely, but I'm currently
only interested in the rmap users. If userspace does mprotect() on it's
own pages, it gets to keep whatever pieces are the result of that.
Powered by blists - more mailing lists