lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230719095848.3422629-8-zhangpeng362@huawei.com>
Date:   Wed, 19 Jul 2023 17:58:46 +0800
From:   Peng Zhang <zhangpeng362@...wei.com>
To:     <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
        <willy@...radead.org>
CC:     <sidhartha.kumar@...cle.com>, <akpm@...ux-foundation.org>,
        <wangkefeng.wang@...wei.com>, <sunnanyong@...wei.com>,
        ZhangPeng <zhangpeng362@...wei.com>
Subject: [PATCH v2 7/9] mm/page_io: use a folio in swap_writepage_bdev_async()

From: ZhangPeng <zhangpeng362@...wei.com>

Saves one implicit call to compound_head().

Signed-off-by: ZhangPeng <zhangpeng362@...wei.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@...radead.org>
---
 mm/page_io.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/page_io.c b/mm/page_io.c
index 0c96ea9dd258..e28395331bb0 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -352,6 +352,7 @@ static void swap_writepage_bdev_async(struct page *page,
 		struct writeback_control *wbc, struct swap_info_struct *sis)
 {
 	struct bio *bio;
+	struct folio *folio = page_folio(page);
 
 	bio = bio_alloc(sis->bdev, 1,
 			REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc),
@@ -362,8 +363,8 @@ static void swap_writepage_bdev_async(struct page *page,
 
 	bio_associate_blkg_from_page(bio, page);
 	count_swpout_vm_event(page);
-	set_page_writeback(page);
-	unlock_page(page);
+	folio_start_writeback(folio);
+	folio_unlock(folio);
 	submit_bio(bio);
 }
 
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ