Received: by 10.192.165.156 with SMTP id m28csp72834imm; Tue, 10 Apr 2018 16:42:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+uhC7pJDOTCQosAGjvjhE9t3oxBJclCBnXYOYG1Vy9z8ONtgVJSd5fSLfEmv6nHd9LHyNo X-Received: by 2002:a17:902:f64:: with SMTP id 91-v6mr2450052ply.397.1523403727657; Tue, 10 Apr 2018 16:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523403727; cv=none; d=google.com; s=arc-20160816; b=YLc3Az9lr5ZufxsidEKBLY5WdZQAJpxHxc47zUAv3aXr5VoopctUgdnPNo7dej8a6j DpiWzVDhX+pAEjLZR2u6VBXHT5vr1Pio1puzaDAeRMr8la2NshfmimdIjcbxOYRWodGU Ba6jOR+gLw/gObcNI7qeezzcNnuqBff6Y0ofMvo4hz6H4kU2McWjZ8ouFMZhhYTvFEAA s9n0H/4U22rhfNn1MiugnCWYVdeF9xoX4zZe/OoU5FZ2B5cIK2ysRdRhZsLPmsZ/8jxg 84H2s4K0LjKJ+ETQ+kE1JogLhNnPBDksepU6J0jIZOXCKC/VjXwK0nQ3UwrlJGhlPVq+ zIBQ== 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=KdsW4cnWW9j6nWi2YVamJSgFA+eP0J+s8XGq+VaL0RY=; b=HmPbhq2iW5wu2fayfq7oN3t/FfhhJ/pb54qKu+IQhXF2rbEMV6/VroJsx5Nb8oCCgo 1TcQnKeBgJ3pkSXFjwltkx442Vs6qOIEKS5hXE7+tE41uWKxMHlYFYq9MNsWKadlCJ8y iIXg5mLaUqYO0H6X3vrGgPFvm8UZ8ywc2aKWFSzZQtvC2OH760zqOMRUJx9xTbT8STwE Vk0yCbh7n3Phu5GQwRIFrNOK5LshNC03EcGHuQffr833fLcHTBxnEfL0pZrwq4LMJOTl QZdcfUdYCWbkvQ714FDFE2oj4FrjVg5nxrlxqqyOiN9vS9uXXmNywaQ6Kd22yD2SzDKz ntVw== 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 l7-v6si3931902plk.380.2018.04.10.16.41.31; Tue, 10 Apr 2018 16:42:07 -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 S1754888AbeDJXeS (ORCPT + 99 others); Tue, 10 Apr 2018 19:34:18 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38650 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753920AbeDJW2H (ORCPT ); Tue, 10 Apr 2018 18:28:07 -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 0E70BD1B; Tue, 10 Apr 2018 22:28:05 +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.15 051/168] IB/rdmavt: Allocate CQ memory on the correct node Date: Wed, 11 Apr 2018 00:23:13 +0200 Message-Id: <20180410212802.374545405@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212800.144079021@linuxfoundation.org> References: <20180410212800.144079021@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.15-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;