Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3701233pxv; Mon, 19 Jul 2021 06:48:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBi0MsS7DGf6tttJ1nXHoqikQu8bU3eQgsodvhuzwFvbFZLyv9/Oi7Zmw327UT4W4SvXV9 X-Received: by 2002:a05:6e02:66e:: with SMTP id l14mr16971694ilt.211.1626702500650; Mon, 19 Jul 2021 06:48:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626702500; cv=none; d=google.com; s=arc-20160816; b=Po58LCyjKVpC0AcJSap1X9J0zg+MbWKqqPLQGU2EY42pTqHgIBo73Zba0D2kQ9zEPO 51GJMHPk9/49rtmNGuUmMuIbb79hRMXdR8oc22Oe0XHNWbj0Vb5ddtEETMyBaPGMG2gG yZhL6WzN9IeMleH41Xz/wlY8yZeuapA8m/p/nfS8lwze+alexRDAJjuIdGx4CjgNY0y+ fPVBJ8CHDPJ1elQ3iQRI4JZx4V6+WV5qrfs/VVU5xT2GRLCEgBmptB9PSySoRukW819o j8KZpHmqGc8Yk4lcfW+iVAD1FBOe4bY1Ll/qv1cw+9TVW2dnEB/gku0UwjDQcxxRlkET y0qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=7Mw7rEbDLp0kc96L8ADYqch5cIwwGN/wenVsiNSdaT4=; b=HtSs8aCXlUzyDwJhgwR1VA0oyOZC4HLeLo9yau0sWgDlgyCgZIATB4R+9FYH9rd26S 846xYNFcnf0qYpl1jM6qBBzvM6FioTwKU2cQqd1bjfrlRaS8PsbWtHvgFtijhLKQmRwi JlXZU178p0fUBCBxW5CYPperKYd98IoJDXUIEoFRePY7bT8Ow44fkuDduS5t9xSlMDi9 parto0CmaNTNvWKOBu65QfysLSJBoxIu16sPSKXD0h0L1eM7fHMx+zttphuCN70+jp8e PqQZrKtxHTZ/gB4vvX0A9wk7icSCi3cNLJnAK1US3YaYaysc7XqhaZBJRcT33/HlrDRI jchA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=qKf1AzZs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q10si23766723ilu.60.2021.07.19.06.48.07; Mon, 19 Jul 2021 06:48:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=qKf1AzZs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239590AbhGSNCF (ORCPT + 99 others); Mon, 19 Jul 2021 09:02:05 -0400 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:21105 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239599AbhGSNB4 (ORCPT ); Mon, 19 Jul 2021 09:01:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1626702156; x=1658238156; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=7Mw7rEbDLp0kc96L8ADYqch5cIwwGN/wenVsiNSdaT4=; b=qKf1AzZsMLyGRsvYKnEXzNmpaaaBOYz4pCupXuPUWM1V/SfvxaX5YlbQ BWml+Rq5kNjoa4lc2DPDNUVreHHhn4wBOJZxqKW44Q2E8jc7GNZ5Ev+uA ag9HqXdCvWnDiSf1hM+FSPOSQgzOF9iEIpzZfyjVoXw+aH4AF1ug0wTIo Q=; X-IronPort-AV: E=Sophos;i="5.84,252,1620691200"; d="scan'208";a="146396045" Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-2a-6c5d6e09.us-west-2.amazon.com) ([10.25.36.214]) by smtp-border-fw-9102.sea19.amazon.com with ESMTP; 19 Jul 2021 13:42:28 +0000 Received: from EX13D19EUB003.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-2a-6c5d6e09.us-west-2.amazon.com (Postfix) with ESMTPS id AE304A4AD8; Mon, 19 Jul 2021 13:42:26 +0000 (UTC) Received: from 8c85908914bf.ant.amazon.com (10.43.160.85) by EX13D19EUB003.ant.amazon.com (10.43.166.69) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Mon, 19 Jul 2021 13:42:16 +0000 Subject: Re: [PATCH rdma-next 8/9] RDMA: Globally allocate and release QP memory To: Leon Romanovsky , Doug Ledford , Jason Gunthorpe CC: Leon Romanovsky , Adit Ranadive , Ariel Elior , Bernard Metzler , Christian Benvenuti , Dennis Dalessandro , , , Michal Kalderon , Mike Marciniszyn , Mustafa Ismail , Naresh Kumar PBS , Nelson Escobar , Potnuri Bharat Teja , Selvin Xavier , Shiraz Saleem , Steve Wise , VMware PV-Drivers , Weihang Li , Wenpeng Liang , Yishai Hadas , Zhu Yanjun References: <5b3bff16da4b6f925c872594262cd8ed72b301cd.1626609283.git.leonro@nvidia.com> From: Gal Pressman Message-ID: Date: Mon, 19 Jul 2021 16:42:11 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <5b3bff16da4b6f925c872594262cd8ed72b301cd.1626609283.git.leonro@nvidia.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.43.160.85] X-ClientProxiedBy: EX13D18UWC003.ant.amazon.com (10.43.162.237) To EX13D19EUB003.ant.amazon.com (10.43.166.69) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/07/2021 15:00, Leon Romanovsky wrote: > From: Leon Romanovsky > > Convert QP object to follow IB/core general allocation scheme. > That change allows us to make sure that restrack properly kref > the memory. > > Signed-off-by: Leon Romanovsky EFA and core parts look good to me. Reviewed-by: Gal Pressman Tested-by: Gal Pressman > +static inline void *rdma_zalloc_obj(struct ib_device *dev, size_t size, > + gfp_t gfp, bool is_numa_aware) > +{ > + if (is_numa_aware && dev->ops.get_numa_node) Honestly I think it's better to return an error if a numa aware allocation is requested and get_numa_node is not provided. > + return kzalloc_node(size, gfp, dev->ops.get_numa_node(dev)); > + > + return kzalloc(size, gfp); > +}