Received: by 10.192.165.156 with SMTP id m28csp118491imm; Tue, 10 Apr 2018 17:49:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx486mgwTjGxcMhvwHDN1tI6RULRlQ6qZL3uxwgQfkQpDCkcKFQjS4pwOjb4d1LR9yxOED2OZ X-Received: by 2002:a17:902:ab94:: with SMTP id f20-v6mr2696949plr.375.1523407755408; Tue, 10 Apr 2018 17:49:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523407755; cv=none; d=google.com; s=arc-20160816; b=DeCc1HvWrjQ9XL+JebjLk/+0Ka2W5Rpooa59R+fMHD9qpXY7fm8bl8/GTmjhQycYDr EDoEUV5EB6/uLE5WAoEumowr6/Gxfkgl5JeVvzD7FLiVwl7718zNFCkyEaDJ2NFCH33V 8ly605fDO4uqfXWVUy+D1h0uCgGE5rOz+QA5UvAYYBC7G2fUp/qK9gTd1sNnBlwDqLhr LjMn0BkV16EU7mAAxBipnezYJ806gD89onWtZ8EFkqghCwOtFzcAWs0Dn1TTNBriirrA OmbGFPZj8dVA8+rLu7e0lFcmt4DfTSayE6Szn5+M0oTEs1jNf2xtSbBerboHQ0OibEh4 HaJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=wp+/TY2Rw/J8sCnCC+38uFqrVpSOkoKs6phpFbhU3fw=; b=tT+BBzOOus/IT6DFQCVIbTDePCNncvrXn30Cbu6+t4VMyZpC1PN3vY/PqsSQdQydns He/19IEV4RqTi7ngCwfkED7uhJKGtzHeb7eM4cighofkQrFkTsDy7LKNxHtCsRss21/d GT2lsKbAZq4F3LrJs5e+UpAZu6JJz9iFlHBp0gLoTfBX5tcj/xmvcccg7I1ctA9MhBaM 7juyU5ossGAe0DjckY9PS20Jr1J1/hftFAoSJPviJb7Pi3DIUrYqZArmdA5j3dXuSE1N DQBjml8E1WYhBZSSzKvUuj7JrZV8dPuvFocl6Fp8wSupGLX3E7rgJ6qZViO9ZsMW303b iRBg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 65si2521627pgj.618.2018.04.10.17.48.35; Tue, 10 Apr 2018 17:49:15 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755525AbeDJWfS (ORCPT + 99 others); Tue, 10 Apr 2018 18:35:18 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42044 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753443AbeDJWfP (ORCPT ); Tue, 10 Apr 2018 18:35:15 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 04791DAC; Tue, 10 Apr 2018 22:35:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sebastian Sanchez , Mike Marciniszyn , Dennis Dalessandro , Doug Ledford , Sasha Levin Subject: [PATCH 4.14 038/138] IB/rdmavt: Allocate CQ memory on the correct node Date: Wed, 11 Apr 2018 00:23:48 +0200 Message-Id: <20180410212906.508110410@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212902.121524696@linuxfoundation.org> References: <20180410212902.121524696@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/sw/rdmavt/cq.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- 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_de return ERR_PTR(-EINVAL); /* Allocate the completion queue structure. */ - cq = kzalloc(sizeof(*cq), GFP_KERNEL); + cq = kzalloc_node(sizeof(*cq), GFP_KERNEL, rdi->dparms.node); if (!cq) return ERR_PTR(-ENOMEM); @@ -214,7 +214,9 @@ struct ib_cq *rvt_create_cq(struct ib_de sz += sizeof(struct ib_uverbs_wc) * (entries + 1); else sz += sizeof(struct ib_wc) * (entries + 1); - wc = vmalloc_user(sz); + wc = udata ? + vmalloc_user(sz) : + vzalloc_node(sz, rdi->dparms.node); if (!wc) { ret = ERR_PTR(-ENOMEM); goto bail_cq; @@ -369,7 +371,9 @@ int rvt_resize_cq(struct ib_cq *ibcq, in sz += sizeof(struct ib_uverbs_wc) * (cqe + 1); else sz += sizeof(struct ib_wc) * (cqe + 1); - wc = vmalloc_user(sz); + wc = udata ? + vmalloc_user(sz) : + vzalloc_node(sz, rdi->dparms.node); if (!wc) return -ENOMEM;