Skip to contentSkip to conversation

tools/testing/scatterlist: Add missing defines

PATCH In review Maor Gottlieb 3 participants 4 messages Jan 18, 2022 – Jan 26, 2022 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/testing/scatterlist: Add missing defines

The cited commits replaced preemptible with pagefault_disabled and flush_kernel_dcache_page with flush_dcache_page respectively, hence need to update the corresponding defines in the test.

Fixes 723aca208516 ("mm/scatterlist: replace the !preemptible warning in sg_miter_stop()")
Fixes 0e84f5dbf8d6 ("scatterlist: replace flush_kernel_dcache_page with flush_dcache_page")
---
 tools/testing/scatterlist/linux/mm.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/scatterlist/linux/mm.h +2 -1
index 16ec895bbe5f..5bd9e6e80625 100644
@@ -74,7 +74,7 @@ static inline unsigned long page_to_phys(struct page *page)
 	      __UNIQUE_ID(min1_), __UNIQUE_ID(min2_),   \
 	      x, y)
 
-#define preemptible() (1)
+#define pagefault_disabled() (0)
 
 static inline void *kmap(struct page *page)
 {
@@ -127,6 +127,7 @@ kmalloc_array(unsigned int n, unsigned int size, unsigned int flags)
 #define kmemleak_free(a)
 
 #define PageSlab(p) (0)
+#define flush_dcache_page(p)
 
 #define MAX_ERRNO	4095
 
Signature · 1 line
2.25.4
Tested-by on v1 1/1
#1 lore raw
Quoted 7 lines · Maor Gottlieb

The cited commits replaced preemptible with pagefault_disabled and flush_kernel_dcache_page with flush_dcache_page respectively, hence need to update the corresponding defines in the test.

Fixes 723aca208516 ("mm/scatterlist: replace the !preemptible warning in sg_miter_stop()")
Fixes 0e84f5dbf8d6 ("scatterlist: replace flush_kernel_dcache_page with flush_dcache_page")

Both commits are part of v5.16-rc1.

Sebastian

maintainer
#2 lore raw
In reply to Maor Gottlieb
Quoted 3 lines · On Tue, 18 Jan 2022 10:21:05 +0200 Maor Gottlieb <[email protected]> wrote:

The cited commits replaced preemptible with pagefault_disabled and flush_kernel_dcache_page with flush_dcache_page respectively, hence need to update the corresponding defines in the test.

What are the effects of this change? Does it fix compilation issues? Runtime issues? If so, what are those issues?

#3 lore raw
Quoted 8 lines · Andrew Morton
Quoted 3 lines · On Tue, 18 Jan 2022 10:21:05 +0200 Maor Gottlieb <[email protected]> wrote:

The cited commits replaced preemptible with pagefault_disabled and flush_kernel_dcache_page with flush_dcache_page respectively, hence need to update the corresponding defines in the test.

What are the effects of this change? Does it fix compilation issues? Runtime issues? If so, what are those issues?

There is this runtime test
tools/testing/scatterlist/main.c

and without the changes to
tools/testing/scatterlist/linux/mm.h

it simply does not compile. Since it is userland, the kernel details like preemptible() or pagefault_disabled() don't matter much, it has just to compile and run.

Sebastian