Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp562140imm; Mon, 9 Jul 2018 06:52:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeFBC+8/aqcvm4JX46rYJczN1D3FAO4L+pc46lIBuj0x9cqjo6i8g7mW3HxQ4VGfApc2s5q X-Received: by 2002:a17:902:bd97:: with SMTP id q23-v6mr20573504pls.238.1531144354521; Mon, 09 Jul 2018 06:52:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531144354; cv=none; d=google.com; s=arc-20160816; b=C9W0TVLaACtKqkjcKhgjc3EojKcsO+AbUuwi8lLBFwpbTjEWIxYgtcrfRH/mjCMHot w+GJO9ErTE+RM27DcwFDohn+Ny6gNo6OvNV2cVMzi+9I2P27A33vxEEK57ibvjL2Z3Wp MmDL+MidFwc4IhevnhX8P5ih7YmJnFnNzDf2MXzcVmEtVFLfiHJHLiIIjhUQX9+wIiON 7QRcXGJSZmqTXS6v6HQjL8cNnqyZPnI2nG2LRXiyCeY9JdLMGXQVnOO1/uvSqQvyIa1U idPGiP5F8JqrOdi/NeZ0IFi/1nTBr/7SB6sF5ydOB7x2Y+IfsIiKKIw5Ef/x72RQXyna iGkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=/7rhD+tYkViKh5vlKr6Gxtm1yzByT1ZSc0J65UhuZXs=; b=Iw4HuieL4tO0jKKu22AGQT2fPYkNysOSHaLq8kuRWfLS1SbMeg3RgR4CxMoaXMVD6t az9Co1astE8M/T0N94lZ9LbbhmH7XlIR4sV8mz2jxhI7btGoFwxx1CKqqD9zGg3PF//t px2w1evk6x01ZLK+baTsk4ocRj6Jh4bJyRjJumQal4xfrPB3AiamRtp4fMLA6NB/3wjm 2G8y7MnU9XLIwO8+CDLkCJxTmQnowrbrIcNXFmTJAarVOn17UkLo+2brosSZDsGVAWKH gU5HgBCzJen0Jgccf51R0fRCsJCKdmqxX2Z/2CPdKkGlt8y6vF3HE2IYuX+bkqOAI29W z+5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=ZU4t1Kti; 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 d2-v6si14575198plh.387.2018.07.09.06.52.20; Mon, 09 Jul 2018 06:52:34 -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=ZU4t1Kti; 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 S932812AbeGINvO (ORCPT + 99 others); Mon, 9 Jul 2018 09:51:14 -0400 Received: from mail-db5eur01on0124.outbound.protection.outlook.com ([104.47.2.124]:57216 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750996AbeGINvL (ORCPT ); Mon, 9 Jul 2018 09:51:11 -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=/7rhD+tYkViKh5vlKr6Gxtm1yzByT1ZSc0J65UhuZXs=; b=ZU4t1KtieYv8JwpSxpBhaVyDMV74c5agbrWOJ3+Oo1u0OpUbfM3/LPq3rV2Bk1lXJq/7bQbAW/l9ngIycSShndmGWATAIdx9FZp8diVN4D6O/accDrdKD2FNjuSCMifcs9pTAPx2JBx7zcYyoeegE31o6bg3uVgv0gQcm9heJGI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jan.dakinevich@virtuozzo.com; Received: from work.sw.ru (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.930.21; Mon, 9 Jul 2018 13:51:06 +0000 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 , Jan Dakinevich Subject: [PATCH] IPoIB: use kvzalloc to allocate an array of bucket pointers Date: Mon, 9 Jul 2018 16:51:03 +0300 Message-Id: <1531144263-24717-1-git-send-email-jan.dakinevich@virtuozzo.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1PR04CA0089.eurprd04.prod.outlook.com (2603:10a6:803:64::24) To AM4PR08MB2769.eurprd08.prod.outlook.com (2603:10a6:205:d::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b2080732-5ad5-44e7-073a-08d5e5a305a6 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:lGrgV5MQ6DXAhVIVdzGrH9PJMbYHSAp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9ddK9XY2ity3QsdgftcoqMcwQji3cpE62hGpOeMP0mecDzlNQnL/wM7PHWOl5UL0u+K/ps5JRpWn41I05FPQW5lTRBM1+h2lN6lc5xpg+2VIXGNcVACmVMJBHojbm5jV3BjZN5A1AXOwpsBeoJsf+kv9xkNpssViQ88x4Vugft+rIeHFfe6bXDqwq45EBf1LDvM01Hs8vmIZ97WIdMq0tKzvUy5E+KwDs50YgYwvOMj8+QyTuhUy7l8S4g+tGU9ypa5248yjACaQOSqPC7nArJic2ic0lEVPQUBnVANnSYzqP3d;4:YQGtttsWl/1p3uMHw+SXQIKPan5SFCJKfmPlD2ST9rXlMMr4XXjO/i4h1dglno4kRnlGtKzaFO636r/qyL9kCU3kzowrznO6C9jkjek6HNw4eorskfvLaO3nGKfn193cqT4HRf2ra3JjC3Xe3b5YmQ5XitZlplz9OH6D8V8CPPMDAwfBh/O95MVmsYXlKYaTQ/6w9WO0YXF56UTA1Flz67qx6mMfOMYoPynXLMOQvMWNKpaBlAx6NdFxvtIy/WNPLqHcvQLXl6HaBUHXYxhDIQ== 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)(93006095)(93001095)(3231311)(944501410)(52105095)(10201501046)(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: 07283408BE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(136003)(396003)(366004)(346002)(376002)(39850400004)(199004)(189003)(486006)(8676002)(7736002)(305945005)(6512007)(68736007)(6486002)(86362001)(44832011)(6116002)(3846002)(106356001)(81156014)(36756003)(8936002)(476003)(2616005)(956004)(105586002)(6666003)(5660300001)(81166006)(7416002)(50226002)(66066001)(14444005)(110136005)(1857600001)(186003)(50466002)(54906003)(2906002)(51416003)(53416004)(97736004)(386003)(6506007)(53936002)(107886003)(52116002)(16526019)(48376002)(4326008)(16586007)(69596002)(26005)(316002)(478600001)(25786009)(47776003)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:AM4PR08MB2769;H:work.sw.ru;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX: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:hrPN4Y1UC2pgL2AxTEXPQ/BCg/TXq4NUrN8n+/0sP?= =?us-ascii?Q?+uS1SX8YITHTMq5SqXkW+XHpWHZCJsFCcagCMNWx/CZNGyLdJSJLFOhqR4dp?= =?us-ascii?Q?0YDNndDHQTGejs3yTC77o9K+mHNU6iplSLTfk8OsX0l7L8zHFaatnXHky5cj?= =?us-ascii?Q?xwTl3xGSzzklPu7zkd1oYPYkNIHMQLnhuXZGgjrhobv5+lMYdyeiiPeHfViK?= =?us-ascii?Q?mOuF/nq+NJowO5JacGOPL13asyA4+FsZpvysbmHlARF2Zla0ajemOiLUjJVg?= =?us-ascii?Q?RMks8d1fiEAwSACRxiyCXVQSV0GnoAZu+lYqQDKkeVMBRn7Ylp2R8jl2bjEz?= =?us-ascii?Q?HJbc6SaUo9E0mY6Q+Drg24jGbH/E/thrjjI1d53cuB0yd59e+KhnQWit/yK0?= =?us-ascii?Q?Suh4/W4BPHONcksxdOzTj8s71Ta1XgWvCgvYr6gGFFPfY3EduMOzPOMJAq0e?= =?us-ascii?Q?AJux0PCIPOAP/dS7TFOJpQb+c3OI3cVIWmROh5rx08vxpayjdr8n2eb2Mv2I?= =?us-ascii?Q?IiKw7iAuZLWaXudj9kgpsLUAljqgXFCv4OEaFe2YdgMKVbuYGnVEzk9egSIH?= =?us-ascii?Q?6y68JH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ASS9qgmtLySGS1MZyJypUvdXdD7VImcWoZxFf2uvmOMNFDaseMSFWuBbu0JPEjZzTz04F03TTXCtaY7PyQsCcbYVZnjo3wI7mgQBNsD5ekGtCnw91djcrL3oBhRz6f04BqumnxmsgUIiIHIJbAINgCEMsg734EWtY7cPZlFHgF50BrSxAEaH6gZCdjqXVt1M3hgnhBLiEY/SJYU7/BBjvS7ZDs78= X-Microsoft-Exchange-Diagnostics: 1;AM4PR08MB2769;6:P20p+YmpF9VuneAnY/DJpdGTxUcAS1lh1nGV6YCOAfRmbUKG9/EU+S0nSGbvXNZfLaBfzJDyvT5HgqHqRDGeKOnGX6UCx4WBPEWTdkB2IBa5jt0HNl2a1DG4puyGWzf+zj1fhi09w3656fw3CtECXiQnULbB0AENb5rdt/ood4H0GmLR+6hbTuSf3avOR2/Pz3yhyf4oi6nIzMDCU6Bo+d0YHHZXdcOlGpYtiTHDicH6CIPopZmGfo56tIBpQP5pXM9Aq+J/vXf2CYe4Ra0IZwnKlrtVMlvD5T9oIjAYM8VzlbEkYjd6FuWthbKVasqFDE+2rXpAXu+EA3KuT8qA9JNn6YA8FB+2dW669NLv933NFuIrC/eqwevzjdO5KSQc9iklDWhLLXZLoIMwAGv9vnx1NM0JRV/bkIdgThK75wdjnXkd1+Jceh0pcs23Qn+nt9epFoLY/1VO4c4ZpQdvow==;5:wPtWhUuYFGYRWqScyCTFpb/shAYlf5EhT1onyy+HJK+bD6XoIyJRqLqsX2VGd4XHUalPGzVmpMNPRZwfK4mApQbZUI6SgPegQSXkdJjqQsHh0FTt7v5h661HLh/NZxkojJCM9NlKAQQU/rfSi1QaXnkbvHeBU3+S4oDx/ZF+jiY=;24:JIB7l3AjF9Hb2yzvCJVMIa9OUg86+kO2ZzeESgg4R4iitLUlu8kATquaozqWOZyxTKFDN4jmOacdiuHr6FtFDhxGoSEz9Zf64oWojO6g/o4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM4PR08MB2769;7:EwFlL1ZPjZZNsAO53xAd0FKG3tm6y8nwD7BcFTrl0QiOOrA1gwG6I0wBaw3YpBFSxc95QPw3JyOcxDydWmcQ6CWVA4naQLEChUXOEyggE8uD6Zh4QuSNaoJQmevVvW1YnGYc/dk/hwmQPaDC9ek84vqJTKp/czC+KEInvVUTr0JJ+WPck/Pv/IMZtURGGGMv7HjgPFpp14O65tGXdQCaXcxXo+/gNlRN2Els+DfhVc7IXPowzpg73m2LEc6ESEiF;20:gyH7zpQwzLFPqeqFPd6022fwcYLNk58rLjubOOQGgkvyiKWA6EZmXB3+BwMhq+UsLUoG8OuUUJfV2nV4+SsV+HfrDysQ6LIonIIlaIE8bNDMptCBdSmGG740QUWV0XsBt7G3iC0/rqeLmDShzo6EWHmmwD2APuNVlFdWDCeg3VU= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2018 13:51:06.5379 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b2080732-5ad5-44e7-073a-08d5e5a305a6 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 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); } -- 2.1.4