From: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
To: Adam Morrison
<mad-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org>,
joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Cc: serebrin-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
dan-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org,
omer-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org,
shli-b10kYP2dOMg@public.gmane.org,
gvdl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
Kernel-team-b10kYP2dOMg@public.gmane.org
Subject: Re: [PATCH v4 7/7] iommu/vt-d: introduce per-cpu caching to iova allocation
Date: Wed, 20 Apr 2016 15:21:33 -0400 [thread overview]
Message-ID: <1461180093.25115.28.camel@infradead.org> (raw)
In-Reply-To: <3d87d1ef7c5ae3e07e2d7c105c2fe2bb9a82cb46.1461135861.git.mad-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 1405 bytes --]
On Wed, 2016-04-20 at 11:34 +0300, Adam Morrison wrote:
> +static void init_iova_rcaches(struct iova_domain *iovad)
> +{
...
> + for_each_possible_cpu(cpu) {
> + cpu_rcache = per_cpu_ptr(rcache->cpu_rcaches, cpu);
> + spin_lock_init(&cpu_rcache->lock);
> + cpu_rcache->loaded = iova_magazine_alloc(GFP_KERNEL);
> + cpu_rcache->prev = iova_magazine_alloc(GFP_KERNEL);
> + }
Hm, is that allocation excessive? We allocate the magazines for every
*possible* CPU, even those which may never actually exist in the
system?
Does it make sense to do that allocation only the first time it's
actually used on a given CPU? And either way, some comment to the
effect of "it's OK for allocation failure to leave these as NULL
because...." (fill in your reasoning here) probably wants to be added
to the above snippet of code.
Now that you've made this an extension of the IOVA API rather than an
incompatible change, this patch probably also wants to be split out
into two — changing intel-iommu only in the second patch.
--
David Woodhouse Open Source Technology Centre
David.Woodhouse@intel.com Intel Corporation
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5691 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2016-04-20 19:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-20 8:31 [PATCH v4 0/7] Intel IOMMU scalability improvements Adam Morrison
[not found] ` <cover.1461135861.git.mad-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org>
2016-04-20 8:32 ` [PATCH v4 1/7] iommu/vt-d: refactoring of deferred flush entries Adam Morrison
2016-04-20 8:33 ` [PATCH v4 2/7] iommu/vt-d: per-cpu deferred invalidation queues Adam Morrison
2016-04-20 8:33 ` [PATCH v4 3/7] iommu/vt-d: correct flush_unmaps pfn usage Adam Morrison
2016-04-20 8:33 ` [PATCH v4 4/7] iommu/vt-d: only unmap mapped entries Adam Morrison
2016-04-20 8:33 ` [PATCH v4 5/7] iommu/vt-d: avoid dev iotlb logic in intel-iommu for domains with no dev iotlbs Adam Morrison
[not found] ` <3780bc5682714a48a8d90ee0adf621dbd3529283.1461135861.git.mad-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org>
2016-04-20 15:17 ` Godfrey van der Linden via iommu
[not found] ` <CANSfodEQC3YcVh0_THpDMQx_YZqD=p5Zw5BEnwRhm3hNgaLOhA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-20 15:36 ` Adam Morrison
2016-04-20 16:03 ` Adam Morrison
2016-04-20 8:33 ` [PATCH v4 6/7] iommu/vt-d: change intel-iommu to use IOVA frame numbers Adam Morrison
2016-04-20 8:34 ` [PATCH v4 7/7] iommu/vt-d: introduce per-cpu caching to iova allocation Adam Morrison
[not found] ` <3d87d1ef7c5ae3e07e2d7c105c2fe2bb9a82cb46.1461135861.git.mad-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org>
2016-04-20 19:21 ` David Woodhouse [this message]
[not found] ` <1461180093.25115.28.camel-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2016-04-20 19:54 ` David Woodhouse
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=1461180093.25115.28.camel@infradead.org \
--to=dwmw2-wegcikhe2lqwvfeawa7xhq@public.gmane.org \
--cc=Kernel-team-b10kYP2dOMg@public.gmane.org \
--cc=dan-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org \
--cc=gvdl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org \
--cc=mad-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org \
--cc=omer-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org \
--cc=serebrin-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=shli-b10kYP2dOMg@public.gmane.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).