Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Nirmoy Das <nirmoy.das@linux.intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>,
	<intel-xe@lists.freedesktop.org>, <nirmoy.das@intel.com>,
	<farah.kassabri@intel.com>, <michal.wajdeczko@intel.com>
Subject: Re: [PATCH v2 00/11] Proper GT TLB invalidation layering and new coalescing feature.
Date: Tue, 9 Jul 2024 21:23:47 +0000	[thread overview]
Message-ID: <Zo2qY/YplZbOZpLz@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <e96424e6-31ef-4b50-92cf-dfb3349a1a6f@linux.intel.com>

On Tue, Jul 09, 2024 at 06:42:34PM +0200, Nirmoy Das wrote:
>    On 7/9/2024 6:35 PM, Matthew Brost wrote:
> 
> On Tue, Jul 09, 2024 at 06:08:54PM +0200, Nirmoy Das wrote:
> 
> On 7/9/2024 11:57 AM, Matthew Auld wrote:
> 
> Hi,
> 
> On 08/07/2024 05:03, Matthew Brost wrote:
> 
> While debuging [1] an issue was identified in which if too many GT TLB
> invalidations are issued to the GuC, the GuC can get overwhelmed to the
> point scheduling of jobs starts to stall. To avoid this, hold and
> coalesce GT TLB invalidations in the KMD if a watermark of pending
> invalidations is past. Add gitlab for this issue has also been opened
> [2].
> 
> Layering issues with GT TLB invalidations are known [3] which needed to
> be fixed first before adding this new feature.
> 
> - Patches 1-8 fix the layering.
> - Patches 9-11 add coalescing feature.
> 
> We could merge these two as seperate series if needed.
> 
> CCing various stakeholders (Farah, Michal, Nirmoy) which have raised GT
> TLB invalidation issues in the past.
> 
> Maybe worth mentioning for [1], we try to process TLB invalidations
> directly from the irq, however we also only process the g2h queue
> in-order, so if there is something other than TLB invalidation or fault
> earlier in the queue then we do nothing useful from the irq and just
> return, that is until the wq can eventually process those earlier items
> that couldn't be processed directly from the irq. In the past
> 
> Seen this recently :
> 
> <3> [3763.731822] xe 0000:03:00.0: [drm] *ERROR* GT0: g2h outstanding: 611
> <snip>
> <6> [3727.857273] [IGT] xe_evict: executing
> <3> [3730.165480] xe 0000:03:00.0: [drm] *ERROR* TILE0 [GTT] GT0: TLB
> invalidation time'd out, seqno=26858, recv=2685
> 
> Missing the last digit of '2685'?
> 
>    oops, yes:
> 
>    <3> [3730.165480] xe 0000:03:00.0: [drm] *ERROR* TILE0 [GTT] GT0: TLB
>    invalidation time'd out, seqno=26858, recv=26857
> 
> 
> 
> Which I think fits your description. This series should help but not sure
> how much.
> 
> 
> From arch level if this is a continued problem, perhaps we should ask
> for a dedicated G2H queue for TLB invalidation done responses. It seems
> like a fairly reasonable ask to me as TLB invalidations really shouldn't
> get stuck behind other G2H processing...
> 
>    Yes, that should work really well. I am currently trying out this
>    series but haven't manged to reproduce the issue without/without the
>    series reliably yet.
> 
>    Regards,
> 

Also worth mentioning that I was able to prove this series helped with
the scheduler starvition I issue I was seeing [1] which triggered me
writing this series. Will include this in my next cover letter if I need
to send another rev.

Matt

[1] https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/799#note_2483150

>    Nirmoy
> 
> Matt
> 
> 
> Regards,
> 
> Nirmoy
> 
> 
> I have seen TLB timeouts where the TLB invalidation is clearly in the
> g2h queue (and has been for a while), but is stuck behind something
> earlier in the queue that needs the wq, but system is under such a heavy
> load that the wq can't be scheduled in a timely manner.
> 
> 
> v2:
>   - Fix CI issues
>   - Clean up some of the series / patch structure
> 
> Matt
> 
> [1]
> [1]https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/799#note_2449497
> [2] [2]https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2162
> [3] [3]https://patchwork.freedesktop.org/series/133001/
> 
> Matthew Brost (11):
>    drm/xe: Add xe_gt_tlb_invalidation_fence_init helper
>    drm/xe: Drop xe_gt_tlb_invalidation_wait
>    drm/xe: s/tlb_invalidation.lock/tlb_invalidation.fence_lock
>    drm/xe: Add tlb_invalidation.seqno_lock
>    drm/xe: Add xe_gt_tlb_invalidation_done_handler
>    drm/xe: Add send tlb invalidation helpers
>    drm/xe: Add xe_guc_tlb_invalidation layer
>    drm/xe: Add multi-client support for GT TLB invalidations
>    drm/xe: Add GT TLB invalidation coalescing
>    drm/xe: Add GT TLB invalidation coalesce tracepoints
>    drm/xe: Add GT TLB invalidation watermark debugfs
> 
>   drivers/gpu/drm/xe/Makefile                   |   1 +
>   drivers/gpu/drm/xe/xe_debugfs.c               |  38 ++
>   drivers/gpu/drm/xe/xe_device.c                |   3 +
>   drivers/gpu/drm/xe/xe_device_types.h          |   5 +
>   drivers/gpu/drm/xe/xe_ggtt.c                  |  21 +-
>   drivers/gpu/drm/xe/xe_ggtt_types.h            |   5 +
>   drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c   | 641 ++++++++++++------
>   drivers/gpu/drm/xe/xe_gt_tlb_invalidation.h   |  26 +-
>   .../gpu/drm/xe/xe_gt_tlb_invalidation_types.h |  41 ++
>   drivers/gpu/drm/xe/xe_gt_types.h              |  43 +-
>   drivers/gpu/drm/xe/xe_guc_ct.c                |   2 +-
>   drivers/gpu/drm/xe/xe_guc_tlb_invalidation.c  | 145 ++++
>   drivers/gpu/drm/xe/xe_guc_tlb_invalidation.h  |  18 +
>   drivers/gpu/drm/xe/xe_pt.c                    |  33 +-
>   drivers/gpu/drm/xe/xe_trace.h                 |  10 +
>   drivers/gpu/drm/xe/xe_vm.c                    |  45 +-
>   drivers/gpu/drm/xe/xe_vm_types.h              |   3 +
>   17 files changed, 801 insertions(+), 279 deletions(-)
>   create mode 100644 drivers/gpu/drm/xe/xe_guc_tlb_invalidation.c
>   create mode 100644 drivers/gpu/drm/xe/xe_guc_tlb_invalidation.h
> 
> References
> 
>    1. https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/799#note_2449497
>    2. https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2162
>    3. https://patchwork.freedesktop.org/series/133001/

  reply	other threads:[~2024-07-09 21:24 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-08  4:03 [PATCH v2 00/11] Proper GT TLB invalidation layering and new coalescing feature Matthew Brost
2024-07-08  4:03 ` [PATCH v2 01/11] drm/xe: Add xe_gt_tlb_invalidation_fence_init helper Matthew Brost
2024-07-09 15:56   ` Nirmoy Das
2024-07-08  4:03 ` [PATCH v2 02/11] drm/xe: Drop xe_gt_tlb_invalidation_wait Matthew Brost
2024-07-09 15:57   ` Nirmoy Das
2024-07-08  4:03 ` [PATCH v2 03/11] drm/xe: s/tlb_invalidation.lock/tlb_invalidation.fence_lock Matthew Brost
2024-07-09 15:57   ` Nirmoy Das
2024-07-08  4:03 ` [PATCH v2 04/11] drm/xe: Add tlb_invalidation.seqno_lock Matthew Brost
2024-07-08  4:03 ` [PATCH v2 05/11] drm/xe: Add xe_gt_tlb_invalidation_done_handler Matthew Brost
2025-07-23 17:22   ` Summers, Stuart
2024-07-08  4:03 ` [PATCH v2 06/11] drm/xe: Add send tlb invalidation helpers Matthew Brost
2024-07-08  4:03 ` [PATCH v2 07/11] drm/xe: Add xe_guc_tlb_invalidation layer Matthew Brost
2024-07-09 21:31   ` Michal Wajdeczko
2024-07-10  4:02     ` Matthew Brost
2024-07-08  4:03 ` [PATCH v2 08/11] drm/xe: Add multi-client support for GT TLB invalidations Matthew Brost
2024-07-08  4:03 ` [PATCH v2 09/11] drm/xe: Add GT TLB invalidation coalescing Matthew Brost
2024-07-08  4:03 ` [PATCH v2 10/11] drm/xe: Add GT TLB invalidation coalesce tracepoints Matthew Brost
2024-07-08  4:03 ` [PATCH v2 11/11] drm/xe: Add GT TLB invalidation watermark debugfs Matthew Brost
2024-07-08  4:08 ` ✓ CI.Patch_applied: success for Proper GT TLB invalidation layering and new coalescing feature. (rev2) Patchwork
2024-07-08  4:09 ` ✗ CI.checkpatch: warning " Patchwork
2024-07-08  4:10 ` ✓ CI.KUnit: success " Patchwork
2024-07-08  4:22 ` ✓ CI.Build: " Patchwork
2024-07-08  4:24 ` ✓ CI.Hooks: " Patchwork
2024-07-08  4:25 ` ✓ CI.checksparse: " Patchwork
2024-07-08  4:51 ` ✓ CI.BAT: " Patchwork
2024-07-08  5:46 ` ✗ CI.FULL: failure " Patchwork
2024-07-09  9:57 ` [PATCH v2 00/11] Proper GT TLB invalidation layering and new coalescing feature Matthew Auld
2024-07-09 16:08   ` Nirmoy Das
2024-07-09 16:35     ` Matthew Brost
2024-07-09 16:42       ` Nirmoy Das
2024-07-09 21:23         ` Matthew Brost [this message]
2024-07-09 16:31   ` Matthew Brost

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=Zo2qY/YplZbOZpLz@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=farah.kassabri@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=nirmoy.das@intel.com \
    --cc=nirmoy.das@linux.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