lkml.org 
[lkml]   [2018]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Re: [PATCH] bitmap: Add bitmap_valloc(), bitmap_vzalloc() and bitmap_vfree()
On Date: Fri, 28 Dec 2018 15:41:37 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:

> From: "Andrew Morton" <akpm@linux-foundation.org>
> Sent Time: 2018-12-29 07:41:37 (Saturday)
> To: "Peng Wang" <rocking@whu.edu.cn>
> Cc: andriy.shevchenko@linux.intel.com, linux@rasmusvillemoes.dk, ynorov@caviumnetworks.com, arnd@arndb.de, courbet@google.com, osandov@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 <rocking@whu.edu.cn> 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
\
 
 \ /
  Last update: 2018-12-29 05:17    [W:0.038 / U:1.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site