From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by kanga.kvack.org (Postfix) with ESMTP id 152328E0038 for ; Tue, 8 Jan 2019 04:15:05 -0500 (EST) Received: by mail-lj1-f200.google.com with SMTP id j24-v6so784469lji.20 for ; Tue, 08 Jan 2019 01:15:05 -0800 (PST) Received: from esgaroth.tuxoid.at (esgaroth.petrovitsch.at. [78.47.184.11]) by mx.google.com with ESMTPS id z65-v6si56368276ljb.17.2019.01.08.01.15.02 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 08 Jan 2019 01:15:02 -0800 (PST) Subject: Re: [PATCH] mm/mincore: allow for making sys_mincore() privileged References: From: Bernd Petrovitsch Message-ID: <047f0582-a4d3-490d-7284-48dfdf9e9471@petrovitsch.priv.at> Date: Tue, 8 Jan 2019 10:14:23 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Vlastimil Babka , Jiri Kosina Cc: Linus Torvalds , Andrew Morton , Greg KH , Peter Zijlstra , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org On 05/01/2019 20:38, Vlastimil Babka wrote: [...] > I was thinking about "return true" here, assuming that userspace generally wants > to ensure itself there won't be page faults when it starts doing something > critical, and if it sees a "false" it will try to do some kind of prefaulting, > possibly in a loop. There might be somebody trying to make sure something is out Isn't that racy by design as the pages may get flushed out after the check? Shouldn't the application use e.g. mlock()/.... to guarantee no page faults in the first place? MfG, Bernd -- Bernd Petrovitsch Email : bernd@petrovitsch.priv.at LUGA : http://www.luga.at