public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Huang, Jiaqing" <jiaqing.huang@intel.com>
To: Baolu Lu <baolu.lu@linux.intel.com>,
	joro@8bytes.org, will@kernel.org, robin.murphy@arm.com,
	dwmw2@infradead.org, linux-kernel@vger.kernel.org,
	iommu@lists.linux.dev
Cc: jacob.jun.pan@linux.intel.com, kevin.tian@intel.com,
	yi.y.sun@intel.com, kvm@vger.kernel.org
Subject: Re: [PATCH 1/2] iommu: Introduce a rb_tree for looking up device
Date: Fri, 27 Oct 2023 14:09:11 +0800	[thread overview]
Message-ID: <bf2dbc64-a6b6-4763-b497-80f0f1675366@intel.com> (raw)
In-Reply-To: <5a4c169d-8e42-4609-87db-8b68f04bb0fe@linux.intel.com>

On 10/24/2023 7:58 PM, Baolu Lu wrote:

> On 2023/10/24 16:41, Huang Jiaqing wrote:
>> The existing IO page fault handler locates the PCI device by calling
>> pci_get_domain_bus_and_slot(), which searches the list of all PCI
>> devices until the desired PCI device is found. This is inefficient
>> because the algorithm efficiency of searching a list is O(n). In the
>> critical path of handling an IO page fault, this is not performance
>> friendly given that I/O page fault handling patch is performance
>> critical, and parallel heavy dsa_test may cause cpu stuck due to
>> the low efficiency and lock competition in current path.
>>
>> To improve the performance of the IO page fault handler, replace
>> pci_get_domain_bus_and_slot() with a local red-black tree. A red-black
>> tree is a self-balancing binary search tree, which means that the
>> average time complexity of searching a red-black tree is O(log(n)). This
>> is significantly faster than O(n), so it can significantly improve the
>> performance of the IO page fault handler.
>>
>> In addition, we can only insert the affected devices (those that have IO
>> page fault enabled) into the red-black tree. This can further improve
>> the performance of the IO page fault handler.
>>
>> This series depends on "deliver page faults to user space" patch-set:
>> https://lore.kernel.org/linux-iommu/20230928042734.16134-1-baolu.lu@linux.intel.com/
>>
>
> The note above is not part of the commit message, and should be placed
> below the tear line or in the cover letter, if there is one.

Will fix, thanks for catching!

BRs,
Jiaqing

  reply	other threads:[~2023-10-27  6:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24  8:41 [PATCH 1/2] iommu: Introduce a rb_tree for looking up device Huang Jiaqing
2023-10-24  8:41 ` [PATCH 2/2] iommu/vt-d: Adopt new helper for looking up pci device Huang Jiaqing
2023-10-24 12:01   ` Baolu Lu
2023-10-27  6:08     ` Huang, Jiaqing
2023-10-24 11:58 ` [PATCH 1/2] iommu: Introduce a rb_tree for looking up device Baolu Lu
2023-10-27  6:09   ` Huang, Jiaqing [this message]
2023-10-24 12:38 ` Robin Murphy

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=bf2dbc64-a6b6-4763-b497-80f0f1675366@intel.com \
    --to=jiaqing.huang@intel.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux.dev \
    --cc=jacob.jun.pan@linux.intel.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    --cc=yi.y.sun@intel.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