Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp950290ybt; Wed, 17 Jun 2020 18:49:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQh439JmHGsdaYj+Y5snhy4uLkzYih9NIucZCyb9OSZgzdeYEgBjeFEHams33G3qAgFQXv X-Received: by 2002:a17:907:20cf:: with SMTP id qq15mr1823086ejb.238.1592444980832; Wed, 17 Jun 2020 18:49:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592444980; cv=none; d=google.com; s=arc-20160816; b=Ew5E3eMSSjMeqeCAXQu3AsKRY+R/pU2sy9PqyP1sKhYgOnpdgYhFCKWT2rZSnA603v p6UXgJvxHFWjoJtB2hr+QEAHOMkQ6ClP9mNN6hRfbuXuq8r3pwR/G2abXxvxtBeAoQ8g K8dwRuR+MvGwqN5U+eKH8oqERRNO67Fp0H9LNp6Hf7r3KRrAd00COHJKKWaS4VIu1ZuG eqx93gktiXJxrU4qFnCRhUIBNoIlE5C62buYPVuLg1sGsnfsNnp7KMTPNZq+drhHc9+x O4mCq2fYuYaQnTrwzRqLWn042baSgqkmwBBHle+re9f94qxbJaUNoeo0xIzlotkDqUOj k9tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:content-transfer-encoding:date :message-id:in-reply-to:cc:to:from:reply-to:subject:mime-version :dkim-signature:dkim-filter; bh=Pannmd10RMEWppu+DWu4lQZprpbqd5OwcGCGr0quGWE=; b=05I/b5QHeVh3jpnpCJb1ZMRhfRgJbuMZbIbQzIjkCRQaArM/sU+VtiDhhV3PAWn59/ 4a0+A1xUj1eAjUQWz1UXSqeHBCPRuqnrDY9XzYwAVXd3IycItOTSn95B1+a+Q2L17suw AyTadJKTm7et9kuJEYeilUqFPUZVTUSvZ0HJTqLx75xHxAgf9duUTLx4bl/TUnLoMHMm 0+TibGXwUXCB6z7P4+YWIHCm1zKWodNi7Ay7HOvl69cC2GrSBN+xfWftklSNt81W2tiI KM/zNdKg62C97P8k4AC+w1LIZbLFUaHWRN9SH8kmseqPdWwk3mOpzP0ixKuIW+VmDnQb O/1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=BWE0KXVY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr10si1108967ejc.204.2020.06.17.18.49.18; Wed, 17 Jun 2020 18:49:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=BWE0KXVY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731996AbgFRBpM (ORCPT + 99 others); Wed, 17 Jun 2020 21:45:12 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:27863 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733126AbgFRBpG (ORCPT ); Wed, 17 Jun 2020 21:45:06 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20200618014502epoutp01ddfd72448015311ee18567fc002ab756~ZgAUeLn_r1482214822epoutp01D for ; Thu, 18 Jun 2020 01:45:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20200618014502epoutp01ddfd72448015311ee18567fc002ab756~ZgAUeLn_r1482214822epoutp01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1592444702; bh=Pannmd10RMEWppu+DWu4lQZprpbqd5OwcGCGr0quGWE=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=BWE0KXVY7ajZglAxOoQjjbPMRmOovLLAuVXp0Mop80YID1AI61+Tky3hhWIqlmZ2+ NU+WcYUhoYBSo9uIAkt10S2gD0Cq5/FDHTquAjBHmttISngmzM7P5BCw5ASFARYlVC OMtW6sGLSFKfutogcUuxG1FYujGUz3ifciH/skcM= Received: from epcpadp1 (unknown [182.195.40.11]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20200618014502epcas1p3760deec044c13b085ad47409f1677dea~ZgAUFJIFB3136331363epcas1p3T; Thu, 18 Jun 2020 01:45:02 +0000 (GMT) Mime-Version: 1.0 Subject: RE: [RFC PATCH v2 4/5] scsi: ufs: L2P map management for HPB read Reply-To: daejun7.park@samsung.com From: Daejun Park To: Avri Altman , Daejun Park , ALIM AKHTAR , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "asutoshd@codeaurora.org" , "beanhuo@micron.com" , "stanley.chu@mediatek.com" , "cang@codeaurora.org" , "bvanassche@acm.org" , "tomas.winkler@intel.com" CC: "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Sang-yoon Oh , Sung-Jun Park , yongmyung lee , Jinyoung CHOI , Adel Choi , BoRam Shin X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <1210830415.21592444702291.JavaMail.epsvc@epcpadp1> Date: Thu, 18 Jun 2020 10:03:45 +0900 X-CMS-MailID: 20200618010345epcms2p65b2ea8678f720c38ef620bf2f4a86c22 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y X-Hop-Count: 3 X-CMS-RootMailID: 20200615062708epcms2p19a7fbc051bcd5e843c29dcd58fff4210 References: <231786897.01592213402355.JavaMail.epsvc@epcpadp1> <231786897.01592212081335.JavaMail.epsvc@epcpadp2> <336371513.41592205783606.JavaMail.epsvc@epcpadp2> <231786897.01592205482200.JavaMail.epsvc@epcpadp2> <231786897.01592214002170.JavaMail.epsvc@epcpadp1> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + > > +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. It was intend to provide user-configurable pre-allocated memory to reduce latency due to memory allocation. The value of ufshpb_host_map_kbytes can be set to max_lru_active_cnt x srgns_per_rgn, if the user want to. Thanks, Daejun