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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 1971CC433DF for ; Tue, 13 Oct 2020 03:00:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6005D20757 for ; Tue, 13 Oct 2020 03:00:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="H3p/y2nw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6005D20757 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DAC60900004; Mon, 12 Oct 2020 23:00:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D5DE1900002; Mon, 12 Oct 2020 23:00:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C4C8B900004; Mon, 12 Oct 2020 23:00:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0108.hostedemail.com [216.40.44.108]) by kanga.kvack.org (Postfix) with ESMTP id 992F6900002 for ; Mon, 12 Oct 2020 23:00:15 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 245E41EE6 for ; Tue, 13 Oct 2020 03:00:15 +0000 (UTC) X-FDA: 77365398390.02.flesh23_5317b45271ff Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id F3B0B101AFC0E for ; Tue, 13 Oct 2020 03:00:14 +0000 (UTC) X-HE-Tag: flesh23_5317b45271ff X-Filterd-Recvd-Size: 3933 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Tue, 13 Oct 2020 03:00:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=RVbxbYoOWjLwJdgW3Cb8bReeSeO0h546yKG6qIjspYY=; b=H3p/y2nwCsnwVAvyqNJcScmcXf 7dbIMAax0AH1bYvGMIaeym0IhvhyT8hLJjADqB54QN3VnkHx/0uGoGBm8zuyl3RCFIr2lSfoOWkV7 jalkTzG/hg1s6mJIBBtK5aO1puGN8Wfk3obKTdNYoPuuZeRmde8Uzf/l+o1wEKpuZrnQPS3SXkCJs vM3EYuMX9Lxt6yRXU07HEF0IGLvJ/aTkVvN8H4NxT2wLdEmceUUY7KeQ4FEmDXntbasDpo6SKS3fx 8HIHW2qYBbBYm4Oh3MmYgDZqUX9uzlQ24cCLc/8rRkLSWgfri1sl7MA5BYd9LzLRzuNwSEaWokgtF qz172xuw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSAXq-00076E-Tx; Tue, 13 Oct 2020 03:00:10 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Mel Gorman Subject: [PATCH 3/3] mm: Inline __wait_on_page_locked_async into caller Date: Tue, 13 Oct 2020 04:00:08 +0100 Message-Id: <20201013030008.27219-5-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20201013030008.27219-1-willy@infradead.org> References: <20201013030008.27219-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: The previous patch removed wait_on_page_locked_async(), so inline __wait_on_page_locked_async into __lock_page_async(). Signed-off-by: Matthew Wilcox (Oracle) --- mm/filemap.c | 53 ++++++++++++++++++++++------------------------------ 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index ac2dfa857568..a3c299d6a2b6 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1224,36 +1224,6 @@ int wait_on_page_bit_killable(struct page *page, i= nt bit_nr) } EXPORT_SYMBOL(wait_on_page_bit_killable); =20 -static int __wait_on_page_locked_async(struct page *page, - struct wait_page_queue *wait, bool set) -{ - struct wait_queue_head *q =3D page_waitqueue(page); - int ret =3D 0; - - wait->page =3D page; - wait->bit_nr =3D PG_locked; - - spin_lock_irq(&q->lock); - __add_wait_queue_entry_tail(q, &wait->wait); - SetPageWaiters(page); - if (set) - ret =3D !trylock_page(page); - else - ret =3D PageLocked(page); - /* - * If we were succesful now, we know we're still on the - * waitqueue as we're still under the lock. This means it's - * safe to remove and return success, we know the callback - * isn't going to trigger. - */ - if (!ret) - __remove_wait_queue(q, &wait->wait); - else - ret =3D -EIOCBQUEUED; - spin_unlock_irq(&q->lock); - return ret; -} - /** * put_and_wait_on_page_locked - Drop a reference and wait for it to be = unlocked * @page: The page to wait for. @@ -1421,7 +1391,28 @@ EXPORT_SYMBOL_GPL(__lock_page_killable); =20 int __lock_page_async(struct page *page, struct wait_page_queue *wait) { - return __wait_on_page_locked_async(page, wait, true); + struct wait_queue_head *q =3D page_waitqueue(page); + int ret =3D 0; + + wait->page =3D page; + wait->bit_nr =3D PG_locked; + + spin_lock_irq(&q->lock); + __add_wait_queue_entry_tail(q, &wait->wait); + SetPageWaiters(page); + ret =3D !trylock_page(page); + /* + * If we were succesful now, we know we're still on the + * waitqueue as we're still under the lock. This means it's + * safe to remove and return success, we know the callback + * isn't going to trigger. + */ + if (!ret) + __remove_wait_queue(q, &wait->wait); + else + ret =3D -EIOCBQUEUED; + spin_unlock_irq(&q->lock); + return ret; } =20 /* --=20 2.28.0