From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx108.postini.com [74.125.245.108]) by kanga.kvack.org (Postfix) with SMTP id B06FB6B0033 for ; Mon, 26 Aug 2013 19:15:01 -0400 (EDT) Received: by mail-vc0-f169.google.com with SMTP id ib11so2568265vcb.14 for ; Mon, 26 Aug 2013 16:15:00 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20130807153030.GA25515@redhat.com> <20130819231836.GD14369@redhat.com> <20130821204901.GA19802@redhat.com> <20130823032127.GA5098@redhat.com> <20130823035344.GB5098@redhat.com> <20130826190757.GB27768@redhat.com> Date: Mon, 26 Aug 2013 16:15:00 -0700 Message-ID: Subject: Re: unused swap offset / bad page map. From: Linus Torvalds Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: Hugh Dickins Cc: Dave Jones , Cyrill Gorcunov , Hillf Danton , Linux-MM , Linux Kernel On Mon, Aug 26, 2013 at 3:08 PM, Hugh Dickins 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. 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 -- 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: email@kvack.org