[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VcQWO36SVmYOJQyVo8uCoA2Wec_CWw2sjRyCd73TfCpTQ@mail.gmail.com>
Date: Tue, 19 Jun 2018 02:18:48 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
agk@...hat.com, Mike Snitzer <snitzer@...hat.com>,
device-mapper development <dm-devel@...hat.com>,
shli@...nel.org, linux-raid@...r.kernel.org,
"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
Yury Norov <ynorov@...iumnetworks.com>,
lkml <linux-kernel@...r.kernel.org>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Joe Perches <joe@...ches.com>
Subject: Re: [PATCH v3 3/5] bitmap: Add bitmap_alloc(), bitmap_zalloc() and bitmap_free()
On Tue, Jun 19, 2018 at 2:10 AM, Andrew Morton
<akpm@...ux-foundation.org> wrote:
> On Mon, 18 Jun 2018 15:01:43 -0700 Dmitry Torokhov <dmitry.torokhov@...il.com> wrote:
>
>> > > +unsigned long *bitmap_alloc(unsigned int nbits, gfp_t flags)
>> > > +{
>> > > + return kmalloc_array(BITS_TO_LONGS(nbits), sizeof(unsigned long), flags);
>> > > +}
>> > > +EXPORT_SYMBOL(bitmap_alloc);
>> > > +
>> > > +unsigned long *bitmap_zalloc(unsigned int nbits, gfp_t flags)
>> > > +{
>> > > + return bitmap_alloc(nbits, flags | __GFP_ZERO);
>> > > +}
>> > > +EXPORT_SYMBOL(bitmap_zalloc);
>> > > +
>> > > +void bitmap_free(const unsigned long *bitmap)
>> > > +{
>> > > + kfree(bitmap);
>> > > +}
>> > > +EXPORT_SYMBOL(bitmap_free);
>> > > +
>> >
>> > I suggest these functions are small and simple enough to justify
>> > inlining them.
>> >
>>
>> We can't as we end up including bitmap.h (by the way of cpumask.h)
>> form slab.h, so we gen circular dependency.
>
> That info should have been in the changelog,
I put it in cover letter, though it perhaps better to have in commit
message itself.
> and probably a code
> comment.
This is done in header file. You meant C-file?
>> Maybe if we removed memcg
>> stuff from slab.h so we do not need to include workqueue.h...
>
> Or move the basic slab API stuff out of slab.h into a new header. Or
> create a new, standalone work_struct.h - that looks pretty simple.
Latter one seems requires least effort without potentially breaking things.
I take it as your suggestion, though I would still give a glance if it
is possible to split exactly memcg part out of slab.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists