All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] drm/xe: Fix two bo pin/unpin accounting bugs
@ 2026-10-01 13:40 Thomas Hellström
  2026-10-01 13:40 ` [PATCH v2 1/2] drm/xe: Fix shrinker accounting double-subtraction on nested external pins Thomas Hellström
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Thomas Hellström @ 2026-10-01 13:40 UTC (permalink / raw)
  To: intel-xe; +Cc: Thomas Hellström, Matthew Brost, Matthew Auld

Two independent fixes uncovered while auditing the bo pin/unpin and
shrinker accounting paths:

1/2 fixes a double-subtraction of the shrinker's page/object
accounting on nested xe_bo_pin_external()/xe_bo_unpin_external()
calls, which can desynchronize the shrinker's counts from reality and,
due to a signed-to-unsigned interpretation in xe_shrinker_count(),
turn into a huge bogus shrinkable/purgeable page count that causes the
shrinker to be invoked excessively under memory pressure.

2/2 fixes a stale xe->pinned.late.external list entry left behind when
a bo pinned both externally and as an fb has its final unpin performed
via the fb-pin path, which bypasses pinned_link maintenance and can
lead to list corruption or a use-after-free once the bo is freed.

Both are tagged for stable.

Thomas Hellström (2):
  drm/xe: Fix shrinker accounting double-subtraction on nested external
    pins
  drm/xe: Fix stale pinned_link entry when fb-pin performs the final
    unpin

 drivers/gpu/drm/xe/display/xe_fb_pin.c |   6 +-
 drivers/gpu/drm/xe/xe_bo.c             | 110 +++++++++++++++++++------
 drivers/gpu/drm/xe/xe_bo.h             |   2 +
 3 files changed, 90 insertions(+), 28 deletions(-)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-10-02 11:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-01 13:40 [PATCH v2 0/2] drm/xe: Fix two bo pin/unpin accounting bugs Thomas Hellström
2026-10-01 13:40 ` [PATCH v2 1/2] drm/xe: Fix shrinker accounting double-subtraction on nested external pins Thomas Hellström
2026-10-01 13:56   ` sashiko-bot
2026-10-01 17:34   ` Matthew Auld
2026-10-01 13:40 ` [PATCH v2 2/2] drm/xe: Fix stale pinned_link entry when fb-pin performs the final unpin Thomas Hellström
2026-10-01 17:26   ` Matthew Auld
2026-10-02  9:52     ` Thomas Hellström
2026-10-02 11:59       ` Matthew Auld
2026-10-01 17:44   ` Matthew Auld
2026-10-01 13:50 ` ✓ CI.KUnit: success for drm/xe: Fix two bo pin/unpin accounting bugs Patchwork
2026-10-01 18:11 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-01 22:58 ` ✗ Xe.CI.FULL: failure " Patchwork

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.