From: Jiri Olsa <jolsa@redhat.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Yury Norov <ynorov@caviumnetworks.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Kate Stewart <kstewart@linuxfoundation.org>,
Matthew Wilcox <willy@infradead.org>,
Philippe Ombredanne <pombredanne@nexb.com>,
David Ahern <dsahern@gmail.com>,
David Carrillo-Cisneros <davidcc@google.com>,
Andi Kleen <ak@linux.intel.com>,
Jin Yao <yao.jin@linux.intel.com>,
linux-kernel@vger.kernel.org,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Mike Snitzer <snitzer@redhat.com>
Subject: Re: [PATCH 2/2] bitmap: sync tools with new bitmap allocation API
Date: Wed, 4 Jul 2018 19:24:45 +0200 [thread overview]
Message-ID: <20180704172445.GE19164@krava> (raw)
In-Reply-To: <20180704153617.tps2asygskoym46d@penguin>
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
next prev parent reply other threads:[~2018-07-04 17:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-23 7:35 [PATCH 1/2] perf: drop unneeded bitmap_zero() in util/header.c Yury Norov
2018-06-23 7:35 ` [PATCH 2/2] bitmap: sync tools with new bitmap allocation API Yury Norov
2018-06-24 21:31 ` Dmitry Torokhov
2018-06-24 22:45 ` Yury Norov
2018-07-04 15:36 ` Dmitry Torokhov
2018-07-04 17:24 ` Jiri Olsa [this message]
2018-06-25 14:12 ` Arnaldo Carvalho de Melo
2018-07-04 17:30 ` Jiri Olsa
2018-07-04 22:15 ` [PATCH v2 " Yury Norov
2018-07-25 11:22 ` Arnaldo Carvalho de Melo
2018-07-24 20:26 ` [PATCH 1/2] perf: drop unneeded bitmap_zero() in util/header.c Yury Norov
2018-07-25 11:20 ` Arnaldo Carvalho de Melo
2018-08-18 11:24 ` [tip:perf/urgent] perf tools: Drop unneeded bitmap_zero() calls tip-bot for Yury Norov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180704172445.GE19164@krava \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=davidcc@google.com \
--cc=dmitry.torokhov@gmail.com \
--cc=dsahern@gmail.com \
--cc=kstewart@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=pombredanne@nexb.com \
--cc=snitzer@redhat.com \
--cc=willy@infradead.org \
--cc=yao.jin@linux.intel.com \
--cc=ynorov@caviumnetworks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).