[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <EF345418-FC8F-4104-88C5-38B7597453B5@oracle.com>
Date: Mon, 16 Jul 2018 20:18:29 +0200
From: Håkon Bugge <haakon.bugge@...cle.com>
To: Jan Dakinevich <jan.dakinevich@...tuozzo.com>
Cc: Doug Ledford <dledford@...hat.com>, Jason Gunthorpe <jgg@...pe.ca>,
Leon Romanovsky <leon@...nel.org>,
Yuval Shaia <yuval.shaia@...cle.com>,
Alex Vesker <valex@...lanox.com>,
Erez Shitrit <erezsh@...lanox.com>,
Feras Daoud <ferasda@...lanox.com>,
Kees Cook <keescook@...omium.org>,
Evgenii Smirnov <evgenii.smirnov@...fitbricks.com>,
OFED mailing list <linux-rdma@...r.kernel.org>,
linux-kernel@...r.kernel.org, Denis Lunev <den@...tuozzo.com>,
Konstantin Khorenko <khorenko@...tuozzo.com>
Subject: Re: [PATCH] IPoIB: use kvzalloc to allocate an array of bucket
pointers
> On 16 Jul 2018, at 18:19, Jan Dakinevich <jan.dakinevich@...tuozzo.com> wrote:
>
> On Mon, 9 Jul 2018 16:51:03 +0300
> Jan Dakinevich <jan.dakinevich@...tuozzo.com> wrote:
>
>> This table by default takes 32KiB which is 3rd memory order.
Only if PAGE_SIZE is 4KiB...
>> Meanwhile, this memory is not aimed for DMA operation and could be
>> safely allocated by vmalloc.
>>
>> Signed-off-by: Jan Dakinevich <jan.dakinevich@...tuozzo.com>
lgtm,
Reviewed-by: Håkon Bugge <haakon.bugge@...cle.com>
Thxs, Håkon
>> ---
>> drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c
>> b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 26cde95..cb752df
>> 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
>> +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
>> @@ -1526,7 +1526,7 @@ static int ipoib_neigh_hash_init(struct
>> ipoib_dev_priv *priv) return -ENOMEM;
>> set_bit(IPOIB_STOP_NEIGH_GC, &priv->flags);
>> size = roundup_pow_of_two(arp_tbl.gc_thresh3);
>> - buckets = kcalloc(size, sizeof(*buckets), GFP_KERNEL);
>> + buckets = kvcalloc(size, sizeof(*buckets), GFP_KERNEL);
>> if (!buckets) {
>> kfree(htbl);
>> return -ENOMEM;
>> @@ -1554,7 +1554,7 @@ static void neigh_hash_free_rcu(struct rcu_head
>> *head) struct ipoib_neigh __rcu **buckets = htbl->buckets;
>> struct ipoib_neigh_table *ntbl = htbl->ntbl;
>>
>> - kfree(buckets);
>> + kvfree(buckets);
>> kfree(htbl);
>> complete(&ntbl->deleted);
>> }
>
> ping
>
> --
> Best regards
> Jan Dakinevich
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists