Linux IOMMU Development
 help / color / mirror / Atom feed
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 v3 5/7] iommu: avoid dev iotlb logic in intel-iommu for domains with no dev iotlbs
Date: Tue, 19 Apr 2016 15:09:27 -0400	[thread overview]
Message-ID: <1461092967.25115.7.camel@infradead.org> (raw)
In-Reply-To: <20d0571ab8dda05bd3980b18df0a810fb26480e4.1460733778.git.mad-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 1576 bytes --]

On Tue, 2016-04-19 at 19:49 +0300, Adam Morrison wrote:
> --- a/drivers/iommu/intel-iommu.c
> +++ b/drivers/iommu/intel-iommu.c
> @@ -392,6 +392,7 @@ struct dmar_domain {
>  					 * to VT-d spec, section 9.3 */
>  
>  	struct list_head devices;	/* all devices' list */
> +	bool has_iotlb_device;

If you put that *before* the 'devices' field then the array will pack
better.

> @@ -1523,6 +1553,9 @@ static void iommu_flush_dev_iotlb(struct dmar_domain *domain,
>  	unsigned long flags;
>  	struct device_domain_info *info;
>  
> +	if (!domain->has_iotlb_device)
> +		return;
> +
>  	spin_lock_irqsave(&device_domain_lock, flags);
>  	list_for_each_entry(info, &domain->devices, link) {
>  		if (!info->ats_enabled)
> 

Hm, I wonder if it would be nicer to check this in the caller (both of
them). As things stand, in flush_unmaps() we'll now be calculating
ilog2(nrpages) for (possibly) no reason before calling this function.


Other than that, this all looks excellent; thanks. I'll apply it when I
get home from LSF/MM later this week or next.

Only a few cosmetic things to change — please use 'iommu/vt-d:' as the
prefix on each commit, and spell 'MiB' and 'KiB' correctly in the final
patch in the series. (And I'm not sure I quite understand 'a CPU can
cache at most 32 MiB and the global cache is bounded by 4 MiB.' either
way...)

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org                              Intel Corporation


[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5691 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  parent reply	other threads:[~2016-04-19 19:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19 16:48 [PATCH v3 0/7] Intel IOMMU scalability improvements Adam Morrison
     [not found] ` <cover.1460733778.git.mad-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org>
2016-04-19 16:48   ` [PATCH v3 1/7] iommu: refactoring of deferred flush entries Adam Morrison
2016-04-19 16:48   ` [PATCH v3 2/7] iommu: per-cpu deferred invalidation queues Adam Morrison
2016-04-19 16:48   ` [PATCH v3 3/7] iommu: correct flush_unmaps pfn usage Adam Morrison
2016-04-19 16:49   ` [PATCH v3 4/7] iommu: only unmap mapped entries Adam Morrison
2016-04-19 16:49   ` [PATCH v3 5/7] iommu: avoid dev iotlb logic in intel-iommu for domains with no dev iotlbs Adam Morrison
     [not found]     ` <20d0571ab8dda05bd3980b18df0a810fb26480e4.1460733778.git.mad-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org>
2016-04-19 19:09       ` David Woodhouse [this message]
     [not found]         ` <1461092967.25115.7.camel-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2016-04-20  8:21           ` Adam Morrison
2016-04-19 16:49   ` [PATCH v3 6/7] iommu: change intel-iommu to use IOVA frame numbers Adam Morrison
2016-04-19 16:49   ` [PATCH v3 7/7] iommu: introduce per-cpu caching to iova allocation Adam Morrison
     [not found]     ` <0923752fb142601d6c2b58bcf7cdceea6ec9305e.1460733778.git.mad-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org>
2016-04-19 20:50       ` Benjamin Serebrin via iommu
2016-04-19 20:47   ` [PATCH v3 0/7] Intel IOMMU scalability improvements Shaohua Li
     [not found]     ` <20160419204705.GA1134028-tb7CFzD8y5b7E6g3fPdp/g2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2016-04-19 20:52       ` Benjamin Serebrin via iommu

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=1461092967.25115.7.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