[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yb+r2W6RCKhO5toC@casper.infradead.org>
Date: Sun, 19 Dec 2021 22:02:01 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: David Hildenbrand <david@...hat.com>,
Nadav Amit <namit@...are.com>,
Jason Gunthorpe <jgg@...dia.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Hugh Dickins <hughd@...gle.com>,
David Rientjes <rientjes@...gle.com>,
Shakeel Butt <shakeelb@...gle.com>,
John Hubbard <jhubbard@...dia.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
Mike Rapoport <rppt@...ux.ibm.com>,
Yang Shi <shy828301@...il.com>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Vlastimil Babka <vbabka@...e.cz>, Jann Horn <jannh@...gle.com>,
Michal Hocko <mhocko@...nel.org>,
Rik van Riel <riel@...riel.com>,
Roman Gushchin <guro@...com>,
Andrea Arcangeli <aarcange@...hat.com>,
Peter Xu <peterx@...hat.com>,
Donald Dutile <ddutile@...hat.com>,
Christoph Hellwig <hch@....de>,
Oleg Nesterov <oleg@...hat.com>, Jan Kara <jack@...e.cz>,
Linux-MM <linux-mm@...ck.org>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@...r.kernel.org>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>
Subject: Re: [PATCH v1 06/11] mm: support GUP-triggered unsharing via
FAULT_FLAG_UNSHARE (!hugetlb)
On Sun, Dec 19, 2021 at 01:53:36PM -0800, Linus Torvalds wrote:
> On Sun, Dec 19, 2021 at 1:48 PM Matthew Wilcox <willy@...radead.org> wrote:
> >
> > Yes, agreed, I was thinking that we could use "not mapped at all"
> > as an optimisation to avoid doing rmap walks. eg __unmap_and_move().
>
> So the thing is, it's a very dodgy optimization for a rather simple
> reason: what if somebody pages the page in?
>
> So even "not mapped at all" is questionable.
>
> You have to check that it's also not a swapcache page, and hold the
> page lock for that check, at the very least.
>
> And by then, you're really in a very unusual situation - and my gut
> feel says not one worth optimizing for (because anon pages are
> _usually_ mapped at least once).
I'd like to get rid of ->mapcount for file pages too. And those are
definitely never mapped in the majority of cases.
Powered by blists - more mailing lists