[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <70fb8220-2102-adb5-bbe6-9c2ea74a0623@linux.com>
Date: Sat, 1 Aug 2020 01:10:19 +0300
From: Denis Efremov <efremov@...ux.com>
To: Joe Perches <joe@...ches.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>
Cc: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: libcxgbi: use kvzalloc instead of opencoded
kzalloc/vzalloc
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
Thanks,
Denis
Powered by blists - more mailing lists