Received: by 10.213.65.68 with SMTP id h4csp1861980imn; Mon, 19 Mar 2018 15:33:23 -0700 (PDT) X-Google-Smtp-Source: AG47ELteclVD1SS2rR3v5NIyZY0UAQuvdiR44D9aCNvv4TZxgjeQ0J0xl8Kgqn060C55qTbfZ/Sh X-Received: by 10.99.120.142 with SMTP id t136mr9961874pgc.300.1521498803525; Mon, 19 Mar 2018 15:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521498803; cv=none; d=google.com; s=arc-20160816; b=R+1EGXsdioVJewEvIN5JnBaNY8YCYvdRryB8bZlhGhbHvzxbb1ygela91Lo/mekyuk AXGx70+sIpUTc6VU2bub/tiFtZh3NwhUcDVtiBQ5XItRZ6Od2eIwmO/EMPouP9mHnuQt L5uDF0lI5R7lmPvZ6zlzHL46xUTsNdp7cZ8UlXPtX90N6EbFKaBBCoeTLDWPz4eHbEzV 8MpVyh3tZRKQtek+lMCYRWyqi2H9o5UEl6UtNXeGsvCw3dIXybTD4srKYMiVeEuDfnAN V0o1QFRjuPOymnR6PJWyY0iFc18jgDyz0KC+6myHNO5WtVn/VmpawOjJyKYCKupsTxGO oaoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=a5SoDxYedAgu81FGBdvckwmd1R8X410HOUbkBCP9RBw=; b=F9NBOVB5NmEEX1aW7AdH1oceZTAjkDcuhTS8WHRR7BhDNsAwiHIz2NpUBANyKGIFAJ BlvPUB1R2zhzW3jegwW/U/y0GN0M9BGlFtxEQH4Ffv78Mp/mmwti0J+iYEh4pzcNCGqw e/iW2Ja0q/e8gVauPYBzg5EJhrXBBlOOPx0gDoWYvf8h5hH4JXsIxSSuFY53bcZM5ddq NHKzgy0v79UWIm/GAh0Km3Isvo0mXcrXrIjor/Bjoy8dDemfY/CTwjf8zzNtQwrENEsN xAbSwErfjYiZ3/Mr/90V/vd6XpxXBVUfCGNnkOLuTLyGr73l3v8bHoWJ2eTAQaWFP6Ot lvcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=ZpYo1LSr; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9-v6si257738pli.630.2018.03.19.15.33.09; Mon, 19 Mar 2018 15:33:23 -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=@microsoft.com header.s=selector1 header.b=ZpYo1LSr; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S972395AbeCSW3z (ORCPT + 99 others); Mon, 19 Mar 2018 18:29:55 -0400 Received: from mail-by2nam01on0106.outbound.protection.outlook.com ([104.47.34.106]:16179 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933788AbeCSPsm (ORCPT ); Mon, 19 Mar 2018 11:48:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=a5SoDxYedAgu81FGBdvckwmd1R8X410HOUbkBCP9RBw=; b=ZpYo1LSrijdt7TfVCPHJhMAaLrlPxJdHQLm1hdkjXfpvzf7el2TujuJ1MOqfkLfm7gJyhYt+0+KNuD7JbRgQPRj5P6GSh5lbEUNE5Rh5MFCzkFzKa/0BVrxdPyR6blg0q9n57QS5dCLw9XLKx9ITQB1eQNCcWsVLOAMvUvxqonA= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1031.namprd21.prod.outlook.com (52.132.128.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 15:48:15 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 15:48:15 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Mike Marciniszyn , Dennis Dalessandro , Doug Ledford , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 055/124] IB/rdmavt: Allocate CQ memory on the correct node Thread-Topic: [PATCH AUTOSEL for 4.15 055/124] IB/rdmavt: Allocate CQ memory on the correct node Thread-Index: AQHTv5mnbQd7mrByYUCqrKy/dkfr6w== Date: Mon, 19 Mar 2018 15:47:57 +0000 Message-ID: <20180319154645.11350-55-alexander.levin@microsoft.com> References: <20180319154645.11350-1-alexander.levin@microsoft.com> In-Reply-To: <20180319154645.11350-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1031;7:0G5+LxgeEAon6Km2E9FNW7jBh/9l13ZUxbiUit4ZGmZNuY4ig7EtdK5q6JFN73o8/ONaBKBN9X6ixQqCRljk5yJw4YFsBKoj+NuZF+090PbOdxle7wJg4H8elsQsFofZlNbUdDsd9dhYe/MSyH9VC/k4Zv6UPHPbNwaeTjdHnFrlXIYT8zjAwrJKn2aauzV6QxLjXf718rxP2uc2Pej6NBI1QU6+3XDWf7b2M1EC12qvqqbpOLhzzvQf5ST6caaG;20:B4zIYMyGVm42xNr9O5xPRwYiPrN4zUjqFcLz07c7Xjc2CY8vw+ELlx1EFYcJn1eXldAwBH48rfWZTkIVKjJG06TEVWZMbKtYSfNFLDRNYPfJzNfd76loK3aAqFUixboulva3ZWGJz96wYykPoOAWMStERKsRUrzku6v8zVrWIq0= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 5e05b47a-25ab-4281-3418-08d58db0d42f x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1031; x-ms-traffictypediagnostic: DM5PR2101MB1031: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231221)(944501300)(52105095)(3002001)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB1031;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1031; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(346002)(396003)(39860400002)(39380400002)(376002)(189003)(199004)(6436002)(6512007)(6666003)(3280700002)(2950100002)(7736002)(6116002)(3846002)(10090500001)(105586002)(4326008)(5660300001)(305945005)(1076002)(81156014)(2906002)(6486002)(81166006)(8676002)(8936002)(2900100001)(106356001)(36756003)(68736007)(54906003)(3660700001)(22452003)(97736004)(6506007)(25786009)(99286004)(10290500003)(76176011)(66066001)(14454004)(72206003)(478600001)(102836004)(26005)(186003)(316002)(2501003)(110136005)(5250100002)(86362001)(53936002)(107886003)(86612001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1031;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 6JWSJ7ADS400w039BTA4Y8pEKjfK6Q+OpFKVwSaTTEmkgQ4HAMMpNPUBbj87+yiUgcTurF416O2KEguIVY4NnRmLv2MTwZ+vgQVE154V7gV6ikTs45tNybBqH08gmTr7uaOozi4p2lRkWeldxKfc9gMS5KjjJxvq2IZUiK1x4BirkNkot/CPGMhDU6hPwlDG/DrM4az1sUWOaGAJ6O5YCAWkatUvN0gWBsvfsUCFzPBbzNFOXobZYIOI/iOxgJXS3Kvy7IZkUDSs6qEAFrJ8USVKDBDB62bL/1n7VSqztKkrJd+9ANDW/e+KHGE7ArbZNL7Rk4/q0/Qt7po2Jyccqg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e05b47a-25ab-4281-3418-08d58db0d42f X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:47:57.8562 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1031 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mike Marciniszyn [ Upstream commit db9a2c6f9b6196b889b98e961cb9a37617b11ccf ] CQ allocation does not ensure that completion queue entries and the completion queue structure are allocated on the correct numa node. Fix by allocating the rvt_cq and kernel CQ entries on the device node, leaving the user CQ entries on the default local node. Also ensure CQ resizes use the correct allocator when extending a CQ. Reviewed-by: Sebastian Sanchez Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Doug Ledford Signed-off-by: Sasha Levin --- drivers/infiniband/sw/rdmavt/cq.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/sw/rdmavt/cq.c b/drivers/infiniband/sw/rdma= vt/cq.c index 97d71e49c092..88fa4d44ab5f 100644 --- a/drivers/infiniband/sw/rdmavt/cq.c +++ b/drivers/infiniband/sw/rdmavt/cq.c @@ -198,7 +198,7 @@ struct ib_cq *rvt_create_cq(struct ib_device *ibdev, return ERR_PTR(-EINVAL); =20 /* Allocate the completion queue structure. */ - cq =3D kzalloc(sizeof(*cq), GFP_KERNEL); + cq =3D kzalloc_node(sizeof(*cq), GFP_KERNEL, rdi->dparms.node); if (!cq) return ERR_PTR(-ENOMEM); =20 @@ -214,7 +214,9 @@ struct ib_cq *rvt_create_cq(struct ib_device *ibdev, sz +=3D sizeof(struct ib_uverbs_wc) * (entries + 1); else sz +=3D sizeof(struct ib_wc) * (entries + 1); - wc =3D vmalloc_user(sz); + wc =3D udata ? + vmalloc_user(sz) : + vzalloc_node(sz, rdi->dparms.node); if (!wc) { ret =3D ERR_PTR(-ENOMEM); goto bail_cq; @@ -369,7 +371,9 @@ int rvt_resize_cq(struct ib_cq *ibcq, int cqe, struct i= b_udata *udata) sz +=3D sizeof(struct ib_uverbs_wc) * (cqe + 1); else sz +=3D sizeof(struct ib_wc) * (cqe + 1); - wc =3D vmalloc_user(sz); + wc =3D udata ? + vmalloc_user(sz) : + vzalloc_node(sz, rdi->dparms.node); if (!wc) return -ENOMEM; =20 --=20 2.14.1