Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp110448ybt; Thu, 18 Jun 2020 19:56:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxi7lK7dtdVSEoNMVqJF+7cWOtAxcmw2EFZjZWkdE6J1gppOhQYgGOs4AgFOpfk3titka4r X-Received: by 2002:a05:6402:1c87:: with SMTP id cy7mr1209171edb.354.1592535408611; Thu, 18 Jun 2020 19:56:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592535408; cv=none; d=google.com; s=arc-20160816; b=cBC7Ps8UPozUBUJk0+VNNgzU2y2jlGAfPv1qJNNdXgCPNNIy78OxnLcClqok1fX/tP 5vBGzm3ZEaOcbgIaBAZdj2Q6mop8aXYzspPBrXKk8SjFicjIVn/ZvAzXjmO9DdNKoMPB G0zrEiBNqaHxGdHTfcaXjJsjAnnN1IaRYtcs3A8muQZvvSJriBbgl5nqfsAWFMXkfLnB t+CUSjqeQkZBUgcDUTrOEd80OFKAz3cjA01U6V0X9aroA+RE5xQoWfbOncDy6RLaGxrH GTv7vPkwd0DQhhQO4cp2EX4xyco/1rwtu3o5ckHVGCuS2ByfzEjojyOj0I5FESvWF100 GCWg== 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=qllPWHtyQDpgVZtZhXrldNZVcdedGzFgcgGqEa7an5o=; b=MSP6Im4fUoA+/9CQ4YmxoJWKT0iR2vba/yxRTkhYrKv1Q7/Wgx23IcnLBOk4XojswL NyjGmKoorUNpgfndMiKo+Ni1u4fETQ/pumBGx59QYmLRueqayj/KPkfwUIwZW3oGj1ty HE9CygPtR935X9sHdb4BXHLtcuTgEpcyyrjZaar8ftmg0yvHF1Vf6t9PZEv2s6y70dR8 xAZX+5Oe4AJzIReKHkXB7dRE8JWyBgTALtCD8ShoTwvjkhysItQv/Fg+trBnDfpxtZY1 Bm1y1KjlZYh1vRSmYFXN/MRe5ltQRU3ciLDsOSnvOWGqjBfUg6h9r4KkDpLmBdlyWSl+ ltyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=UKRVppsl; 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 gr2si2928201ejb.454.2020.06.18.19.56.25; Thu, 18 Jun 2020 19:56:48 -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=UKRVppsl; 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 S1728711AbgFSAUG (ORCPT + 99 others); Thu, 18 Jun 2020 20:20:06 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:44970 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728704AbgFSAUF (ORCPT ); Thu, 18 Jun 2020 20:20:05 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20200619002002epoutp0432e4daaeb6e703c41db6b70e489992c3~ZyfYv55Om0195501955epoutp04J for ; Fri, 19 Jun 2020 00:20:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20200619002002epoutp0432e4daaeb6e703c41db6b70e489992c3~ZyfYv55Om0195501955epoutp04J DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1592526002; bh=qllPWHtyQDpgVZtZhXrldNZVcdedGzFgcgGqEa7an5o=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=UKRVppslD2a8bk98GG+1UAqZiClJhTZiI0FTIk8fFXxEVT+pscZoSbMkDtKkGhcaY tUIPVLLgPKTfSUHw/AUrs9UFq7dgeQyCn3wBUm1rn/l/C7Ig8UF1nrOJCJfyeLXxZ8 1rF/+t/8LBULMjRIDErWUmLmeXFoWAhe23vOeeb8= Received: from epcpadp1 (unknown [182.195.40.11]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20200619002001epcas1p354c155552aba2b742c752d5cf91908d9~ZyfYG_78R0349603496epcas1p3q; Fri, 19 Jun 2020 00:20:01 +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: <231786897.01592526001702.JavaMail.epsvc@epcpadp1> Date: Fri, 19 Jun 2020 09:16:40 +0900 X-CMS-MailID: 20200619001640epcms2p130129f48c57b56c8ae802cc9e2570225 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> <1210830415.21592444702291.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. > Ok, I see your point. > It is as if you expect that a "user" will query the unit descriptors first, > Make some calculations, and then will run modprobe with the proper value. > Are you assuming that an "intelligent" user does all that? > > The reasonable scenario IMO, is that OEMs will initiate a service in their > ramdisk/init.rc with some default value. > > Don't you see the damage potential in using a wrong value here? > I understand your scenario. I will remove module parameter and set min_nr value of memory pool as "max_lru_active_cnt x srgns_per_rgn" size. Thanks, Daejun