lkml.org 
[lkml]   [2020]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRE: [RFC PATCH v2 4/5] scsi: ufs: L2P map management for HPB read
    Date

    > +
    > +static struct ufshpb_map_ctx *ufshpb_get_map_ctx(struct ufshpb_lu *hpb)
    > +{
    > + struct ufshpb_map_ctx *mctx;
    > + int i, j;
    > +
    > + mctx = mempool_alloc(ufshpb_drv.ufshpb_mctx_pool, GFP_KERNEL);
    > + if (!mctx)
    > + return NULL;
    So you use ufshpb_host_map_kbytes as the min_nr in your mempool_create,
    But you know that you need max_lru_active_cnt x srgns_per_rgn such mapping context elements.
    So you are
    a) failing to provide the slab allocator an information that you already have, and
    b) selecting from a finite pool will assure that you'll never exceed max-active-regions,
    even if some corner case fails your logic.

    \
     
     \ /
      Last update: 2020-06-17 13:45    [W:4.478 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site