From: Jerome Glisse <jglisse@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Ralph Campbell <rcampbell@nvidia.com>
Subject: Re: [PATCH] mm/migrate: properly preserve write attribute in special migrate entry
Date: Tue, 3 Apr 2018 19:03:36 -0400 [thread overview]
Message-ID: <20180403230336.GH5935@redhat.com> (raw)
In-Reply-To: <20180403153046.88cae4ab18646e8e23a648ce@linux-foundation.org>
On Tue, Apr 03, 2018 at 03:30:46PM -0700, Andrew Morton wrote:
> On Sun, 1 Apr 2018 22:35:06 -0400 jglisse@redhat.com wrote:
>
> > From: Ralph Campbell <rcampbell@nvidia.com>
> >
> > Use of pte_write(pte) is only valid for present pte, the common code
> > which set the migration entry can be reach for both valid present
> > pte and special swap entry (for device memory). Fix the code to use
> > the mpfn value which properly handle both cases.
> >
> > On x86 this did not have any bad side effect because pte write bit
> > is below PAGE_BIT_GLOBAL and thus special swap entry have it set to
> > 0 which in turn means we were always creating read only special
> > migration entry.
>
> Does this mean that the patch only affects behaviour of non-x86 systems?
No it affect x86 as explained below (ie it forces a second page fault).
>
> > So once migration did finish we always write protected the CPU page
> > table entry (moreover this is only an issue when migrating from device
> > memory to system memory). End effect is that CPU write access would
> > fault again and restore write permission.
>
> That sounds a bit serious. Was a -stable backport considered?
Like discuss previously with Michal, for lack of upstream user yet
(and PowerPC users of this code are not upstream either yet AFAIK).
Once i get HMM inside nouveau upstream, i will evaluate if people
wants all fixes to be back ported to stable.
Finaly this one isn't too bad, it just burn CPU cycles by forcing
CPU to take a second fault on write access ie double fault the same
address. There is no corruption or incorrect states (it behave as
a COWed page from a fork with a mapcount of 1).
Do you still want me to be more aggressive with stable backport ?
I don't mind either way. I expect to get HMM nouveau upstream over
next couple release cycle.
Cheers,
Jerome
next prev parent reply other threads:[~2018-04-03 23:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-02 2:35 [PATCH] mm/migrate: properly preserve write attribute in special migrate entry jglisse
2018-04-03 22:30 ` Andrew Morton
2018-04-03 23:03 ` Jerome Glisse [this message]
2018-04-03 23:45 ` Andrew Morton
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=20180403230336.GH5935@redhat.com \
--to=jglisse@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rcampbell@nvidia.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).