Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp398724pxa; Fri, 31 Jul 2020 15:26:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4JedITWAVo0yuPmU78pkh9bYe+piS03MOBxYmyy6VxaVrShj6rbCmjXec80eQejC9sCoU X-Received: by 2002:a17:906:23e9:: with SMTP id j9mr6008686ejg.107.1596234366105; Fri, 31 Jul 2020 15:26:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596234366; cv=none; d=google.com; s=arc-20160816; b=lTqRUU+PfR3ruhTC/usTfMqIrFtjGPm2R5Vxl9dWEdrLV+g3NzzA0sXfBNzHY0qB0S SatC1G+IRWfJULMsrYN5GecJUHcXllHRS+qQm1gKhojFV5AxepJHs++dFrd70vjk/PDg VXuFs6LhxI3uRHhuB1OyjpZ2CF20bdsMg2oFzD1WB+UFW5tKFAWcjgVYKtFmc39M9wVC 7+Ns5NDT0iuCxFx5cRMBacBkG+ylx0K8MPTwFh2I7kJB8gtv5wg0tcGmlMNpWY+lmxJa P2V51V5I2vXgtcL61dIPfKyNC5YEX7Jse6LCzTwTRhyn8FK9AJ4QDuxPCHwxPzI4AvaM IE5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=Lwtud3vssuFBzkgOcIClkEdYilI03IcZKD6/0iWaiXI=; b=Kt7iUtkeFDv1tIkAL3ZQk8BsnUq5i4aXtbigdfOGYkLCm/edZ4XMdejpgcAkQe7lvF wWOKkL6BN/9txX2SMLl7qaZli5M6brpj53EJuqu3YeBPs9FkrpMR2qzcmDcsQ7YRXHsJ t+zUH0GLso1La2K/anqRFy4GnToj1x6ds6Q5eHphUGlR9WnjAwgGquU5Z07hdrJrvtF6 lmR2fOEZ8X7tUTb5p7xOAWkZSWZeZGyBLPJEQSPSR84ToAEoKkdTciT2E96L2HaFwGHs ctsXUEbW2Qy2AIZ6ureBEMjT2vP+duCuqINNEdPi8wKzuLBkd3IrJk1s1a9AsPtY5Rlu PdBw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ox11si5621623ejb.727.2020.07.31.15.25.44; Fri, 31 Jul 2020 15:26:06 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726841AbgGaWYg (ORCPT + 99 others); Fri, 31 Jul 2020 18:24:36 -0400 Received: from smtprelay0078.hostedemail.com ([216.40.44.78]:50538 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725767AbgGaWYg (ORCPT ); Fri, 31 Jul 2020 18:24:36 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id 4789A837F24A; Fri, 31 Jul 2020 22:24:35 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:966:967:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2525:2560:2563:2682:2685:2828:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4385:5007:8660:9025:10004:10400:10848:11026:11232:11233:11658:11914:12043:12296:12297:12438:12740:12760:12895:13069:13148:13230:13311:13357:13439:14181:14659:14721:21080:21451:21627:21939:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: bike70_390312226f87 X-Filterd-Recvd-Size: 2079 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf16.hostedemail.com (Postfix) with ESMTPA; Fri, 31 Jul 2020 22:24:34 +0000 (UTC) Message-ID: <8638183f559c0f8f8d377bd0a6c91903b2c588df.camel@perches.com> Subject: Re: [PATCH] scsi: libcxgbi: use kvzalloc instead of opencoded kzalloc/vzalloc From: Joe Perches To: Denis Efremov , "Martin K. Petersen" , "James E.J. Bottomley" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 31 Jul 2020 15:24:33 -0700 In-Reply-To: <70fb8220-2102-adb5-bbe6-9c2ea74a0623@linux.com> References: <20200731215524.14295-1-efremov@linux.com> <33d943d2b83f17371df09b5962c856ea2d894954.camel@perches.com> <70fb8220-2102-adb5-bbe6-9c2ea74a0623@linux.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.3-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2020-08-01 at 01:10 +0300, Denis Efremov wrote: > > On 8/1/20 12:58 AM, Joe Perches wrote: > > On Sat, 2020-08-01 at 00:55 +0300, Denis Efremov wrote: > > > Remove cxgbi_alloc_big_mem(), cxgbi_free_big_mem() functions > > > and use kvzalloc/kvfree instead. > > > > Sensible, thanks. > > > > > diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c > > [] > > > @@ -77,9 +77,9 @@ int cxgbi_device_portmap_create(struct cxgbi_device *cdev, unsigned int base, > > > { > > > struct cxgbi_ports_map *pmap = &cdev->pmap; > > > > > > - pmap->port_csk = cxgbi_alloc_big_mem(max_conn * > > > - sizeof(struct cxgbi_sock *), > > > - GFP_KERNEL); > > > + pmap->port_csk = kvzalloc(array_size(max_conn, > > > + sizeof(struct cxgbi_sock *)), > > > + GFP_KERNEL); > > > > missing __GFP_NOWARN > > > > kvmalloc_node adds __GFP_NOWARN internally to kmalloc call > https://elixir.bootlin.com/linux/v5.8-rc4/source/mm/util.c#L568 Only when there's a fallback, and the fallback does not.