[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZHBrMTkKiqhxBo5w@infradead.org>
Date: Fri, 26 May 2023 01:17:53 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Lorenzo Stoakes <lstoakes@...il.com>
Cc: David Howells <dhowells@...hat.com>,
Christoph Hellwig <hch@...radead.org>,
David Hildenbrand <david@...hat.com>,
Jens Axboe <axboe@...nel.dk>,
Al Viro <viro@...iv.linux.org.uk>,
Matthew Wilcox <willy@...radead.org>, Jan Kara <jack@...e.cz>,
Jeff Layton <jlayton@...nel.org>,
Jason Gunthorpe <jgg@...dia.com>,
Logan Gunthorpe <logang@...tatee.com>,
Hillf Danton <hdanton@...a.com>,
Christian Brauner <brauner@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-fsdevel@...r.kernel.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [RFC PATCH v2 1/3] mm: Don't pin ZERO_PAGE in pin_user_pages()
On Fri, May 26, 2023 at 09:10:33AM +0100, Lorenzo Stoakes wrote:
> On Thu, May 25, 2023 at 11:39:51PM +0100, David Howells wrote:
> > Make pin_user_pages*() leave a ZERO_PAGE unpinned if it extracts a pointer
> > to it from the page tables and make unpin_user_page*() correspondingly
> > ignore a ZERO_PAGE when unpinning. We don't want to risk overrunning a
> > zero page's refcount as we're only allowed ~2 million pins on it -
> > something that userspace can conceivably trigger.
>
> I guess we're not quite as concerned about FOLL_GET because FOLL_GET should
> be ephemeral and FOLL_PIN (horrifically) adds GUP_PIN_COUNTING_BIAS each
> time?
I think FOLL_GET would be just as useful. But given that we have
a few places that release pins while gets just do a put_page it would
be a lot more effort to audit all of them. Maybe it's better do only
do this once we've converted all the places that should do pin and
have very few FOLL_GET users left.
Powered by blists - more mailing lists