iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Adam Morrison <mad-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org>
To: Benjamin Serebrin <serebrin-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: Dan Tsafrir
	<dan-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org>,
	Omer Peleg
	<omer-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org>,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	Shaohua Li <shli-b10kYP2dOMg@public.gmane.org>,
	Godfrey van der Linden
	<gvdl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Kernel-team-b10kYP2dOMg@public.gmane.org
Subject: Re: [PATCH v2 7/7] iommu: introduce per-cpu caching to iova allocation
Date: Fri, 15 Apr 2016 00:05:37 +0300	[thread overview]
Message-ID: <CAHMfzJmjZWeUpmTVb-Z7NMJUp0N84ZK4zwUWdAKHv4sd4TXPMg@mail.gmail.com> (raw)
In-Reply-To: <CAN+hb0W=+tuQp3cm_VKoU=LKiVQDPMtGrZGq=59rcaWsy2S-+A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Thu, Apr 14, 2016 at 9:26 PM, Benjamin Serebrin via iommu
<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org> wrote:

> It was pointed out that DMA_32 or _24 (or anything other non-64 size)
> could be starved if the magazines on all cores are full and the depot
> is empty.  (This gets more probable with increased core count.)  You
> could try one more time: call free_iova_rcaches() and try alloc_iova
> again before giving up

That's not safe, unfortunately.  free_iova_rcaches() is meant to be
called only when the domain is dying and the CPUs won't access the
rcaches.

It's tempting to make the rcaches work only for DMA_64 allocations.
This would also solve the problem of respecting the pfn_limit when
allocating, which Shaohua Li pointed out.  Sadly, intel-iommu.c
converts DMA_64 to DMA_32 by default, apparently to avoid dual address
cycles on the PCI bus.  I wonder about the importance of this, though,
as it doesn't seem that anything equivalent happens when iommu=off.

  parent reply	other threads:[~2016-04-14 21:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13 18:50 [PATCH v2 0/7] Intel IOMMU scalability improvements Adam Morrison
     [not found] ` <cover.1460548546.git.mad-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org>
2016-04-13 18:51   ` [PATCH v2 1/7] iommu: refactoring of deferred flush entries Adam Morrison
2016-04-13 18:51   ` [PATCH v2 2/7] iommu: per-cpu deferred invalidation queues Adam Morrison
2016-04-13 18:51   ` [PATCH v2 3/7] iommu: correct flush_unmaps pfn usage Adam Morrison
2016-04-13 18:52   ` [PATCH v2 4/7] iommu: only unmap mapped entries Adam Morrison
     [not found]     ` <e07164c8d0aaff68cabd2cf8e3aee9ed20882ae4.1460548546.git.mad-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org>
2016-04-13 20:37       ` Shaohua Li
2016-04-13 18:52   ` [PATCH v2 5/7] iommu: avoid dev iotlb logic in intel-iommu for domains with no dev iotlbs Adam Morrison
2016-04-13 18:52   ` [PATCH v2 6/7] iommu: change intel-iommu to use IOVA frame numbers Adam Morrison
2016-04-13 18:52   ` [PATCH v2 7/7] iommu: introduce per-cpu caching to iova allocation Adam Morrison
     [not found]     ` <b208a304d83088aae7ecac10a3062dc57c0a2f79.1460548546.git.mad-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org>
2016-04-13 20:43       ` Shaohua Li
2016-04-14 18:26       ` Benjamin Serebrin via iommu
     [not found]         ` <CAN+hb0W=+tuQp3cm_VKoU=LKiVQDPMtGrZGq=59rcaWsy2S-+A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-14 21:05           ` Adam Morrison [this message]
     [not found]             ` <CAHMfzJmjZWeUpmTVb-Z7NMJUp0N84ZK4zwUWdAKHv4sd4TXPMg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-14 21:18               ` Benjamin Serebrin via iommu
     [not found]                 ` <CAN+hb0WOaokFYc6C+mR6rdj4WwmMUSzDHDZngfUvy-5cEve_-g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-14 21:33                   ` Shaohua Li
     [not found]                     ` <20160414213326.GA474260-tb7CFzD8y5b7E6g3fPdp/g2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2016-04-15  4:59                       ` Benjamin Serebrin via iommu
     [not found]                         ` <CAN+hb0WRDYCpY8xoUvvGu4SSD83F9VTMW=9W=xfjYtJV-dijmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-15 17:55                           ` Shaohua Li
     [not found]                             ` <20160415175520.GA2644484-tb7CFzD8y5b7E6g3fPdp/g2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2016-04-17 18:05                               ` Adam Morrison

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=CAHMfzJmjZWeUpmTVb-Z7NMJUp0N84ZK4zwUWdAKHv4sd4TXPMg@mail.gmail.com \
    --to=mad-fresstt7abv7r6psnubssmzhpeb/a1y/@public.gmane.org \
    --cc=Kernel-team-b10kYP2dOMg@public.gmane.org \
    --cc=dan-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org \
    --cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=gvdl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@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).