From: Jani Nikula <jani.nikula@linux.intel.com>
To: Arunpravin <Arunpravin.PaneerSelvam@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
intel-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com, matthew.auld@intel.com,
christian.koenig@amd.com,
Arunpravin <Arunpravin.PaneerSelvam@amd.com>
Subject: Re: [Intel-gfx] [PATCH] drm: remove min_order BUG_ON check
Date: Mon, 07 Mar 2022 16:45:37 +0200 [thread overview]
Message-ID: <874k493jou.fsf@intel.com> (raw)
In-Reply-To: <20220307143707.3687-1-Arunpravin.PaneerSelvam@amd.com>
On Mon, 07 Mar 2022, Arunpravin <Arunpravin.PaneerSelvam@amd.com> wrote:
> place BUG_ON(order < min_order) outside do..while
> loop as it fails Unigine Heaven benchmark.
>
> Unigine Heaven has buffer allocation requests for
> example required pages are 161 and alignment request
> is 128. To allocate the remaining 33 pages, continues
> the iteration to find the order value which is 5 and
> when it compares with min_order = 7, enables the
> BUG_ON(). To avoid this problem, placed the BUG_ON
> check outside of do..while loop.
How about turning these BUG_ON()s to WARN_ON()s with an error return?
What's the point in oopsing?
BR,
Jani.
>
> Signed-off-by: Arunpravin <Arunpravin.PaneerSelvam@amd.com>
> ---
> drivers/gpu/drm/drm_buddy.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
> index 72f52f293249..ed94c56b720f 100644
> --- a/drivers/gpu/drm/drm_buddy.c
> +++ b/drivers/gpu/drm/drm_buddy.c
> @@ -669,10 +669,11 @@ int drm_buddy_alloc_blocks(struct drm_buddy *mm,
> order = fls(pages) - 1;
> min_order = ilog2(min_page_size) - ilog2(mm->chunk_size);
>
> + BUG_ON(order < min_order);
> +
> do {
> order = min(order, (unsigned int)fls(pages) - 1);
> BUG_ON(order > mm->max_order);
> - BUG_ON(order < min_order);
>
> do {
> if (flags & DRM_BUDDY_RANGE_ALLOCATION)
>
> base-commit: 8025c79350b90e5a8029234d433578f12abbae2b
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2022-03-07 14:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-07 14:37 [Intel-gfx] [PATCH] drm: remove min_order BUG_ON check Arunpravin
2022-03-07 14:45 ` Jani Nikula [this message]
2022-03-08 14:32 ` Arunpravin
2022-03-07 15:04 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2022-03-07 15:36 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-03-07 15:53 ` [Intel-gfx] [PATCH] " Christian König
2022-03-08 14:27 ` Arunpravin
2022-03-07 16:41 ` Matthew Auld
2022-03-08 13:59 ` Arunpravin
2022-03-08 17:01 ` Matthew Auld
2022-03-10 14:47 ` Arunpravin
2022-03-10 15:29 ` Matthew Auld
2022-03-14 19:38 ` Arunpravin
2022-03-07 18:31 ` [Intel-gfx] ✓ Fi.CI.IGT: success for " Patchwork
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=874k493jou.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=Arunpravin.PaneerSelvam@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=matthew.auld@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