From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Hugh Dickins <hughd@google.com>, Dave Jones <davej@redhat.com>,
Hillf Danton <dhillf@gmail.com>, Linux-MM <linux-mm@kvack.org>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Pavel Emelyanov <xemul@parallels.com>
Subject: Re: unused swap offset / bad page map.
Date: Tue, 27 Aug 2013 09:44:28 +0400 [thread overview]
Message-ID: <20130827054428.GB7416@moon> (raw)
In-Reply-To: <CA+55aFyPbSjVbE4v4ak_GEbA0Mn3T5ZcC6CFs-jfKfMkbC+qNw@mail.gmail.com>
On Mon, Aug 26, 2013 at 04:15:00PM -0700, Linus Torvalds wrote:
> On Mon, Aug 26, 2013 at 3:08 PM, Hugh Dickins <hughd@google.com> wrote:
> >
> > I just did a quick diff of 3.11-rc7/mm against 3.10, and here's
> > a line in mremap which worries me. That set_pte_at() is operating
> > on anything that isn't pte_none(), so the pte_mksoft_dirty() looks
> > prone to corrupt a swap entry.
>
> Uhhuh. I think you hit the nail on the head here.
>
> I checked all the pte_swp_*soft_dirty() users (they should be used on
> swp entries), because that came up in another thread. But you're
> right, the non-swp ones only work on present pte entries (or on
> file-offset entries, I guess), and at least that mremap() case seems
> bogus.
Oh my :( Indeed it sets _PAGE_SOFT_DIRTY unconditionally, sigh. This
nit comes from former soft-dirty commit. Let me check all other places
we set soft dirty bit (Pavel CC'ed).
> I'm not seeing the point of marking the thing soft-dirty at all,
> although I guess it's "dirty" in the sense that it changed the
> contents at that virtual address. But for that code to work, it would
> have to have the same bit for swap entries as for present pages (and
> for file mapping entries), and that's not true. They are two different
> bits (_PAGE_SOFT_DIRTY is bit #11 vs _PAGE_SWP_SOFT_DIRTY is bit #7).
>
> Ugh. Cyrill, this is a mess.
Linus, I simply had no place in pte entry to carry soft-dirty status
when pte incoded in swap format, so it was unpleasant but necessary
decision. That's why bits access are wrapped in own macros with
'swp' prefix thus reader would easily grep for them.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2013-08-27 5:44 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-07 5:51 Dave Jones
2013-08-07 10:04 ` Hillf Danton
2013-08-07 15:30 ` Dave Jones
2013-08-08 15:20 ` Hillf Danton
2013-08-08 15:36 ` Dave Jones
2013-08-19 23:18 ` Dave Jones
2013-08-20 4:39 ` Hillf Danton
2013-08-21 20:49 ` Dave Jones
2013-08-22 0:35 ` Hillf Danton
2013-08-22 3:21 ` Hillf Danton
2013-08-23 3:21 ` Dave Jones
2013-08-23 3:27 ` Hillf Danton
2013-08-23 3:53 ` Dave Jones
2013-08-26 3:45 ` Hillf Danton
2013-08-26 19:08 ` Dave Jones
2013-08-26 20:15 ` Linus Torvalds
2013-08-26 20:46 ` Linus Torvalds
2013-08-26 22:08 ` Hugh Dickins
2013-08-26 22:28 ` Dave Jones
2013-08-27 8:37 ` Cyrill Gorcunov
2013-08-27 16:24 ` Dave Jones
2013-08-27 16:32 ` Cyrill Gorcunov
2013-08-26 23:15 ` Linus Torvalds
2013-08-27 5:44 ` Cyrill Gorcunov [this message]
2013-08-26 20:18 ` Cyrill Gorcunov
2013-08-26 20:37 ` Dave Jones
2013-08-26 20:42 ` Cyrill Gorcunov
2013-08-26 21:37 ` Cyrill Gorcunov
2013-08-26 21:42 ` Dave Jones
2013-08-26 21:49 ` Cyrill Gorcunov
2013-08-26 21:59 ` Dave Jones
2013-08-07 15:54 ` Dave Jones
2013-08-23 9:08 Hillf Danton
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=20130827054428.GB7416@moon \
--to=gorcunov@gmail.com \
--cc=davej@redhat.com \
--cc=dhillf@gmail.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=torvalds@linux-foundation.org \
--cc=xemul@parallels.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