Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1662634imu; Thu, 17 Jan 2019 00:58:51 -0800 (PST) X-Google-Smtp-Source: ALg8bN4jfFF+QcK2B1JJAR41HronrURcIzyKJpldRYZGwatvENUgZVbjrNDpy9UgVcXoWzLMLxB2 X-Received: by 2002:a62:6f49:: with SMTP id k70mr13971986pfc.7.1547715531676; Thu, 17 Jan 2019 00:58:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547715531; cv=none; d=google.com; s=arc-20160816; b=DtFUeVSlbfN32url4FyaJbZ6PJOIKoGxu0JTfgDMS4E5AGd6YRbm0cjvodeGbPp+jJ 7Fnu5oKsOg1ep52AcpzfWWroCc4QyD/VoCElm8SJrm8RI09G55K7cqilMpY2YU7gcCun oZzRRjL6UIsUF6LWosfp2gWzjBNxj9VtiNy/jbg873U8KlVCZbkW7KW+axLz3KogcJwC Wzk0RpFKltOqJOyqxErDP6H7PdcX/Ych71v0cPIFEM1YBZAAKg+DsUKZJ5AM1o4k0/9m OZsKfDU83iFZGgrERDFRTxK7lipNfptBXqpRgtCTgCMhn+POtoaiaoOYZFoBXgqjXIG6 YbXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=7yg/fey2gwxJ3j2bGARMVT/eRJirMo8WI+36rgecn44=; b=HEpW0DhQV3xcxxDBly6HrX7OiiHhplsVXxUVQ4/abYPs81/ZxmodEaV6VIhGegcVoV jSCV/e/4WnHuJGT+wurBMPts5jWRri85Gb8jVsXy+Fu7AUCADp7ITDBxdgZwZcqZv2XP kn01HO1FWFQkcEKiTbEzEG432aHPJC0Pqe9pNr/w1AsBXeLJ7hbILtzooGtnhHwtnSw4 VxjP4ntJcOatopEQybgpi3WjEjgFEVV314gNFm3A9HMJ58XV2LYkCYfG4wcxaSsl6mOQ DY/FSrDsV4re+TwVSe8ewJHMnNi+eeHE1aED59PdChZ6Tr9LGUdlfGR52ksRogwDGZ7s NTuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=C6MlEvjF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si1114041pgg.120.2019.01.17.00.58.35; Thu, 17 Jan 2019 00:58:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=C6MlEvjF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729130AbfAQEwH (ORCPT + 99 others); Wed, 16 Jan 2019 23:52:07 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:33229 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729115AbfAQEwG (ORCPT ); Wed, 16 Jan 2019 23:52:06 -0500 Received: by mail-lf1-f67.google.com with SMTP id i26so6778602lfc.0 for ; Wed, 16 Jan 2019 20:52:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7yg/fey2gwxJ3j2bGARMVT/eRJirMo8WI+36rgecn44=; b=C6MlEvjFBkcWofmUUmP+orz3WZY5+zYliTWZFP0dxTKmc6y20wo/64FLm3lY/8d7uq zRUrUISklDIlgc9mcichrGZav7zNAit4hsMlYOxsvg/fQVAkEU+k/3J7nNx7BOUgMqHi snOWNxQuPFTwE3YsEekTQj4G0UD1pozuqEmEc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7yg/fey2gwxJ3j2bGARMVT/eRJirMo8WI+36rgecn44=; b=ECZicebYdoRTmhXLD2Iu48CYysHtlbwXD8dmSM0x9NuHSnJur46Wjew91fs/CLYQYK 7gBcpOPlXW5JOMeTTOqLjwFUd9Guf02nPjO92Y5vszg14wqaMhZWGWVvCRtV9fZjMg9w 7HCcZMb06tKVXP+3EJ+yGpOZjCsjVqRaE37q7vLM39nd5QL3olT0yc88AlEkg17Pnj+s DAHhbuBRq5orONvvT+FOdDrs7ah+RhIUg2VKjMrSsRIO/tVhFirh8BxYyTnr/eyi9+co 6RaIjJS8YiitFx9tuH3ZYgsDAb7ehdogb/CMnp9p5FKtIvBXHnBzhaVg2TySTDFt97P1 onbA== X-Gm-Message-State: AJcUukfFroqs0Jiy/AxXPmddbvjg/Bn2KA51BKiVsF17RdS7daL7cD8T PRd8KArOYIZjpZkI3vl2nvGeF+DllTE= X-Received: by 2002:a19:739d:: with SMTP id h29mr9637871lfk.85.1547700723997; Wed, 16 Jan 2019 20:52:03 -0800 (PST) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com. [209.85.208.175]) by smtp.gmail.com with ESMTPSA id p10-v6sm54619ljh.59.2019.01.16.20.52.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 20:52:02 -0800 (PST) Received: by mail-lj1-f175.google.com with SMTP id n18-v6so7409676lji.7 for ; Wed, 16 Jan 2019 20:52:02 -0800 (PST) X-Received: by 2002:a2e:3e04:: with SMTP id l4-v6mr8407355lja.148.1547700722094; Wed, 16 Jan 2019 20:52:02 -0800 (PST) MIME-Version: 1.0 References: <5c3e7de6.1c69fb81.4aebb.3fec@mx.google.com> <9E337EA6-7CDA-457B-96C6-E91F83742587@amacapital.net> <20190116054613.GA11670@nautica> <20190116213708.GN6310@bombadil.infradead.org> In-Reply-To: <20190116213708.GN6310@bombadil.infradead.org> From: Linus Torvalds Date: Thu, 17 Jan 2019 16:51:44 +1200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm/mincore: allow for making sys_mincore() privileged To: Matthew Wilcox Cc: Jiri Kosina , Dominique Martinet , Andy Lutomirski , Josh Snyder , Dave Chinner , Jann Horn , Andrew Morton , Greg KH , Peter Zijlstra , Michal Hocko , Linux-MM , kernel list , Linux API Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 17, 2019 at 9:37 AM Matthew Wilcox wrote: > > Your patch 3/3 just removes the test. Am I right in thinking that it > doesn't need to be *moved* because the existing test after !PageUptodate > catches it? That's the _hope_. That's the simplest patch I can come up with as a potential solution. But it's possible that there's some nasty performance regression because somebody really relies on not even triggering read-ahead, and we might need to do some totally different thing. So it may be that somebody has a case that really wants something else, and we'd need to move the RWF_NOWAIT test elsewhere and do something slightly more complicated. As with the mincore() change, maybe reality doesn't like the simplest fix... > Of course, there aren't any tests for RWF_NOWAIT in xfstests. Are there > any in LTP? RWF_NOWAIT is actually _fairly_ new. It was introduced "only" about 18 months ago and made it into 4.13. Which makes me hopeful there aren't a lot of people who care deeply. And starting readahead *may* actually be what a RWF_NOWAIT read user generally wants, so for all we know it might even improve performance and/or allow new uses. With the "start readahead but don't wait for it" semantics, you can have a model where you try to handle all the requests that can be handled out of cache first (using RWF_NOWAIT) and then when you've run out of cached cases you clear the RWF_NOWAIT flag, but now the IO has been started early (and could overlap with the cached request handling), so then when you actually do a blocking version, you get much better performance. So there is an argument that removing that one RWF_NOWAIT case might actually be a good thing in general, outside of the "don't allow probing the cache without changing the state of it" issue. But that's handwavy and optimistic. Reality is often not as accomodating ;) Linus