All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Nirmoy Das <nirmoy.aiemd@gmail.com>, dri-devel@lists.freedesktop.org
Cc: Nirmoy Das <nirmoy.das@amd.com>,
	christian.koenig@amd.com, nirmoy.aiemd@gmail.com
Subject: Re: [PATCH 2/2] drm/mm: improve rb_hole_addr rbtree search
Date: Tue, 19 May 2020 23:56:02 +0100	[thread overview]
Message-ID: <158992896210.6082.4915032891292068718@build.alporthouse.com> (raw)
In-Reply-To: <20200519084436.91718-2-nirmoy.das@amd.com>

Quoting Nirmoy Das (2020-05-19 09:44:36)
> +#define DRM_MM_ALIGN_SHIFT 6
>  #define HOLE_SIZE(NODE) ((NODE)->hole_size)
>  #define HOLE_ADDR(NODE) (__drm_mm_hole_node_start(NODE))
> +#define HOLE_SIZE_ALIGN(NODE) ((NODE->hole_size << DRM_MM_ALIGN_SHIFT) | \
> +                              ffs(HOLE_ADDR(NODE)))

Fwiw, max hole size of 58b, we would need to stop storing byte
extents...

>  static struct drm_mm_node *
> -next_hole_low_addr(struct drm_mm_node *entry, u64 size)
> +next_hole_low_addr(struct drm_mm_node *entry, u64 size, u64 alignment)
>  {
>         struct rb_node *rb_node, *right_rb_node, *parent_rb_node;
>         struct drm_mm_node *right_node;
> +       u64 req_align = (size + alignment) << DRM_MM_ALIGN_SHIFT;
>  
>         if (!entry)
>                 return NULL;
> @@ -513,6 +561,7 @@ next_hole_low_addr(struct drm_mm_node *entry, u64 size)
>                 right_node = rb_entry(right_rb_node,
>                                       struct drm_mm_node, rb_hole_addr);
>                 if ((right_node->subtree_max_hole < size ||
> +                    right_node->subtree_max_hole_align < req_align ||

What was the point in storing the packed alignment if we are just
searching for a hole big enough for (size + alignment)?
-Chris
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2020-05-19 22:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19  8:44 [PATCH 1/2] drm/mm: expand rb_hole_addr augmented callbacks Nirmoy Das
2020-05-19  8:44 ` [PATCH 2/2] drm/mm: improve rb_hole_addr rbtree search Nirmoy Das
2020-05-19 21:55   ` Chris Wilson
2020-05-19 22:56   ` Chris Wilson [this message]
2020-05-20 16:28     ` Nirmoy
2020-05-20 16:35       ` Chris Wilson
2020-05-20 16:46         ` Nirmoy
2020-05-19 22:40 ` [PATCH 1/2] drm/mm: expand rb_hole_addr augmented callbacks Chris Wilson
2020-05-20  7:00 ` Christian König

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=158992896210.6082.4915032891292068718@build.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=nirmoy.aiemd@gmail.com \
    --cc=nirmoy.das@amd.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 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.