From patchwork Wed Dec 13 21:58:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13491922 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D5ABC4167D for ; Wed, 13 Dec 2023 21:58:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6AB3F8D005E; Wed, 13 Dec 2023 16:58:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 65B298D0049; Wed, 13 Dec 2023 16:58:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D4158D005E; Wed, 13 Dec 2023 16:58:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 369728D0049 for ; Wed, 13 Dec 2023 16:58:54 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id F238280370 for ; Wed, 13 Dec 2023 21:58:53 +0000 (UTC) X-FDA: 81563160546.02.A7F904C Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf21.hostedemail.com (Postfix) with ESMTP id 573A81C0009 for ; Wed, 13 Dec 2023 21:58:52 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=wDsLOCja; dmarc=none; spf=none (imf21.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702504732; a=rsa-sha256; cv=none; b=jGrMaSgQ9pyB4mXxmfHqodEtKP68WqyInNW8Kod3GTwiIo4cHOIipZd3bKGepIKIe2PhY8 LB9vEoq9upFjSIHXmdDQCW5vLUt5TqE1hU+7Gku3DRrPCAY73LdzAL5IFI/HldrXPiwglQ GaJuy/F2Y2TW+7RR1Ucp6hg5zmJdot8= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=wDsLOCja; dmarc=none; spf=none (imf21.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702504732; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=lw+qwrt+KKR5QlG7QzLE80oGlMWbv0Oz38MMkGdHuTc=; b=C4TgMgpsHW7ocWmE0zhtmCPz03oQoq/bXh/ZSCL+YDSe+lUOxLzMJOdkqOt66aIekauf8O rEQ2YzplElYa62mTyO9CZvYU5fkG/Xa+CGpLVmNBqyT8qY6N4h61cdN/Tv87StFDJ1KHeX vF6lNT+Ku98w2+NE1kkViRY+IsLCbsA= 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=lw+qwrt+KKR5QlG7QzLE80oGlMWbv0Oz38MMkGdHuTc=; b=wDsLOCjaC9pST9/f/lUpKdZ/O/ IVbCCA6q19SBzhxOQfbQPOVuNGPj23oh1exhmufLAGa93yU9BIETTcJ0nsgBozn9BAZktgBAhZWMs ToapnhfJsoD3jNF/LedeuG/KSPtrLuHuWkxa4KV4LtA3JYB2dQkoqbHxaARoqoWWk2OElbIZ8SjLq 9uz9rXFSxMFSI3KyAOfORQjVgb2WXCl9ezTUfxz8wnYgvVgrhE1jcTO5H1c2O+AUny/CU97jslabM k/PB3OxI0Uyjz3CJv1e8BX0Jr1wHcy1P9YhqqL0V08KFot9CxKnCN43CL/dswdXGpEnRa8rl+Xd6c ImDAD81Q==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rDXFd-002oiX-QS; Wed, 13 Dec 2023 21:58:45 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 08/13] mm: Pass a folio to swap_readpage_bdev_async() Date: Wed, 13 Dec 2023 21:58:37 +0000 Message-Id: <20231213215842.671461-9-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20231213215842.671461-1-willy@infradead.org> References: <20231213215842.671461-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 573A81C0009 X-Stat-Signature: 9domob1g573ufge5dxy7md5pkhhrmeof X-HE-Tag: 1702504732-31489 X-HE-Meta: U2FsdGVkX1+VoxWCVFzILZt638TOj6RIrx3oDy2DoMw/SvjtpMsy2F7NsfPn7xE25AGGmmXNKAXJFP+uitw+KoKJ6UC8PhvY7Dql3pdlPMjQcUJQHdcz8W1Jt4rYSTc56lL+z2yr+9FyAMNakmjMuTJH9hAVPS0SSW7bAa5ErNinffLz2VkYvLeps/S3CY+lJRrT5AGs75xcEzg9NEnxdTyiGUEMko4D1Zv48zvOpg6A2GwovSzDc0X5mJSpB4J3KB/5Y+oIUbsvc/BDAFEJcrT2U7/jrNBP+d1oU27fFZTmBPjrGxlyrC4nKuymYrfNvzR9X6WAd3q/cUJXara5zjwNFRm/jWUzfeuc3MVhmYeNsF6/h5V0zEtXOrnFRDDBnIVTDl6Jr6OEvqLvWYk+52jVPbr+xaNtlD0O9x4g0LdSLlJYu9rhURG3s+E15Hc1uPYBXm2GXoxyTiLN/X8QhD90Dn4d9gMHIO8zhO2FkKoaOSehy5hWRwjeIMCFn1erHg0mBKVp8gyH4Ua2Uu8Y+eryIS8P/1jPnjmBlMSudOuvHV9UDtX2jpnH+Bekkxqg1p2zngYIuKyE5iCCwC7/WWfyxa1WT0JDIEcxHCdS5HUwwn6LBSsXlZ0TQF6r5W4ipyxhP9gsKapg0To1U7aW61SnNPhz+UnZTf16uLauuioZfWkbSve0UK3yfodyq9NNF/l53YtfDLddiqXTTAY+fdVVtkoIZJK+MN22DnPLvkx7Pe3dzrZh29P5k9PTGQP4rNiJrPzmjAKFKaDP9DdvK9sU/qUEYfLEx5vmZvrgYuhZWRRofr3jqNhUOAZ6gkwdkE095WNqp2yDH4VBii8+70ra12HbXeh3LohQX1njpddTTenz9hPeJwoD1A0k9npyG5z1LTzd9PVrTXu3+wRT4MV3LObd37vOzaYviv2AxWAcyV9lBx2JD5CD6Jthwn30I2lS0MW+qo4yfnnJR17 z7PqrCxM Vx49oymSR85PigzrsBzATRt2av2WNbqssC5/gNylzX5J127dAdnghcOk80pRlsHQSkIC9zl5Z9qLcXrxHTsdNaAW1B6G2RxG6lqaEVGxsCJMrFNZm8Qgoae4fAfPxK9Lk6cpf69Ud+SQAGJJOuT5L1+c9CTaulPpCzb2PnzbsY4tHQRPj2DEdonCpRwccYFv+lRkrGK6j3Wej2dtVQkY7KQNmwmHjWmYtG2lU 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: List-Subscribe: List-Unsubscribe: Make it plain that this takes the head page (which before this point was just an assumption, but is now enforced by the compiler). Signed-off-by: Matthew Wilcox (Oracle) --- mm/page_io.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 0bc52e16452d..e18afcd9c19a 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -474,15 +474,15 @@ static void swap_readpage_bdev_sync(struct folio *folio, put_task_struct(current); } -static void swap_readpage_bdev_async(struct page *page, +static void swap_readpage_bdev_async(struct folio *folio, struct swap_info_struct *sis) { struct bio *bio; bio = bio_alloc(sis->bdev, 1, REQ_OP_READ, GFP_KERNEL); - bio->bi_iter.bi_sector = swap_page_sector(page); + bio->bi_iter.bi_sector = swap_page_sector(&folio->page); bio->bi_end_io = end_swap_bio_read; - __bio_add_page(bio, page, thp_size(page), 0); + bio_add_folio_nofail(bio, folio, folio_size(folio), 0); count_vm_event(PSWPIN); submit_bio(bio); } @@ -518,7 +518,7 @@ void swap_readpage(struct page *page, bool synchronous, struct swap_iocb **plug) } else if (synchronous || (sis->flags & SWP_SYNCHRONOUS_IO)) { swap_readpage_bdev_sync(folio, sis); } else { - swap_readpage_bdev_async(page, sis); + swap_readpage_bdev_async(folio, sis); } if (workingset) {