linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: iommu@lists.linux-foundation.org,
	LKML <linux-kernel@vger.kernel.org>,
	Joerg Roedel <joro@8bytes.org>,
	John Garry <john.garry@huawei.com>
Subject: Re: [Patch v3 2/3] iommu: optimize iova_magazine_free_pfns()
Date: Tue, 21 Jan 2020 09:29:12 -0800	[thread overview]
Message-ID: <CAM_iQpXbjf8MuL17kZhxawXYBJm6t5-ho77F_VWR30L-9FS4Kg@mail.gmail.com> (raw)
In-Reply-To: <8ce2f5b6-74e1-9a74-fd80-9ad688beb9b2@arm.com>

On Tue, Jan 21, 2020 at 1:52 AM Robin Murphy <robin.murphy@arm.com> wrote:
>
> On 18/12/2019 4:39 am, Cong Wang wrote:
> > If the magazine is empty, iova_magazine_free_pfns() should
> > be a nop, however it misses the case of mag->size==0. So we
> > should just call iova_magazine_empty().
> >
> > This should reduce the contention on iovad->iova_rbtree_lock
> > a little bit, not much at all.
>
> Have you measured that in any way? AFAICS the only time this can get
> called with a non-full magazine is in the CPU hotplug callback, where
> the impact of taking the rbtree lock and immediately releasing it seems
> unlikely to be significant on top of everything else involved in that
> operation.

This patchset is only tested as a whole, it is not easy to deploy
each to production and test it separately.

Is there anything wrong to optimize a CPU hotplug path? :) And,
it is called in alloc_iova_fast() too when, for example, over-cached.

Thanks.

  reply	other threads:[~2020-01-21 17:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18  4:39 [Patch v3 0/3] iommu: reduce spinlock contention on fast path Cong Wang
2019-12-18  4:39 ` [Patch v3 1/3] iommu: avoid unnecessary magazine allocations Cong Wang
2020-01-21 11:11   ` Robin Murphy
2020-01-21 17:21     ` Cong Wang
2020-01-22 17:07       ` Robin Murphy
2020-01-22 17:54         ` Cong Wang
2019-12-18  4:39 ` [Patch v3 2/3] iommu: optimize iova_magazine_free_pfns() Cong Wang
2020-01-21  9:52   ` Robin Murphy
2020-01-21 17:29     ` Cong Wang [this message]
2020-01-22 17:34       ` Robin Murphy
2020-01-22 17:45         ` Cong Wang
2019-12-18  4:39 ` [Patch v3 3/3] iommu: avoid taking iova_rbtree_lock twice Cong Wang
2019-12-19  9:51   ` John Garry
2020-01-21  9:56   ` Robin Murphy
2020-03-03 11:33     ` John Garry
2020-01-20 23:10 ` [Patch v3 0/3] iommu: reduce spinlock contention on fast path Cong Wang
  -- strict thread matches above, loose matches on Subject: below --
2019-12-06 21:38 Cong Wang
2019-12-06 21:38 ` [Patch v3 2/3] iommu: optimize iova_magazine_free_pfns() Cong Wang

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=CAM_iQpXbjf8MuL17kZhxawXYBJm6t5-ho77F_VWR30L-9FS4Kg@mail.gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=john.garry@huawei.com \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.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).