lkml.org 
[lkml]   [2022]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCHv4 6/9] zsmalloc: pass limit on pages per-zspage to zs_create_pool()
    On (22/10/31 14:41), Sergey Senozhatsky wrote:
    [..]
    > -struct zs_pool *zs_create_pool(const char *name)
    > +struct zs_pool *zs_create_pool(const char *name, unsigned long num_pages)
    > {
    > int i;
    > struct zs_pool *pool;
    > struct size_class *prev_class = NULL;
    > - unsigned long num_pages;
    > +
    > + if (WARN_ON(num_pages < ZS_MIN_PAGES_PER_ZSPAGE ||
    > + num_pages > ZS_MAX_PAGES_PER_ZSPAGE))
    > + return NULL;

    I tend to think that creating `struct zs_tunables` would be better. For
    the time being zs_tunables will contain only one member max_zspage_len,
    but it can be extended in the future.

    \
     
     \ /
      Last update: 2022-11-09 07:26    [W:4.103 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site