From patchwork Wed Dec 13 21:58:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13491930 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 6BDFEC4332F for ; Wed, 13 Dec 2023 21:59:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 464336B0352; Wed, 13 Dec 2023 16:59:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C5BC6B034E; Wed, 13 Dec 2023 16:59:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A41F6B034A; Wed, 13 Dec 2023 16:59:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id EBA4C6B032E for ; Wed, 13 Dec 2023 16:59:05 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id CB690160120 for ; Wed, 13 Dec 2023 21:59:05 +0000 (UTC) X-FDA: 81563161050.29.9F9A3DB Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf25.hostedemail.com (Postfix) with ESMTP id 08918A001B for ; Wed, 13 Dec 2023 21:59:03 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=B2U0TbgK; spf=none (imf25.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702504744; 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=w2zuG7w6TAO5KVgC+HOo1DB4SJrmM8vYX5bS/lYoi2U=; b=ReR3msvnNRxZjWsJcEO4uhqRnWSulwbYnEHcH16Ru6RWZMdF7ODfXPc8DPTA8zef7IXf+n 3VDAy/i9vd3OLKeEVoe9ggw/57T6FHod3QKkWaZ+XdySi/iYlWhcH3htKLHrGolBqMFLw8 y4BEIn6TEglSJL+vZBHZLieEdYQ6goU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702504744; a=rsa-sha256; cv=none; b=g9cQYg/SJMwPKaj9KPVtlDzHlccPd4duDAXiYz4iPane4J0XytxsSEtjKY8QGYQC4phB+M YMJHUTm/bG6QdC9bwQuj2afG1Q5/BcFIRersannz6Bp5CsISboN+OSdwrR9N9wiUryFJwx 5EKDqxq0bInQhvd2yJwRKMAzrGagnaw= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=B2U0TbgK; spf=none (imf25.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none 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=w2zuG7w6TAO5KVgC+HOo1DB4SJrmM8vYX5bS/lYoi2U=; b=B2U0TbgKyh6OgLlf81H+LeOrLp pETxhmUxl3N8erB999YhMPmpcphjbWdTz8wLwIAgrrsrYP8lLwZHSu75MtmD0mBeZN31FMm9Wf0mt +1JQnjhEzZcF0iZyDVrPVMZ1SjaztatVxIzA/fiogoA6Pmq5h7LvXr+PZgsBzhfbY2ngrV0KDRoF6 cJSil1qxKFNDNarqlb3NZ7Ilf9bbzOfqtMYpuEQ1UA1PJFOIWamo5wrXOkxI58UWxv4FlFZWpAPd/ B+6Salqv5ehSpPKzdJe9Tdw59GZ31HgM/V5itKSUKzpHUA89jo2nK+kDE6Aj6nTt8fM12bUI5fSIT 7QRfCwDA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rDXFd-002oiV-Nn; 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 07/13] mm: Pass a folio to swap_readpage_bdev_sync() Date: Wed, 13 Dec 2023 21:58:36 +0000 Message-Id: <20231213215842.671461-8-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-Rspamd-Queue-Id: 08918A001B X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: idu1h38b8y4mpx4ip95dxf3j58146sa3 X-HE-Tag: 1702504743-372810 X-HE-Meta: U2FsdGVkX1+Px+NHvc1e69BwCxDiviveL2MkkTpsvyzbPrrkVLuB6pBNzoim3mESDr07753n1nlRaDM56/3NPrRZi4vMl7Ji5LrytuLmtwrFib8OBVtzDRQISNzUZqKmiZ3j847LYG3rQsOHQFFLcsBtcxQs5YvDoq3ZJZdHU3yq1m0SsiLhxxPWnkG2L29LlOUnR+38y0IHEvFzhEFaOqwA1/sA9IR6vlx5T9+WREw2bKsx3tyKT9t8FHC+o4FnB69cm8X+Hq/67KU1qyaM19t3zAtLyX1Cmz5mJZVPrVodurOz9eqsAxZ2bdvK2Ysk791oKDKWQae3O8g4L4Dru3G41ZH2MW5pbt/DrmycRN1Hq4bqdvewKA7Fg6CgVi3iaz9XVlpJaYUEwTZ4kqHzyrmD2TxjjfBMMRjm7ts4HTdXjKGw4971tGd582ra6bHnmMMYqN3dTw2ewIRxTjSPqFiPgL08UhhtfDk6aQ1ckLVcR3cfRrxg2OmPEXurxEbPXbLq6/NPCjBLM2ct7XI39DsPMHBZccREtb27J4YM5QFYmMQAJrpGNTTtThL7IbxxlDEh5HaAR609BrifgzqGWynPd8+i4Z9X8vO7VH9iFT8odKVdfivtnpaYBBNI8Kd0mjhJ4ozvNmOxTcDxDI8b9P55iQCzIHq3jxDemu4VYPla13r9eWkzG0ZfQ4H35I/zvdbWniZVxTamcTGgZi8PiXjjno7QSFxZFZPYkJzhIeTYW3b4zVyhQIWGY0y6VDLNnB7srq5neSkgDV/Sd1ZP0xnIUtoZ1NbZ1hi20GBiicWqPW0GyFLjQtIVfY/ylM+EA/qSIqAAH00/EwOGEgC66sw10NTVqPJn69gC2+/7TO4AesH7KmaTXPEuEWofUJ5qj5n48jjUE1pFzzkKTSfKpVuOhN/IYdLd4h0bXkfb4wyBzv1/vGIFNODhfiy4SsHiLDEZPpjIS0PqLMoj6Sk m7Ts3vdY lJ8l5kv1p31vJUCkPGIVIUqQ8+43CS+3T2gUozA+L3Wg8n/EFNaPL2mG0PWh1CtZ5316OP44mhMQC6APzzyOQLrHQN0lTQVkzTPeUkCQGdwZoVskiTCK6YeHJoTGcm3TAJuJlkLyYFJvf8p2X46vI7yXhlgU6oVW/KdWIXGzNa3b4i+0tQpVPpMI+dXyN2xJKZJW8maarsKX09beTsiTj584h4bGKWGnvx9iF 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 864a558b7b68..0bc52e16452d 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -454,15 +454,15 @@ static void swap_readpage_fs(struct folio *folio, struct swap_iocb **plug) *plug = sio; } -static void swap_readpage_bdev_sync(struct page *page, +static void swap_readpage_bdev_sync(struct folio *folio, struct swap_info_struct *sis) { struct bio_vec bv; struct bio bio; bio_init(&bio, sis->bdev, &bv, 1, REQ_OP_READ); - bio.bi_iter.bi_sector = swap_page_sector(page); - __bio_add_page(&bio, page, thp_size(page), 0); + bio.bi_iter.bi_sector = swap_page_sector(&folio->page); + bio_add_folio_nofail(&bio, folio, folio_size(folio), 0); /* * Keep this task valid during swap readpage because the oom killer may * attempt to access it in the page fault retry time check. @@ -516,7 +516,7 @@ void swap_readpage(struct page *page, bool synchronous, struct swap_iocb **plug) } else if (data_race(sis->flags & SWP_FS_OPS)) { swap_readpage_fs(folio, plug); } else if (synchronous || (sis->flags & SWP_SYNCHRONOUS_IO)) { - swap_readpage_bdev_sync(page, sis); + swap_readpage_bdev_sync(folio, sis); } else { swap_readpage_bdev_async(page, sis); }