Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9984455imu; Wed, 5 Dec 2018 13:53:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/WTSiis8IxjkSAmr1FfQLHvfB6GTlF8pykHtZ/Xvzp02kP0XfEu8AvmmEhkWhJ1f+/8MT8T X-Received: by 2002:a62:4bcf:: with SMTP id d76mr27343673pfj.170.1544046796382; Wed, 05 Dec 2018 13:53:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544046796; cv=none; d=google.com; s=arc-20160816; b=QclKxCpXG5elgp08qr3m/hFGFsTxHi8m/xVQTtd+Nm0MtC+mpo2GV1oY1RanE2jFuO FgJBpJZozp2YRiGNTvYr85qKfMzYYatQI8WJ00XquCnl3mzX3gVNbap2RVEXChHdwFST BPssgNhf5t6n/FRDAg/4/3i140n6epcGAUeYhzlRBAlSQYRuFkGGMev5JFLb1v81Jc4Y fHArvUU/jYutylV9QO4bVfmM52xkoqqaMU8vxD9ZvDj8bVoGq5ZD7uycCw6r8bKFueVv vgdhD9F+hgbAug+TBUoIu+CmCXa2eBXXGY8knUq+0nOMsv8gckaR5uZ1DnvAJiVTH7Xo 7F5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=vZ0c7m50AKXdy3+2iCqt+TcHB3zWQhj9RCuGnFIcAMU=; b=k/fmc9VQQuhtIbCpMbknY+ZyGyi/71DikWcOV3MKtq7l+42wa3KiRWhDWpC9l9A21r xa4JhNGd0xltBkzgMArR/CWbcrATSEC7D/lx8jQ1eqdKmJ0Zex2Bxy3f+cdGYh5acYKw zMG4k9QNqDrk5ArKW2/xogF1t57xT3kn0MnhCoo24nzJnR9Q5zMTXTpKA/V2cSgnnNpQ nN7lZJj3BfyH9U2vZOHNJv5DUg4W7dEwJsgU/qjZT8u3nCPDWR5dDutv1xdW71lVy455 4umQjZtjII49NzhsMq3kDRyE20PRRdQr3wmpTvkcRyl7PnsK1A3MSjYGrJ4Zh2Y8NxOp n/eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=qnxPjWmL; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7si22180939pfw.200.2018.12.05.13.53.01; Wed, 05 Dec 2018 13:53:16 -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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=qnxPjWmL; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728254AbeLEVwS (ORCPT + 99 others); Wed, 5 Dec 2018 16:52:18 -0500 Received: from mail-it1-f196.google.com ([209.85.166.196]:38867 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727679AbeLEVwS (ORCPT ); Wed, 5 Dec 2018 16:52:18 -0500 Received: by mail-it1-f196.google.com with SMTP id h65so22686437ith.3 for ; Wed, 05 Dec 2018 13:52:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vZ0c7m50AKXdy3+2iCqt+TcHB3zWQhj9RCuGnFIcAMU=; b=qnxPjWmLkzZ29odbg/nQeqMrd5XX4cC4bsnQasXy+yTnAJTslzypPR5HxQ0uhDgn/O cY1rBK48W5ql0bzjOx2e7z4FPSoJPJCKztfcSWUptrGvWOte/jepHpKG8pcP168n4uiK q7Vsv+NBiwFmzfFv83mO5eBUMn0aAskPlE4UEHQA8sS2+bhL/zCsAMSbNJAATNVDk71z /Mxgb//DL3IN4xgion4yxXtAH6SPM71R3vzrgedy2oVycXtr6oe+0fO6B9vLVUuLvk5/ kk1uFVg8iLLGjdGONHOjP129osce5BEHR+o1+YKt847TWczvNPeMbI9I8tAv/arsIJ4R I81w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=vZ0c7m50AKXdy3+2iCqt+TcHB3zWQhj9RCuGnFIcAMU=; b=Lj8n+drcIkfnvteo+A/tfxgnuUgybIrpGwPYPvCJISVqDmoTFV55JhyXmnpzGl44zw fgX1T9c10uFW0Cd85ONIoZhTUG0iqFHnWsXg5LlMQCGnbAgYz/XpemZlnum9R5QL+8hw VAFTjUIGZbkVEghsIQJ+DFEqgEhgz6MLbef0w+dSFkYN6pDEVcrtzPjKs5Cad6FebCP+ XnPiiVz/VJgGb+0+gPbupJk6TKK0O/RG3PGJS3jToCzHtVKs0L0jdqE9woZGgTpVnRlm 7x3X5b3u3RpfvVDh9DthB2zt/mLZWLa/9BdDjIxM8yc/RDpUPi/bY+s1UkOEJ6VCY+YF qaKQ== X-Gm-Message-State: AA+aEWataSFbIGjR1jCjKRDtIkAMjosJvGD2ETk7mIlGmX9wgjtbQ+Rj xg6zsjQ0PmC+xUP3XRwoUpPQ1A== X-Received: by 2002:a24:446:: with SMTP id 67mr14563343itb.64.1544046737816; Wed, 05 Dec 2018 13:52:17 -0800 (PST) Received: from localhost ([8.46.75.5]) by smtp.gmail.com with ESMTPSA id d3sm9172767itc.40.2018.12.05.13.52.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Dec 2018 13:52:17 -0800 (PST) Date: Wed, 5 Dec 2018 13:52:09 -0800 From: Johannes Weiner To: Josef Bacik Cc: kernel-team@fb.com, linux-kernel@vger.kernel.org, tj@kernel.org, david@fromorbit.com, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, riel@redhat.com, jack@suse.cz Subject: Re: [PATCH 2/4] filemap: kill page_cache_read usage in filemap_fault Message-ID: <20181205215209.GA13938@cmpxchg.org> References: <20181130195812.19536-1-josef@toxicpanda.com> <20181130195812.19536-3-josef@toxicpanda.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181130195812.19536-3-josef@toxicpanda.com> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 30, 2018 at 02:58:10PM -0500, Josef Bacik wrote: > If we do not have a page at filemap_fault time we'll do this weird > forced page_cache_read thing to populate the page, and then drop it > again and loop around and find it. This makes for 2 ways we can read a > page in filemap_fault, and it's not really needed. Instead add a > FGP_FOR_MMAP flag so that pagecache_get_page() will return a unlocked > page that's in pagecache. Then use the normal page locking and readpage > logic already in filemap_fault. This simplifies the no page in page > cache case significantly. > > Signed-off-by: Josef Bacik That's a great simplification. Looks correct to me. Acked-by: Johannes Weiner