From: Jakub Kicinski <kuba@kernel.org>
To: Leon Romanovsky <leon@kernel.org>
Cc: Brett Creeley <bcreeley@amd.com>,
Brett Creeley <brett.creeley@amd.com>,
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
Date: Tue, 11 Apr 2023 12:49:45 -0700 [thread overview]
Message-ID: <20230411124945.527b0ee4@kernel.org> (raw)
In-Reply-To: <20230411124704.GX182481@unreal>
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
next prev parent reply other threads:[~2023-04-11 19:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-07 23:36 [PATCH net] ionic: Fix allocation of q/cq info structures from device local node Brett Creeley
2023-04-09 10:52 ` Leon Romanovsky
2023-04-10 18:16 ` Brett Creeley
2023-04-11 12:47 ` Leon Romanovsky
2023-04-11 19:49 ` Jakub Kicinski [this message]
2023-04-12 16:58 ` Leon Romanovsky
2023-04-12 19:44 ` Jakub Kicinski
2023-04-13 6:43 ` Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230411124945.527b0ee4@kernel.org \
--to=kuba@kernel.org \
--cc=bcreeley@amd.com \
--cc=brett.creeley@amd.com \
--cc=davem@davemloft.net \
--cc=drivers@pensando.io \
--cc=leon@kernel.org \
--cc=neel.patel@amd.com \
--cc=netdev@vger.kernel.org \
--cc=shannon.nelson@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).