[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180704172445.GE19164@krava>
Date: Wed, 4 Jul 2018 19:24:45 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: Yury Norov <ynorov@...iumnetworks.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Kate Stewart <kstewart@...uxfoundation.org>,
Matthew Wilcox <willy@...radead.org>,
Philippe Ombredanne <pombredanne@...b.com>,
David Ahern <dsahern@...il.com>,
David Carrillo-Cisneros <davidcc@...gle.com>,
Andi Kleen <ak@...ux.intel.com>,
Jin Yao <yao.jin@...ux.intel.com>,
linux-kernel@...r.kernel.org,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Mike Snitzer <snitzer@...hat.com>
Subject: Re: [PATCH 2/2] bitmap: sync tools with new bitmap allocation API
On Wed, Jul 04, 2018 at 03:36:17PM +0000, Dmitry Torokhov wrote:
SNIP
> > > > diff --git a/tools/include/linux/bitmap.h b/tools/include/linux/bitmap.h
> > > > index 48c208437bbd..b9b85b94c937 100644
> > > > --- a/tools/include/linux/bitmap.h
> > > > +++ b/tools/include/linux/bitmap.h
> > > > @@ -98,12 +98,23 @@ static inline int test_and_set_bit(int nr, unsigned long *addr)
> > > > }
> > > >
> > > > /**
> > > > - * bitmap_alloc - Allocate bitmap
> > > > - * @nbits: Number of bits
> > > > + * Allocation and deallocation of bitmap.
> > > > */
> > > > -static inline unsigned long *bitmap_alloc(int nbits)
> > > > +static inline unsigned long *bitmap_alloc(unsigned int nbits, gfp_t flags)
> > >
> > > This makes absolutely no sense for userspace API. What gfp_t even means
> > > here?
> > >
> > > If you want to introduce bitmap_zalloc and bitmap_free it is fine but
> > > adding dummy parameters to match kernel API exactly is a folly.
> >
> > Identical API makes easier porting the code from kernel to tools.
> > Refer for example declaration of kmalloc in:
> > tools/testing/radix-tree/linux.c
> > tools/testing/scatterlist/linux/mm.h
> > tools/virtio/linux/kernel.h
> > tools/virtio/ringtest/ptr_ring.c
>
> These are unittests for the APIs in question, of course they would have
> to match exactly.
>
> perf tool however is not a unittest, so there is no need to match kernel
> API.
+1, please remove that flags argument
thanks,
jirka
Powered by blists - more mailing lists