lkml.org 
[lkml]   [2017]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] lib: test module for find_*_bit() functions
Hi Alexey, Andrew,

Thanks for comments.

On Fri, Nov 10, 2017 at 12:45:18PM +0200, Alexey Dobriyan wrote:
> On 11/10/17, Andrew Morton <akpm@linux-foundation.org> wrote:
> > On Thu, 9 Nov 2017 17:07:14 +0300 Yury Norov <ynorov@caviumnetworks.com>
> > wrote:
> >
> >> find_bit functions are widely used in the kernel, including hot paths.
> >> This module tests performance of that functions in 2 typical scenarios:
> >> randomly filled bitmap with relatively equal distribution of set and
> >> cleared bits, and sparse bitmap which has 1 set bit for 500 cleared bits.
> >>
> >> ...
> >>
> >> +config TEST_FIND_BIT
> >
> > Well. It doesn't actually "test" the code. It measures its performance ;)
>
> Yes!
>
> Yyra, you can grab CONFIG_BENCHMARK_* namespace :-)

There's no CONFIG_BENCHMARK_* namespace actually. The 'CONFIG_*_BENCHMARK' is
referenced only 3 times in linux sources - CONFIG_RING_BUFFER_BENCHMARK,
CONFIG_TRACEPOINT_BENCHMARK and CONFIG_GUP_BENCHMARK, so I simply didn't know
about it. Some other tests like lib/rbtree_test.c also measure performance and
use TEST namespace, but if you think it's better, I don't object to change it.

> Another thing:
>
> > +
> > + return 0;
> > +}
> > +module_init(find_bit_test);
> > +
> > +static void __exit test_find_bit_cleanup(void)
> > +{
> > +}
> > +module_exit(test_find_bit_cleanup);
>
> module exit hook is entirely unnecessary as you can return -E from init hook.
> See lib/test-kstrtox.c

Ack.

I thought to send v3, but the patch is already in next tree, so I'll
send fix in separated patch. OK?

Yury

\
 
 \ /
  Last update: 2017-11-14 11:08    [W:0.059 / U:50.716 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site