From: Amir Vadai <amirv@mellanox.com>
To: Alexander Duyck <alexander.h.duyck@redhat.com>
Cc: <achiad@mellanox.com>, Or Gerlitz <ogerlitz@mellanox.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: dma_alloc_coherent() to use memory close to cpu
Date: Wed, 13 May 2015 15:40:57 +0300 [thread overview]
Message-ID: <55534659.9000606@mellanox.com> (raw)
Hi Alex,
dma_alloc_coherent() is allocating memory close to the device -
according to dev_to_node(dev). Sometimes it is better to use memory
close to the CPU. e.g. when it is a buffer that NIC writes and CPU reads.
It seems that you thought that too, and added a commit to ixgbe driver
that follows that logic [1].
You added calls to set_dev_node() before and after the allocation.
This seems to be prone to races in case multiple process want to alloc
in parallel. The proper fix seems to be to extend the
dma_alloc_coherent() to accept a NUMA node as an argument (if device's
node is not good enough).
I looked for, but couldn't find any discussion about that - is there a
special reason not to extend dma_alloc_coherent()?
[1] - de88eee ("ixgbe: Allocate rings as part of the q_vector")
Thanks,
Amir
next reply other threads:[~2015-05-13 12:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-13 12:40 Amir Vadai [this message]
2015-05-13 15:49 ` dma_alloc_coherent() to use memory close to cpu Alexander Duyck
2015-05-14 7:15 ` Amir Vadai
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=55534659.9000606@mellanox.com \
--to=amirv@mellanox.com \
--cc=achiad@mellanox.com \
--cc=alexander.h.duyck@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.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).