diff mbox series

[2/3] mm/highmem: Convert memzero_page() to kmap_local_page()

Message ID 20210309212137.2610186-3-ira.weiny@intel.com (mailing list archive)
State New, archived
Headers show
Series btrfs: Convert kmap/memset/kunmap to memzero_user() | expand

Commit Message

Ira Weiny March 9, 2021, 9:21 p.m. UTC
From: Ira Weiny <ira.weiny@intel.com>

The memset() does not need to be performed atomically.  Use
kmap_local_page() which will improved performance for this call.

Cc: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Cc: David Sterba <dsterba@suse.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
 include/linux/highmem.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 832b49b50c7b..0dc0451cf1d1 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -334,9 +334,9 @@  static inline void memcpy_to_page(struct page *page, size_t offset,
 
 static inline void memzero_page(struct page *page, size_t offset, size_t len)
 {
-	char *addr = kmap_atomic(page);
+	char *addr = kmap_local_page(page);
 	memset(addr + offset, 0, len);
-	kunmap_atomic(addr);
+	kunmap_local(addr);
 }
 
 #endif /* _LINUX_HIGHMEM_H */