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>] [day] [month] [year] [list]
Message-ID: <20251101074137.98988-1-i.shihao.999@gmail.com>
Date: Sat,  1 Nov 2025 13:11:37 +0530
From: Shi Hao <i.shihao.999@...il.com>
To: martin.petersen@...cle.com
Cc: inux-scsi@...r.kernel.org,
	target-devel@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	i.shihao.999@...il.com
Subject: [PATCH] target: substitute kmap() with kmap_local_page()

There was a single use of kmap() which could be replaced with
kmap_local_page() for better CPU contention and cache locality.
kmap_local_page() ensures non-sleeping operation and provides
better multi-core CPU scalability compared to kmap().
Convert kmap() to kmap_local_page() following modern kernel
coding practices.

Signed-off-by: Shi Hao <i.shihao.999@...il.com>
---
 drivers/target/target_core_rd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/target/target_core_rd.c b/drivers/target/target_core_rd.c
index 6f67cc09c2b5..d6768ea27f94 100644
--- a/drivers/target/target_core_rd.c
+++ b/drivers/target/target_core_rd.c
@@ -159,9 +159,9 @@ static int rd_allocate_sgl_table(struct rd_dev *rd_dev, struct rd_dev_sg_table *
 			sg_assign_page(&sg[j], pg);
 			sg[j].length = PAGE_SIZE;

-			p = kmap(pg);
+			p = kmap_local_page(pg);
 			memset(p, init_payload, PAGE_SIZE);
-			kunmap(pg);
+			kunmap_local(p);
 		}

 		page_offset += sg_per_table;
--
2.51.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ