All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib: interval_tree_test: validate benchmark parameters
@ 2026-06-09  0:54 Samuel Moelius
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Moelius @ 2026-06-09  0:54 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Samuel Moelius, open list:LIBRARY CODE

The interval tree runtime test accepts module parameters that are later
used as divisors while generating randomized intervals and while
reporting average timings. For example, max_endpoint=1 makes the
generated interval end value zero and the next modulo operation divides
by that zero value.

Reject non-positive counts and require max_endpoint to provide at least
one non-zero generated endpoint before the test allocates state or
starts the benchmark.

Assisted-by: Codex:gpt-5.5-cyber-preview
Signed-off-by: Samuel Moelius <sam.moelius@trailofbits.com>
---
 lib/interval_tree_test.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/lib/interval_tree_test.c b/lib/interval_tree_test.c
index 16200feacbf3..58f6f3a307f4 100644
--- a/lib/interval_tree_test.c
+++ b/lib/interval_tree_test.c
@@ -311,6 +311,27 @@ static inline int span_iteration_check(void) {return 0; }
 
 static int interval_tree_test_init(void)
 {
+	if (nnodes <= 0) {
+		pr_warn("nnodes must be positive\n");
+		return -EINVAL;
+	}
+	if (nsearches <= 0) {
+		pr_warn("nsearches must be positive\n");
+		return -EINVAL;
+	}
+	if (perf_loops <= 0) {
+		pr_warn("perf_loops must be positive\n");
+		return -EINVAL;
+	}
+	if (search_loops <= 0) {
+		pr_warn("search_loops must be positive\n");
+		return -EINVAL;
+	}
+	if (max_endpoint < 2) {
+		pr_warn("max_endpoint must be at least 2\n");
+		return -EINVAL;
+	}
+
 	nodes = kmalloc_objs(struct interval_tree_node, nnodes);
 	if (!nodes)
 		return -ENOMEM;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] lib: interval_tree_test: validate benchmark parameters
@ 2026-06-09 17:23 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-06-09 17:23 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "low confidence bisect report"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20260609005446.1241288.1525a5964698.interval-tree-test-small-max-endpoint-div0@trailofbits.com>
References: <20260609005446.1241288.1525a5964698.interval-tree-test-small-max-endpoint-div0@trailofbits.com>
TO: Samuel Moelius <sam.moelius@trailofbits.com>
TO: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: Samuel Moelius <sam.moelius@trailofbits.com>
CC: linux-kernel@vger.kernel.org

Hi Samuel,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-nonmm-unstable]
[also build test ERROR on akpm-mm/mm-everything next-20260608]
[cannot apply to linus/master v6.16-rc1]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Samuel-Moelius/lib-interval_tree_test-validate-benchmark-parameters/20260609-090211
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-nonmm-unstable
patch link:    https://lore.kernel.org/r/20260609005446.1241288.1525a5964698.interval-tree-test-small-max-endpoint-div0%40trailofbits.com
patch subject: [PATCH] lib: interval_tree_test: validate benchmark parameters
:::::: branch date: 16 hours ago
:::::: commit date: 16 hours ago
config: x86_64-allnoconfig-bpf (https://download.01.org/0day-ci/archive/20260609/202606091922.G3wiQ6O2-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260609/202606091922.G3wiQ6O2-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202606091922.G3wiQ6O2-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from interval_tree_test.c:11:
   ../../../lib/interval_tree_test.c: In function 'interval_tree_test_init':
>> ../../../lib/interval_tree_test.c:315:17: error: implicit declaration of function 'pr_warn' [-Wimplicit-function-declaration]
     315 |                 pr_warn("nnodes must be positive\n");
         |                 ^~~~~~~
   ../../../lib/interval_tree_test.c:335:17: error: implicit declaration of function 'kmalloc_objs'; did you mean 'kzalloc_obj'? [-Wimplicit-function-declaration]
     335 |         nodes = kmalloc_objs(struct interval_tree_node, nnodes);
         |                 ^~~~~~~~~~~~
         |                 kzalloc_obj
   ../../../lib/interval_tree_test.c:335:30: error: expected expression before 'struct'
     335 |         nodes = kmalloc_objs(struct interval_tree_node, nnodes);
         |                              ^~~~~~

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-09 17:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 17:23 [PATCH] lib: interval_tree_test: validate benchmark parameters kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-06-09  0:54 Samuel Moelius

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.