From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72E78C388F2 for ; Tue, 3 Nov 2020 07:31:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DC3CB2240C for ; Tue, 3 Nov 2020 07:31:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC3CB2240C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5FD9A6B005C; Tue, 3 Nov 2020 02:31:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5AFAA6B005D; Tue, 3 Nov 2020 02:31:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 49E936B0068; Tue, 3 Nov 2020 02:31:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0171.hostedemail.com [216.40.44.171]) by kanga.kvack.org (Postfix) with ESMTP id 1C0F76B005C for ; Tue, 3 Nov 2020 02:31:06 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B3C778249980 for ; Tue, 3 Nov 2020 07:31:05 +0000 (UTC) X-FDA: 77442285690.04.fruit96_5702201272b6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 8804280073B5 for ; Tue, 3 Nov 2020 07:31:05 +0000 (UTC) X-HE-Tag: fruit96_5702201272b6 X-Filterd-Recvd-Size: 2099 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Tue, 3 Nov 2020 07:31:05 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 7885967373; Tue, 3 Nov 2020 08:31:02 +0100 (CET) Date: Tue, 3 Nov 2020 08:31:02 +0100 From: Christoph Hellwig To: "Matthew Wilcox (Oracle)" Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, hch@lst.de, kent.overstreet@gmail.com Subject: Re: [PATCH 04/17] mm/filemap: Support readpage splitting a page Message-ID: <20201103073102.GD8389@lst.de> References: <20201102184312.25926-1-willy@infradead.org> <20201102184312.25926-5-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201102184312.25926-5-willy@infradead.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Nov 02, 2020 at 06:42:59PM +0000, Matthew Wilcox (Oracle) wrote: > For page splitting to succeed, the thread asking to split the > page has to be the only one with a reference to the page. Calling > wait_on_page_locked() while holding a reference to the page will > effectively prevent this from happening with sufficient threads waiting > on the same page. Use put_and_wait_on_page_locked() to sleep without > holding a reference to the page, then retry the page lookup after the > page is unlocked. > > Since we now get the page lock a little earlier in filemap_update_page(), > we can eliminate a number of duplicate checks. The original intent > (commit ebded02788b5 ("avoid unnecessary calls to lock_page when waiting > for IO to complete during a read")) behind getting the page lock later > was to avoid re-locking the page after it has been brought uptodate by > another thread. We still avoid that because we go through the normal > lookup path again after the winning thread has brought the page uptodate. > > Signed-off-by: Matthew Wilcox (Oracle) Looks good: Reviewed-by: Christoph Hellwig