Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Summers, Stuart" <stuart.summers@intel.com>
To: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"Nguyen, Brian3" <brian3.nguyen@intel.com>
Cc: "Roper, Matthew D" <matthew.d.roper@intel.com>
Subject: Re: [PATCH 1/2] drm/xe: Skip over non leaf pte for PRL generation
Date: Mon, 23 Feb 2026 22:49:21 +0000	[thread overview]
Message-ID: <be5e3d57544ece734dec2513ab4717e80b49adec.camel@intel.com> (raw)
In-Reply-To: <20260129082756.1096935-3-brian3.nguyen@intel.com>

On Thu, 2026-01-29 at 08:27 +0000, Brian Nguyen wrote:
> The check using xe_child->base.children was insufficient in
> determining
> if a pte was a leaf node. So explicitly check for if a pte is a leaf
> through the bit checks.
> 
> Fixes: b912138df299 ("drm/xe: Create page reclaim list on unbind")
> 
> v2:
>  - Remove old assert. (Matt R)
> 
> Signed-off-by: Brian Nguyen <brian3.nguyen@intel.com>
> Cc: Matt Roper <matthew.d.roper@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_pt.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c
> index 6703a7049227..b73a356d0fa1 100644
> --- a/drivers/gpu/drm/xe/xe_pt.c
> +++ b/drivers/gpu/drm/xe/xe_pt.c
> @@ -1655,7 +1655,7 @@ static int xe_pt_stage_unbind_entry(struct
> xe_ptw *parent, pgoff_t offset,
>  
>         XE_WARN_ON(!*child);
>         XE_WARN_ON(!level);
> -       /* Check for leaf node */
> +       /* Optimistically check for leaf node, may not be guaranteed

I would keep the comments the same - we're still trying to check a leaf
node here and we aren't really doing anything special. If we have
questions, we can look at the commit history to determine what changed
from your prior implementation.

Or if you want documentation here, it's more interesting to me *why* we
can't see this from the child alone than just the fact that we can't
(which we can observe by the if condition).

Also applies to the comment below too.

Thanks,
Stuart

> from children alone */
>         if (xe_walk->prl && xe_page_reclaim_list_valid(xe_walk->prl)
> &&
>             (!xe_child->base.children || !xe_child-
> >base.children[first])) {
>                 struct iosys_map *leaf_map = &xe_child->bo->vmap;
> @@ -1675,10 +1675,13 @@ static int xe_pt_stage_unbind_entry(struct
> xe_ptw *parent, pgoff_t offset,
>                                 break;
>                         }
>  
> -                       /* Ensure it is a defined page */
> -                       xe_tile_assert(xe_walk->tile,
> -                                      xe_child->level == 0 ||
> -                                      (pte & (XE_PTE_PS64 |
> XE_PDE_PS_2M | XE_PDPE_PS_1G)));
> +                       /*
> +                        * The check for xe_pt's children is
> insufficient to determine leaf.
> +                        * If not leaf, break out and continue in
> next page walk level.
> +                        */
> +                       if (xe_child->level > 0 &&
> +                           !(pte & (XE_PTE_PS64 | XE_PDE_PS_2M |
> XE_PDPE_PS_1G)))
> +                               break;
>  
>                         /* An entry should be added for 64KB but
> contigious 4K have XE_PTE_PS64 */
>                         if (pte & XE_PTE_PS64)


  parent reply	other threads:[~2026-02-23 22:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29  8:27 [PATCH 1/2] drm/xe: Skip over non leaf pte for PRL generation Brian Nguyen
2026-01-29  8:27 ` [PATCH 2/2] drm/xe: Move page reclaim done_handler to own func Brian Nguyen
2026-01-29 21:40   ` Lin, Shuicheng
2026-02-23 22:45   ` Summers, Stuart
2026-02-23 22:51   ` Matthew Brost
2026-01-29  9:14 ` ✓ CI.KUnit: success for series starting with [1/2] drm/xe: Skip over non leaf pte for PRL generation Patchwork
2026-01-29  9:48 ` ✓ Xe.CI.BAT: " Patchwork
2026-02-23 21:48 ` [PATCH 1/2] " Nguyen, Brian3
2026-02-23 22:49 ` Summers, Stuart [this message]
2026-02-23 22:59   ` Matthew Brost
2026-02-23 23:07     ` Summers, Stuart
2026-02-23 23:33       ` Nguyen, Brian3
2026-02-24  1:45         ` Matthew Brost
2026-02-24  2:02           ` Matthew Brost
2026-02-25  6:45             ` Nguyen, Brian3
2026-02-25  7:19               ` 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=be5e3d57544ece734dec2513ab4717e80b49adec.camel@intel.com \
    --to=stuart.summers@intel.com \
    --cc=brian3.nguyen@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.d.roper@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