From patchwork Wed Mar 29 17:05:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192950 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 24092C761AF for ; Wed, 29 Mar 2023 17:06:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AE3576B0075; Wed, 29 Mar 2023 13:06:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A24316B007B; Wed, 29 Mar 2023 13:06:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 84432900002; Wed, 29 Mar 2023 13:06:29 -0400 (EDT) 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 63BE46B0075 for ; Wed, 29 Mar 2023 13:06:29 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 4D80740D6A for ; Wed, 29 Mar 2023 17:06:28 +0000 (UTC) X-FDA: 80622564456.28.5AAA6F5 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf01.hostedemail.com (Postfix) with ESMTP id 24E9F40008 for ; Wed, 29 Mar 2023 17:06:24 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=FOvoXjEE; spf=pass (imf01.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109585; a=rsa-sha256; cv=none; b=plYzrfHttILBehINnTZoic/krgFnVrhe4bUiS7E51HWyhZepsBSLpxsDafLfStzXv2cvnu zzijlfrasPiUv7gyq42VyDB0y87Mok2fkyY9OG7hUEcmdTvuTweJZWpK13rwlWAsmx/+m6 pTgAxmnOCmQ9o61858zjaFclQitBYEw= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=FOvoXjEE; spf=pass (imf01.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109585; 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=kKJBTmnd2YIfpjD3AfeOKUtgOUUgwb/dhMYX9hb9VBw=; b=dv3IUMXG7A9U4YbrSl62IdVOmlvpfan/N8yMRwKJQoiL05kDMEQV1+Eh1l/lwmOEXCxc4+ nLUsh2WZHS+L1A6HMOqtkvovSAIAZ1lq3IrwRCuYKbVAtEIeZKqtNagjhWCWP2mYuI/mEO t3r7pVEfYXE1j6b9VFSeVE7JewQH+UQ= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109585; x=1711645585; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TM7IBzNT7/14xTwowvJHPkTQX8VqnD9S2m9y/nmGXPw=; b=FOvoXjEEUoF40fdaIzr4vZil9HFAqgyRvmSfONY0u7aOkW1KVGxk13EV 7/eGgkJE8rvxyHsvKrq6HteXB1FPX518krpRcRgh8QU5Lo/BAIhZB0A40 WD4SEpSdFviwJ2QUZP66qX2UEOi2UgdFr3lLi1s5JZHxqvviAPOnekMjg shKLQ6k7MT3p5iKcWEfPew7OKsqSv5VKiagKneeAeEi6xzHEzQNzkrfnE 2H6AjpTm5HPsDWf6PBJlQ7y1FM/Nc5nXNBXuMLi4cHYU9SiltqvELc+As K+sd0AKC0Gx/aqo3jQzwvRw6X36OTi7F4zkJr+dQsEj7fcopSxKXCkwDQ g==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807000" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:06:23 +0800 IronPort-SDR: TPUgnMOchQmOtIemMAJYeoaANbw3O85noVF4yU1XbOdGVws2IfjSvEVpse5iHayL5FJk3ZDTVn R4RiyZJdJVkAJhSqqkl1lYYxrwL0mjp9UG/IAuKBs/3UkwYgPsLAShHjaDff3DljP8G/e0qs3h YmsL2IQVYPx4D5Nsm1mRC1ibboufP6ZXkrRFlEBoGGzZ6X2PVl3u2ijGjUK7AQl44IwfKCQM3W TSCRpE5QJlob+bWuYc05Xw2kOlY6QPKgJgDwm0wNCFDKOzYedoqcc97DhiSigHOnLUOkx0gOpl WA0= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:22:33 -0700 IronPort-SDR: yyFKbwfOEl8vOCdlm8o/aBoXRqrxQAe/juUDniPmOyA6KC3OO/1kAhsEUEEYLVsoCPHg44tswf U4/t+Eht43hkaug7Qk7+EHXBNakm9gxNEJ3L7TUTHnO6hgxDZl9fUBGyLmIxwdFu7eEHUBHXpO mDw2lAW7wlIEhS9KYrLKfz7UOp4cFL6JpgENGlPck777d5NCTl/Xpkpz9Aa9Jk2kPk7WtKRS1c WhXighkZnqtO4Hr42uzllq0JA5rZq58zNcIHYGF/y9POF5WRGYiU4StYBbSKeJu9G4+2PBGJBo br4= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:22 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 01/19] swap: use __bio_add_page to add page to bio Date: Wed, 29 Mar 2023 10:05:47 -0700 Message-Id: <7849b142e073b20f033e5124a39080f59e5f19d2.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 24E9F40008 X-Rspamd-Server: rspam01 X-Stat-Signature: 4nj5d7mi574hj4f8cjd4owr8qioiog4x X-HE-Tag: 1680109584-181895 X-HE-Meta: U2FsdGVkX19oQj95qGPDkCiUY37WSCLk7SHI9otgVEey4u3essynB60xhjLAOjiEUaMvjNmxNLJ688pJM4x7QNsz+Gcnn7bGYJwvd3+ra4MniJqND6AIQID9qIa9fP92r9Vr6DWC0NGo2VBw4ab6ZljHwQrEDKcYKSbhfRw9BC2SuS9IZpw8pThp54JO6kBf4j7MokikRs3vu4kOh2L2fPPZuC6pahNWQebJsOgQ3Tz4CUfGxOAu6k7Tjfe5u5W9RJ2hWEJR4sX7/CArGgOzisF4nmXoTNw5qq96ru/dd6EYHKUiRvacjDjqsW3Ry9Y/QaRv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X/95vSU 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 swap code only adds a single page to a newly created bio. So use __bio_add_page() to add the page which is guaranteed to succeed in this case. This brings us closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Reviewed-by: Pankaj Raghav --- 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 87b682d18850..684cd3c7b59b 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -338,7 +338,7 @@ static void swap_writepage_bdev_sync(struct page *page, bio_init(&bio, sis->bdev, &bv, 1, REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc)); bio.bi_iter.bi_sector = swap_page_sector(page); - bio_add_page(&bio, page, thp_size(page), 0); + __bio_add_page(&bio, page, thp_size(page), 0); bio_associate_blkg_from_page(&bio, page); count_swpout_vm_event(page); @@ -360,7 +360,7 @@ static void swap_writepage_bdev_async(struct page *page, GFP_NOIO); bio->bi_iter.bi_sector = swap_page_sector(page); bio->bi_end_io = end_swap_bio_write; - bio_add_page(bio, page, thp_size(page), 0); + __bio_add_page(bio, page, thp_size(page), 0); bio_associate_blkg_from_page(bio, page); count_swpout_vm_event(page); @@ -468,7 +468,7 @@ static void swap_readpage_bdev_sync(struct page *page, 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_add_page(&bio, page, thp_size(page), 0); /* * Keep this task valid during swap readpage because the oom killer may * attempt to access it in the page fault retry time check. @@ -488,7 +488,7 @@ static void swap_readpage_bdev_async(struct page *page, bio = bio_alloc(sis->bdev, 1, REQ_OP_READ, GFP_KERNEL); bio->bi_iter.bi_sector = swap_page_sector(page); bio->bi_end_io = end_swap_bio_read; - bio_add_page(bio, page, thp_size(page), 0); + __bio_add_page(bio, page, thp_size(page), 0); count_vm_event(PSWPIN); submit_bio(bio); }