Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Piotr Piórkowski" <piotr.piorkowski@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: "Cavitt, Jonathan" <jonathan.cavitt@intel.com>,
	"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 1/2] drm/xe/pf: Limit fair VF LMEM provisioning
Date: Fri, 12 Jul 2024 15:53:18 +0200	[thread overview]
Message-ID: <20240712135318.zxhr6gvulkc3qdlk@intel.com> (raw)
In-Reply-To: <cba1695f-d537-47d7-aa7e-20c112c83846@intel.com>

Michal Wajdeczko <michal.wajdeczko@intel.com> wrote on czw [2024-lip-11 22:21:07 +0200]:
> 
> 
> On 11.07.2024 22:02, Cavitt, Jonathan wrote:
> > -----Original Message-----
> > From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Michal Wajdeczko
> > Sent: Thursday, July 11, 2024 12:23 PM
> > To: intel-xe@lists.freedesktop.org
> > Cc: Wajdeczko, Michal <Michal.Wajdeczko@intel.com>
> > Subject: [PATCH 1/2] drm/xe/pf: Limit fair VF LMEM provisioning
> >>
> >> Due to the current design of the BO and VRAM manager, any object
> >> with XE_BO_FLAG_PINNED flag, which the PF driver uses during VF
> >> LMEM provisionining, is created with the TTM_PL_FLAG_CONTIGUOUS
> >> flag, which may cause VRAM fragmentation that prevents subsequent
> >> allocations of larger objects, like fair VF LMEM provisioning.
> >>
> >> To avoid such failures, round down fair VF LMEM provisioning size
> >> to next power of two size, to compensate what xe_ttm_vram_mgr is
> >> doing to achieve contiguous allocations.
> >>
> >> Fixes: ac6598aed1b3 ("drm/xe/pf: Add support to configure SR-IOV VFs")
> >> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> >> ---
> >>  drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 1 +
> >>  1 file changed, 1 insertion(+)
> >>
> >> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> >> index db6c213da847..4699b7836001 100644
> >> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> >> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> >> @@ -1543,6 +1543,7 @@ static u64 pf_estimate_fair_lmem(struct xe_gt *gt, unsigned int num_vfs)
> >>  	u64 fair;
> >>  
> >>  	fair = div_u64(available, num_vfs);
> >> +	fair = rounddown_pow_of_two(fair);	/* XXX: ttm_vram_mgr & drm_buddy limitation */
> >>  	fair = ALIGN_DOWN(fair, alignment);
> > 
> > If the alignment is also a power of two, then ALIGN_DOWN here probably
> > isn't necessary.  But I won't block on it because I'm probably just
> > misunderstanding something.
> 
> true, it's redundant, but I didn't want to remove it since this new
> rounddown_pow_of_two() is (I hope) temporary and I don't want to
> accidentally miss mandatory HW requirement
> 
> > 
> > Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
> > -Jonathan Cavitt
> 
> thanks!
> 

LGTM: Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>

> > 
> >>  #ifdef MAX_FAIR_LMEM
> >>  	fair = min_t(u64, MAX_FAIR_LMEM, fair);
> >> -- 
> >> 2.43.0
> >>
> >>

-- 

  reply	other threads:[~2024-07-12 13:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-11 19:23 [PATCH 0/2] drm/xe/pf: Limit fair VF LMEM provisioning Michal Wajdeczko
2024-07-11 19:23 ` [PATCH 1/2] " Michal Wajdeczko
2024-07-11 20:02   ` Cavitt, Jonathan
2024-07-11 20:21     ` Michal Wajdeczko
2024-07-12 13:53       ` Piotr Piórkowski [this message]
2024-07-12 13:55       ` Piotr Piórkowski
2024-07-11 19:23 ` [PATCH 2/2] drm/xe: Enable SR-IOV for ADL/ATSM Michal Wajdeczko
2024-07-11 20:26   ` Cavitt, Jonathan
2024-07-12 21:07   ` Lucas De Marchi
2024-07-11 19:31 ` ✓ CI.Patch_applied: success for drm/xe/pf: Limit fair VF LMEM provisioning Patchwork
2024-07-11 19:32 ` ✓ CI.checkpatch: " Patchwork
2024-07-11 19:34 ` ✓ CI.KUnit: " Patchwork
2024-07-11 19:46 ` ✓ CI.Build: " Patchwork
2024-07-11 19:48 ` ✓ CI.Hooks: " Patchwork
2024-07-11 19:49 ` ✓ CI.checksparse: " Patchwork
2024-07-11 20:17 ` ✗ CI.BAT: failure " Patchwork
2024-07-11 21:02   ` Michal Wajdeczko
2024-07-12 20:55     ` Lucas De Marchi
2024-07-11 22:48 ` ✗ CI.FULL: " 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=20240712135318.zxhr6gvulkc3qdlk@intel.com \
    --to=piotr.piorkowski@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jonathan.cavitt@intel.com \
    --cc=michal.wajdeczko@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