Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2522408imm; Mon, 16 Jul 2018 09:22:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfRDyXT9Q5IzQv5ygcDO4qY1CPKFf9zdYeAcpnceFaS47irudm8uawvQYMgTzCcORlRsM4y X-Received: by 2002:a62:2f84:: with SMTP id v126-v6mr4865216pfv.115.1531758147479; Mon, 16 Jul 2018 09:22:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531758147; cv=none; d=google.com; s=arc-20160816; b=tfn//QeENC0P2CVAo8RkLpUG9JXdgVcaVzsFTeWVncEmnveX4RTSmVuYBX9UKBeL8b F0yq4AB4PZJ+OUUYGnVzCjczS9AeiGINt++lNh0rKTxn83/IXnQoWPofpmMRtRFkqXh1 lSh/3s6rJakKLT+3j9rHtB6sdzoNS8z/JspticaRg/h6z5y6P4nXD51HE2oM2Vtp58TX lnFKYjGGByTRv0nmZ3w9Xt+fgODiDUT26BxLUxKgDqhKHfn41lzzlW2Rh1n+KahhdbMi mReu5Sdocw0K3yb6Q5hKsKXQqSmkqQS8VVoTJryW8m4Gos/OOj7OYLP8vZLsO4AzVMGU Gkyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=PLu229rcNxr0j4U84wvfUDTcVjjMcyCpkDrc4JhXeOw=; b=FIYLeNxRoTiJsrQhuUDy+xweFN+otk8RMfI4mwdMrxh9F8ehd8xNQJDCfu6aeQH5Ix AF0EyiNBuC59pnOBrOeoRYl4Tq1tpeCNIO3rAhTpQt9wjxdMzScGiDDLNW0QiQzgQ8bn zdcC3luEQ/DD10Z0GBYvXEgiRagVpDeyXv9fVL1P6eiqIE+8kBCsAUc4EyOLbKPyXKJs KlBkaO0BDySFmiVvYDl4qM0huVMuLke+RenRjjvI/0NiY2WP5UrQE88GFtl1w/RsgL3l XU1R7Vc7Lox7WvnYeiQCHZtkfwbqJytvEIISW74TGGjVlcUEcT0LlaVDuAEOmu8Dpsi5 P2DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=Nryelbml; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si30149631plc.415.2018.07.16.09.22.11; Mon, 16 Jul 2018 09:22:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=Nryelbml; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729360AbeGPQtD (ORCPT + 99 others); Mon, 16 Jul 2018 12:49:03 -0400 Received: from mail-eopbgr40114.outbound.protection.outlook.com ([40.107.4.114]:45888 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727405AbeGPQtC (ORCPT ); Mon, 16 Jul 2018 12:49:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PLu229rcNxr0j4U84wvfUDTcVjjMcyCpkDrc4JhXeOw=; b=NryelbmlOJLO75WMNyLKr2Hx9VrTbg0yNoWEbUTLoJzvX6LsCnFdegcnFby9STWPROhDKGQ1WW0j/F0qGsqoJxowhqvBEHSAhNTFwoKFD5Ic0rSkUw3MkoDqdrDYXpPI0YlbYP4iZKjEkEncXt4fnUP05RvZk3yAJSaiAPjrM88= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jan.dakinevich@virtuozzo.com; Received: from localhost (185.231.240.5) by AM4PR08MB2769.eurprd08.prod.outlook.com (2603:10a6:205:d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.17; Mon, 16 Jul 2018 16:19:57 +0000 Date: Mon, 16 Jul 2018 19:19:53 +0300 From: Jan Dakinevich To: Doug Ledford , Jason Gunthorpe , Leon Romanovsky , Yuval Shaia , Alex Vesker , Erez Shitrit , Feras Daoud , Kees Cook , Evgenii Smirnov , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Denis Lunev , Konstantin Khorenko Subject: Re: [PATCH] IPoIB: use kvzalloc to allocate an array of bucket pointers Message-ID: <20180716191953.28b7821d@virtuozzo.com> In-Reply-To: <1531144263-24717-1-git-send-email-jan.dakinevich@virtuozzo.com> References: <1531144263-24717-1-git-send-email-jan.dakinevich@virtuozzo.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: AM0PR0102CA0033.eurprd01.prod.exchangelabs.com (2603:10a6:208:14::46) To AM4PR08MB2769.eurprd08.prod.outlook.com (2603:10a6:205:d::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6866b55b-9d3f-4a1f-efe0-08d5eb37f9b1 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:AM4PR08MB2769; X-Microsoft-Exchange-Diagnostics: 1;AM4PR08MB2769;3:qXnhJXtaPXUdv5KAnxgmoV9CkK4+V0JJ7w0dWWf9kcqqkkPR8A+3g83jB1LIhHY2CX7Hm1eTIBapaN2dR/1nsKWLHs3ePdJ92YJAGWKr7edAfQ49KZ0okXgdAu9Zm2Nmo9+wKhbf13W6RLShD0jo+b5NOeSs+gzWpSWi6RW2oD8UuFzYWS4gJrdNZ35XYDMBcpkN3OyQrqriuQ0J35H6wh/sdVs+4xyqjdaNHDF9QocbiUcckcd1GpO9PMramJLb;25:4Vwhzwxj4s2Q3xvxo78SwwsLwuyFxo7XxxaehCDht0Z0FBOkI/dmVRQsX+/WVMfahA0T0lyRu3QnELCsLUT6U1GGTPNAMt6gJedShPCjJbbWdTRMzKY5MavXhUHGNMt7qfzP0iIOA4DA94/H2XEP+pTqegs3GGwsmxv+UjVhMj9VjZObBGreKoFc6lVoOhbk+Xjt+tqmWBjIr0VJhEAJh7Ibm/QxHll2OZfJhBzTx2A3qnKGbJWxD8g+d+gjQzz0cZJOWdq1/lBLH+SsQAQakmsDHebiOCBAYU4iEf61Rk1MwBnutRev/C/amnCn3DJLq/7gyto9IUa5o6Ucn761Rg==;31:SMRSlQ8r/FjB/h2gkc/bakMbTngiT9a50dYvqe0knbGRuXgR7j16eegr0j0KoGpPtEsgiGYc1nVaotjW3BD9vK7+lM9GW959sFBXDG3v1AtQ+iwW8PSylNozQYvPhhq39VHfO/1H+AYhAtEMVLIxXintkrbTp7PgoUPwzCEkZMPsEGHYlkSca883QquUJkjqNFLAmglUVkTGmGik+3iJH12TLgy4svTpPwOShDN8vkg= X-MS-TrafficTypeDiagnostic: AM4PR08MB2769: X-Microsoft-Exchange-Diagnostics: 1;AM4PR08MB2769;20:JSZjawFnoNFY+YMoDUmELOQuX/Sr/KAi6NKQFS4tvSqnSCziQ17rVvWknvnVAw1iQDA5ctVSdxkbJpRvgu2fnP5Kjf7Fb0e2sl2rYLRfZ0gRDxsG1TQGwnAlrxxM2T/Aaao2VETu9XKqdOWCuZ4ht294MJLgUoKfi64/X8jT0FH75xtsKphetjCVVz6fb5ynvtmVF4FQlfMzkh8HqDzuYPI31rI8YXbFxSU211O+5mYLH3roo8aoVAxPpDdINmuCysCZkq1DHZORYZpMvET5mxjaWas7eJZ2VPPORf924kNllAS9Bzaem83iUOOLJQwpu/XYTDnGW9dPVhX64Zo0r6Np9MpiiDuvgGUeKy598r+sqNs/BrX8pQbJeKfY7xVOHQoGpELy48+bDdgwArmi2zh15CS9up7xlSTPQIrpWjdW2s4Q2tV3PUnHoO0f6TpaPPfpF3YKXu4FF13iaoNcIFTtnmfuVI1oMpmrzxQHqJ+xnOtfIx44YCD+HOPw2G3e;4:8PPHueYFdSXcjJvSn9L75eHqdGksIWx7+BrbeBadyhoVsREwN6KV/RnyjdvlHYmCYJjl5W/8n7olB7yTRnXwQnRZrFBA0a3MpKI4NRswdW6E7tYqwe/KJVJ9g3eyph+B+ruIuZRj3GR9bxJE26WjxfRH7RIlVaE9H6C+fMKEWC4HMtLOuhTc0etrPcQMNiHitUdV1/Er433aS+okZGdPeUyO4LQWhAjGeL8W3ho80fTBcxwcaIwnmHZyVFsgxpR+7AGt2ECOXu/2SfDUz+1Osg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:AM4PR08MB2769;BCL:0;PCL:0;RULEID:;SRVR:AM4PR08MB2769; X-Forefront-PRVS: 073515755F X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(346002)(366004)(396003)(376002)(136003)(39850400004)(189003)(199004)(6496006)(6246003)(7736002)(305945005)(76506005)(1076002)(110136005)(54906003)(230700001)(105586002)(478600001)(23726003)(50466002)(316002)(106356001)(16526019)(446003)(26005)(186003)(52116002)(76176011)(50226002)(53936002)(68736007)(8936002)(97736004)(3846002)(6116002)(81166006)(14444005)(386003)(44832011)(7416002)(25786009)(486006)(8676002)(6486002)(4326008)(11346002)(229853002)(2906002)(2616005)(956004)(476003)(66066001)(36756003)(81156014)(6666003)(47776003)(107886003)(5660300001)(86362001)(921003)(39210200001)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:AM4PR08MB2769;H:localhost;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;AM4PR08MB2769;23:IuAx1VLfA6IBUQhE8IipsLNob5J1jRxhcthKr0M+1?= =?us-ascii?Q?QMTW4H5ozK1AjMNFcyGjptiJH18GBLkZQk2ThATrzMQR3U+cHpXxk8A9bjU2?= =?us-ascii?Q?QupX23zaKnX+635wXXD26GqUeDLuXHFhEYXpMEas4DR1nA4zR+UG6GtWzplF?= =?us-ascii?Q?m6OihDs5lpTSLKlWa6qx2h320sH+ujVrF1g5Uap3QUfebGWfp4hx7m2nHjhp?= =?us-ascii?Q?AQhvvuJmeJtOAuy11O730sZi5D8yz3AECfknziKNO97XI/O2zDkZ36Aya8Yw?= =?us-ascii?Q?SbDWMjfEtKCV5jwhfBZjOHxqzcmzgaEEVS2fmFhGYfw6MO+KEmVUqMW0q+0i?= =?us-ascii?Q?wojBZ1qQWx83wektmSn2Ltkc2aEsL/wOsotIHB8Rr4+xKaXfJtUNTysSOdfS?= =?us-ascii?Q?UO52emeBwPb0YZ5YYWa6FEhWXoEovkB+GQQuLRddkxTQFFi7aODS/szwX7Y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UMKnICem02Hrz1gBfoQg4DJsEuLHVPXfV1cQ5qGgPQ9ab8zneB9FjDw7g9r3v4snYvcQHT84=;24:KPFY9R3fdQK6wPHrhATyk8sh1W1D9G2JZlZFQB+rIFg0Y7h+SSOTUDNhpemd3SYdBz/+ZI8HjyiQHK7SJdg7jfJWm6yHeNVfTVwyklIYCMw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM4PR08MB2769;7:oIiaF69sna3Hu38njGTablwOUuHm1U0pAJWF16Fb35bp92OpBJ6UOe/ECRQL9mNDU9fLYbqaGINCRodxN6o4eNtxMNKQzgBTk8bkzCgKsCBIGYvY33AzzP455aPWV4ITTUOhKEp68EpUU2E/c4dLVCLQ+eqAdba1zwt7YuAoYN2aa38egLrY95eoiD7yFj0O+MfTQ+UE+yw95Z6p1c1eQPUOXvDiq875I3ez0Q/z1EtWna+3FLza9dBVC8rRgFYs;20:VHU9N0i/uJdTjNJAuVAh2ZF5vJUiMFmR9KIpIjW91r4usD+ARH0IkEBPh3/4bc/xrPv/CKkmTnFYq76fIHO9qyXMZE0oWyZfYKz03v4YO4PYclrIkiRCutBNTWr6UlENf7zTcUaoLlc0aCIfE566idroOUGyaunKGK3TQKw7NLA= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2018 16:19:57.6615 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6866b55b-9d3f-4a1f-efe0-08d5eb37f9b1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR08MB2769 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 9 Jul 2018 16:51:03 +0300 Jan Dakinevich wrote: > This table by default takes 32KiB which is 3rd memory order. > Meanwhile, this memory is not aimed for DMA operation and could be > safely allocated by vmalloc. > > Signed-off-by: Jan Dakinevich > --- > 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