From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6E88C7619A for ; Tue, 11 Apr 2023 19:49:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229522AbjDKTts (ORCPT ); Tue, 11 Apr 2023 15:49:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbjDKTts (ORCPT ); Tue, 11 Apr 2023 15:49:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 607AC19AD for ; Tue, 11 Apr 2023 12:49:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F05FD62465 for ; Tue, 11 Apr 2023 19:49:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B359C433EF; Tue, 11 Apr 2023 19:49:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681242586; bh=KHwqZhruzUQmMJcAyzNbufatb1HafS1nawYwY2TE5N4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HFhNSFpt8p4cG6jntP6BK9FTa6Xghm6hMXWvH4wnZinzdEsWO39B7ztreJFtiKvy2 TJIjxq33eE3Eqn93fUiNaCAvutIQG9/ysS+0xgJPHX2WAoLchkzw+S+6/PHFHBy4bP sfWwdjkQwoQnGYuZq6TYZL/BDl9AOFdJo2F+V4i5T4xJs9J46A3OouG9EaJ3Qw1IVj 9mvIyLUqCM7c9VtfLywYK0QRkvUUyadRDmIdSZ6HuFCB+VaCrQP+q+V08P5CNbb/3L BqvbW64Lx/g8Sh0rVkg8zixO/mNqgLJWj0ErHf6LYOhdlvi8hI0CDBD4e2tolZa8Ou B0HIrjykEHUpQ== Date: Tue, 11 Apr 2023 12:49:45 -0700 From: Jakub Kicinski To: Leon Romanovsky Cc: Brett Creeley , Brett Creeley , davem@davemloft.net, netdev@vger.kernel.org, drivers@pensando.io, shannon.nelson@amd.com, neel.patel@amd.com Subject: Re: [PATCH net] ionic: Fix allocation of q/cq info structures from device local node Message-ID: <20230411124945.527b0ee4@kernel.org> In-Reply-To: <20230411124704.GX182481@unreal> References: <20230407233645.35561-1-brett.creeley@amd.com> <20230409105242.GR14869@unreal> <20230411124704.GX182481@unreal> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 11 Apr 2023 15:47:04 +0300 Leon Romanovsky wrote: > > We want to allocate memory from the node local to our PCI device, which is > > not necessarily the same as the node that the thread is running on where > > vzalloc() first tries to alloc. > > I'm not sure about it as you are running kernel thread which is > triggered directly by device and most likely will run on same node as > PCI device. Isn't that true only for bus-side probing? If you bind/unbind via sysfs does it still try to move to the right node? Same for resources allocated during ifup? > > Since it wasn't clear to us that vzalloc_node() does any fallback, > > vzalloc_node() doesn't do fallback, but vzalloc will find the right node > for you. Sounds like we may want a vzalloc_node_with_fallback or some GFP flag? All the _node() helpers which don't fall back lead to unpleasant code in the users. > > we followed the example in the ena driver to follow up with a more > > generic vzalloc() request. > > I don't know about ENA implementation, maybe they have right reasons to > do it, but maybe they don't. > > > > > Also, the custom message helps us quickly figure out exactly which > > allocation failed. > > If OOM is missing some info to help debug allocation failures, let's add > it there, but please do not add any custom prints after alloc failures. +1