All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Lewis <aaronlewis@google.com>
To: kvm@vger.kernel.org
Cc: alex@shazbot.org, dmatlack@google.com, jgg@nvidia.com,
	 Aaron Lewis <aaronlewis@google.com>
Subject: [PATCH 0/2] vfio/iommufd: Prevent scheduler warnings when unmapping large regions
Date: Tue, 14 Jul 2026 21:03:01 +0000	[thread overview]
Message-ID: <20260714210303.3967981-1-aaronlewis@google.com> (raw)

Both the Type1 IOMMU and IOMMUFD can be guilty of not playing nice with
the scheduler during DMA unmapping on large regions (e.g., 256GB). Add
rate-limited calls to cond_resched() to ensure this doesn't happen.

This series was tested using the selftest proposed here:
 - https://lore.kernel.org/kvm/20260701203311.326798-1-aaronlewis@google.com/

And profiled using the bpftrace tooling proposed here:
 - https://lore.kernel.org/kvm/20260630141152.3757722-2-aaronlewis@google.com/

Note that the kernel must be built with preemption disabled and have
LATENCY_WARN enabled in order to trigger the warnings. With those
conditions met, the issue should reproduce as described in the
changelogs. 

Aaron Lewis (2):
  vfio/type1: Periodically try rescheduling when unmapping
  iommufd: Periodically reschedule when unmapping

 drivers/iommu/iommufd/pages.c   | 4 ++++
 drivers/vfio/vfio_iommu_type1.c | 3 +++
 2 files changed, 7 insertions(+)

-- 
2.55.0.141.g00534a21ce-goog


             reply	other threads:[~2026-07-14 21:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14 21:03 Aaron Lewis [this message]
2026-07-14 21:03 ` [PATCH 1/2] vfio/type1: Periodically try rescheduling when unmapping Aaron Lewis
2026-07-14 21:15   ` sashiko-bot
2026-07-15 17:39   ` David Matlack
2026-07-15 18:12     ` Jason Gunthorpe
2026-07-14 21:03 ` [PATCH 2/2] iommufd: Periodically reschedule " Aaron Lewis
2026-07-14 21:34   ` sashiko-bot
2026-07-15 18:11 ` [PATCH 0/2] vfio/iommufd: Prevent scheduler warnings when unmapping large regions Jason Gunthorpe
2026-07-15 22:07   ` Aaron Lewis

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=20260714210303.3967981-1-aaronlewis@google.com \
    --to=aaronlewis@google.com \
    --cc=alex@shazbot.org \
    --cc=dmatlack@google.com \
    --cc=jgg@nvidia.com \
    --cc=kvm@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.