On Date: Fri, 28 Dec 2018 15:41:37 -0800 Andrew Morton
wrote:
> From: "Andrew Morton"
> Sent Time: 2018-12-29 07:41:37 (Saturday)
> To: "Peng Wang"
> Cc: andriy.shevche...@linux.intel.com, li...@rasmusvillemoes.dk,
> yno...@caviumnetworks.com, a...@arndb.de, cour...@google.com, osan...@fb.com,
> linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] bitmap: Add bitmap_valloc(), bitmap_vzalloc() and
> bitmap_vfree()
>
> On Fri, 28 Dec 2018 00:18:29 +0800 Peng Wang wrote:
>
> > Introduce bitmap alloc/free helpers when contiguous
> > memory is not necessary.
>
> That's a large bitmap you have there. What code needs this?
Hi Andrew,
Not only for large bitmap. This can also benefit from high memory pressure with
no requirement for physical continuousness.
While these two casees are rather rare. And I only find one place in
mm/swapfile.c.
3224 /* frontswap enabled? set up bit-per-page map for frontswap */
3225 if (IS_ENABLED(CONFIG_FRONTSWAP))
3226 frontswap_map = kvcalloc(BITS_TO_LONGS(maxpages),
3227 sizeof(long),
3228 GFP_KERNEL);
I am not sure whether these helper functions can gain as much benefits as the
efforts to introduce them.
Cheers,
Peng