Skip to contentSkip to conversation

bitmap: Properly initialise destination bitmap for scatter & gather test

PATCH Applied Christophe Leroy (CS GROUP) 3 participants 3 messages Jul 9

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitmap: Properly initialise destination bitmap for scatter & gather test

Erhard reports failure of bitmap tests on powerpc:

test_bitmap: loaded.
test_bitmap: [lib/test_bitmap.c:397] bitmaps contents differ: expected "1,3-4,9", got "1,3-4,9,65-71,73-79,81-87,89-95,97-99"
test_bitmap: parselist('0-2047:128/256'): 912
test_bitmap: scnprintf("%*pbl", '0-32767'): 5977
test_bitmap: test_bitmap_read_perf: 1191082
test_bitmap: test_bitmap_write_perf: 1270153
test_bitmap: failed 1 out of 208655 tests

The happens mainly when CONFIG_INIT_STACK_ALL_PATTERN is set.

Commit 6b5a4b687367 ("bitmap: Add test for out-of-boundary modifications for scatter & gather") extended the test to out-of-boundary bits, but those bits where left uninitialised.

Properly initialise the entire result bitmap before the test.

Fixes 6b5a4b687367 ("bitmap: Add test for out-of-boundary modifications for scatter & gather")
---
 lib/test_bitmap.c | 1 +
 1 file changed, 1 insertion(+)
lib/test_bitmap.c +1 -0
index 69813c10e6c0..448c3eb48a4a 100644
@@ -392,6 +392,7 @@ static void __init test_bitmap_sg(void)
 
 	/* Scatter/gather relationship */
 	bitmap_zero(bmap_tmp, 100);
+	bitmap_zero(bmap_res, 100);
 	bitmap_gather(bmap_tmp, bmap_scatter, sg_mask, nbits);
 	bitmap_scatter(bmap_res, bmap_tmp, sg_mask, nbits);
 	expect_eq_bitmap(bmap_scatter, bmap_res, 100);
Signature · 1 line
2.54.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Christophe Leroy (CS GROUP)

Erhard reports failure of bitmap tests on powerpc:

test_bitmap: loaded.
test_bitmap: [lib/test_bitmap.c:397] bitmaps contents differ: expected "1,3-4,9", got "1,3-4,9,65-71,73-79,81-87,89-95,97-99"
test_bitmap: parselist('0-2047:128/256'): 912
test_bitmap: scnprintf("%*pbl", '0-32767'): 5977
test_bitmap: test_bitmap_read_perf: 1191082
test_bitmap: test_bitmap_write_perf: 1270153
test_bitmap: failed 1 out of 208655 tests

Quoted 7 lines

The happens mainly when CONFIG_INIT_STACK_ALL_PATTERN is set.

Commit 6b5a4b687367 ("bitmap: Add test for out-of-boundary modifications for scatter & gather") extended the test to out-of-boundary bits, but those bits where left uninitialised.

Properly initialise the entire result bitmap before the test.

Thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
Applied
#2 lore raw
In reply to Christophe Leroy (CS GROUP)
Quoted 16 lines · Christophe Leroy (CS GROUP)

Erhard reports failure of bitmap tests on powerpc:

test_bitmap: loaded.
test_bitmap: [lib/test_bitmap.c:397] bitmaps contents differ: expected "1,3-4,9", got "1,3-4,9,65-71,73-79,81-87,89-95,97-99"
test_bitmap: parselist('0-2047:128/256'): 912
test_bitmap: scnprintf("%*pbl", '0-32767'): 5977
test_bitmap: test_bitmap_read_perf: 1191082
test_bitmap: test_bitmap_write_perf: 1270153
test_bitmap: failed 1 out of 208655 tests

The happens mainly when CONFIG_INIT_STACK_ALL_PATTERN is set.

Commit 6b5a4b687367 ("bitmap: Add test for out-of-boundary modifications for scatter & gather") extended the test to out-of-boundary bits, but those bits where left uninitialised.

Quoted 6 lines

Properly initialise the entire result bitmap before the test.

Fixes 6b5a4b687367 ("bitmap: Add test for out-of-boundary modifications for scatter & gather")

Applied, thanks!

Quoted 18 lines
---
 lib/test_bitmap.c | 1 +
 1 file changed, 1 insertion(+)
lib/test_bitmap.c +1 -0
index 69813c10e6c0..448c3eb48a4a 100644
@@ -392,6 +392,7 @@ static void __init test_bitmap_sg(void)
 
 	/* Scatter/gather relationship */
 	bitmap_zero(bmap_tmp, 100);
+	bitmap_zero(bmap_res, 100);
 	bitmap_gather(bmap_tmp, bmap_scatter, sg_mask, nbits);
 	bitmap_scatter(bmap_res, bmap_tmp, sg_mask, nbits);
 	expect_eq_bitmap(bmap_scatter, bmap_res, 100);
Signature · 1 line
2.54.0