From: Jason Gunthorpe <jgg@nvidia.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Lu Baolu <baolu.lu@linux.intel.com>,
Joerg Roedel <joro@8bytes.org>, Kevin Tian <kevin.tian@intel.com>,
Matthew Rosato <mjrosato@linux.ibm.com>,
Alex Williamson <alex.williamson@redhat.com>,
ath10k@lists.infradead.org, ath11k@lists.infradead.org,
Christian Borntraeger <borntraeger@linux.ibm.com>,
dri-devel@lists.freedesktop.org, iommu@lists.linux.dev,
kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org,
linux-rdma@vger.kernel.org, linux-remoteproc@vger.kernel.org,
linux-s390@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-tegra@vger.kernel.org, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org, nouveau@lists.freedesktop.org,
Niklas Schnelle <schnelle@linux.ibm.com>,
virtualization@lists.linux-foundation.org
Subject: Re: [PATCH v2 04/10] iommu/dma: Use the gfp parameter in __iommu_dma_alloc_noncontiguous()
Date: Mon, 23 Jan 2023 09:58:08 -0400 [thread overview]
Message-ID: <Y86ScGA7kY7gQ8qQ@nvidia.com> (raw)
In-Reply-To: <f24fcba7-2fcb-ed43-05da-60763dbb07bf@arm.com>
On Fri, Jan 20, 2023 at 07:28:19PM +0000, Robin Murphy wrote:
> Overall I'm starting to wonder if it might not be better to stick a "use
> GFP_KERNEL_ACCOUNT if you allocate" flag in the domain for any level of the
> API internals to pick up as appropriate, rather than propagate per-call gfp
> flags everywhere.
I was thinking about this some more, and I don't thinking hiding the
GFP_KERNEL_ACCOUNT in the iommu driver will be very maintainable.
The GFP_KERNEL_ACCOUNT is sensitive to current since that is where it
gets the cgroup from, if we start putting it in driver code directly
it becomes very hard to understand if the call chains are actually
originating from a syscall or not. I'd prefer we try to keep thing so
that iommufd provides the GFP_KERNEL_ACCOUNT on a call-by-call basis
where it is clearer what call chains originate from a system call vs
not.
So, I think we will strive for adding a gfp flag to the future 'alloc
domain iommufd' and pass GFP_KERNEL_ACCOUNT there. Then we can see
what is left.
Jason
next prev parent reply other threads:[~2023-01-23 13:58 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-18 18:00 [PATCH v2 00/10] Let iommufd charge IOPTE allocations to the memory cgroup Jason Gunthorpe
2023-01-18 18:00 ` [PATCH v2 01/10] iommu: Add a gfp parameter to iommu_map() Jason Gunthorpe
2023-01-19 3:45 ` Tian, Kevin
2023-01-18 18:00 ` [PATCH v2 02/10] iommu: Remove iommu_map_atomic() Jason Gunthorpe
2023-01-19 3:45 ` Tian, Kevin
2023-01-18 18:00 ` [PATCH v2 03/10] iommu: Add a gfp parameter to iommu_map_sg() Jason Gunthorpe
2023-01-19 3:46 ` Tian, Kevin
2023-01-18 18:00 ` [PATCH v2 04/10] iommu/dma: Use the gfp parameter in __iommu_dma_alloc_noncontiguous() Jason Gunthorpe
2023-01-19 3:47 ` Tian, Kevin
2023-01-20 19:28 ` Robin Murphy
2023-01-20 20:38 ` Jason Gunthorpe
2023-01-23 13:58 ` Jason Gunthorpe [this message]
2023-01-18 18:00 ` [PATCH v2 05/10] iommufd: Use GFP_KERNEL_ACCOUNT for iommu_map() Jason Gunthorpe
2023-01-19 3:48 ` Tian, Kevin
2023-01-18 18:00 ` [PATCH v2 06/10] iommu/intel: Add a gfp parameter to alloc_pgtable_page() Jason Gunthorpe
2023-01-19 3:49 ` Tian, Kevin
2023-01-19 11:47 ` Baolu Lu
2023-01-18 18:00 ` [PATCH v2 07/10] iommu/intel: Support the gfp argument to the map_pages op Jason Gunthorpe
2023-01-19 3:50 ` Tian, Kevin
2023-01-19 11:57 ` Baolu Lu
2023-01-19 11:59 ` Baolu Lu
2023-01-18 18:00 ` [PATCH v2 08/10] iommu/intel: Use GFP_KERNEL in sleepable contexts Jason Gunthorpe
2023-01-19 3:52 ` Tian, Kevin
2023-01-19 12:00 ` Baolu Lu
2023-01-18 18:00 ` [PATCH v2 09/10] iommu/s390: Push the gfp parameter to the kmem_cache_alloc()'s Jason Gunthorpe
2023-01-19 21:56 ` Matthew Rosato
2023-01-18 18:00 ` [PATCH v2 10/10] iommu/s390: Use GFP_KERNEL in sleepable contexts Jason Gunthorpe
2023-01-19 21:56 ` Matthew Rosato
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=Y86ScGA7kY7gQ8qQ@nvidia.com \
--to=jgg@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=ath10k@lists.infradead.org \
--cc=ath11k@lists.infradead.org \
--cc=baolu.lu@linux.intel.com \
--cc=borntraeger@linux.ibm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=mjrosato@linux.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=robin.murphy@arm.com \
--cc=schnelle@linux.ibm.com \
--cc=virtualization@lists.linux-foundation.org \
/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).