lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <49777292-dbfb-2164-6932-849a8ad96b7c@amd.com>
Date: Tue, 11 Feb 2025 08:40:33 -0800
From: Lizhi Hou <lizhi.hou@....com>
To: Philipp Stanner <phasta@...nel.org>, Min Ma <min.ma@....com>, Oded Gabbay
	<ogabbay@...nel.org>, Alex Deucher <alexander.deucher@....com>,
	Christian König <christian.koenig@....com>, Xinhui Pan
	<Xinhui.Pan@....com>, David Airlie <airlied@...il.com>, Simona Vetter
	<simona@...ll.ch>, Lucas Stach <l.stach@...gutronix.de>, Russell King
	<linux+etnaviv@...linux.org.uk>, Christian Gmeiner
	<christian.gmeiner@...il.com>, Frank Binns <frank.binns@...tec.com>, "Matt
 Coster" <matt.coster@...tec.com>, Maarten Lankhorst
	<maarten.lankhorst@...ux.intel.com>, Maxime Ripard <mripard@...nel.org>,
	Thomas Zimmermann <tzimmermann@...e.de>, Qiang Yu <yuq825@...il.com>, "Rob
 Clark" <robdclark@...il.com>, Sean Paul <sean@...rly.run>, Konrad Dybcio
	<konradybcio@...nel.org>, Abhinav Kumar <quic_abhinavk@...cinc.com>, "Dmitry
 Baryshkov" <dmitry.baryshkov@...aro.org>, Marijn Suijten
	<marijn.suijten@...ainline.org>, Karol Herbst <kherbst@...hat.com>, "Lyude
 Paul" <lyude@...hat.com>, Danilo Krummrich <dakr@...hat.com>, Boris Brezillon
	<boris.brezillon@...labora.com>, Rob Herring <robh@...nel.org>, Steven Price
	<steven.price@....com>, Liviu Dudau <liviu.dudau@....com>, Matthew Brost
	<matthew.brost@...el.com>, Melissa Wen <mwen@...lia.com>,
	Maíra Canal <mcanal@...lia.com>, Lucas De Marchi
	<lucas.demarchi@...el.com>, Thomas Hellström
	<thomas.hellstrom@...ux.intel.com>, Rodrigo Vivi <rodrigo.vivi@...el.com>,
	Sunil Khatri <sunil.khatri@....com>, Lijo Lazar <lijo.lazar@....com>,
	"Hawking Zhang" <Hawking.Zhang@....com>, Mario Limonciello
	<mario.limonciello@....com>, Ma Jun <Jun.Ma2@....com>, Yunxiang Li
	<Yunxiang.Li@....com>
CC: <dri-devel@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>,
	<amd-gfx@...ts.freedesktop.org>, <etnaviv@...ts.freedesktop.org>,
	<lima@...ts.freedesktop.org>, <linux-arm-msm@...r.kernel.org>,
	<freedreno@...ts.freedesktop.org>, <nouveau@...ts.freedesktop.org>,
	<intel-xe@...ts.freedesktop.org>, Christian Gmeiner <cgmeiner@...lia.com>,
	Tvrtko Ursulin <tvrtko.ursulin@...lia.com>
Subject: Re: [PATCH v4] drm/sched: Use struct for drm_sched_init() params


On 2/11/25 03:14, Philipp Stanner wrote:
> drm_sched_init() has a great many parameters and upcoming new
> functionality for the scheduler might add even more. Generally, the
> great number of parameters reduces readability and has already caused
> one missnaming, addressed in:
>
> commit 6f1cacf4eba7 ("drm/nouveau: Improve variable name in
> nouveau_sched_init()").
>
> Introduce a new struct for the scheduler init parameters and port all
> users.
>
> Signed-off-by: Philipp Stanner<phasta@...nel.org>
> Reviewed-by: Liviu Dudau<liviu.dudau@....com>
> Acked-by: Matthew Brost<matthew.brost@...el.com>  # for Xe
> Reviewed-by: Boris Brezillon<boris.brezillon@...labora.com>  # for Panfrost and Panthor
> Reviewed-by: Christian Gmeiner<cgmeiner@...lia.com>  # for Etnaviv
> Reviewed-by: Frank Binns<frank.binns@...tec.com>  # for Imagination
> Reviewed-by: Tvrtko Ursulin<tvrtko.ursulin@...lia.com>  # for Sched
> Reviewed-by: Maíra Canal<mcanal@...lia.com>  # for v3d
> ---
> Changes in v4:
>    - Add forgotten driver accel/amdxdna. (Me)
>    - Rephrase the "init to NULL" comments. (Tvrtko)
>    - Apply RBs by Tvrtko and Maira.
>    - Terminate the last struct members with a comma, so that future
>      fields can be added with a minimal patch diff. (Me)
>
> Changes in v3:
>    - Various formatting requirements.
>
> Changes in v2:
>    - Point out that the hang-limit is deprecated. (Christian)
>    - Initialize the structs to 0 at declaration. (Planet Earth)
>    - Don't set stuff explicitly to 0 / NULL. (Tvrtko)
>    - Make the structs const where possible. (Boris)
>    - v3d: Use just 1, universal, function for sched-init. (Maíra)
> ---
>   drivers/accel/amdxdna/aie2_ctx.c           | 12 +++-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 18 ++++--
>   drivers/gpu/drm/etnaviv/etnaviv_sched.c    | 20 +++----
>   drivers/gpu/drm/imagination/pvr_queue.c    | 18 ++++--
>   drivers/gpu/drm/lima/lima_sched.c          | 16 ++++--
>   drivers/gpu/drm/msm/msm_ringbuffer.c       | 17 +++---
>   drivers/gpu/drm/nouveau/nouveau_sched.c    | 16 ++++--
>   drivers/gpu/drm/panfrost/panfrost_job.c    | 20 ++++---
>   drivers/gpu/drm/panthor/panthor_mmu.c      | 16 ++++--
>   drivers/gpu/drm/panthor/panthor_sched.c    | 28 ++++++----
>   drivers/gpu/drm/scheduler/sched_main.c     | 50 ++++++-----------
>   drivers/gpu/drm/v3d/v3d_sched.c            | 65 +++++++++-------------
>   drivers/gpu/drm/xe/xe_execlist.c           | 15 +++--
>   drivers/gpu/drm/xe/xe_gpu_scheduler.c      | 17 +++++-
>   include/drm/gpu_scheduler.h                | 36 ++++++++++--
>   15 files changed, 210 insertions(+), 154 deletions(-)
>
> diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c
> index 2799729801f6..8ac01bc2f0db 100644
> --- a/drivers/accel/amdxdna/aie2_ctx.c
> +++ b/drivers/accel/amdxdna/aie2_ctx.c
> @@ -516,6 +516,14 @@ int aie2_hwctx_init(struct amdxdna_hwctx *hwctx)
>   {
>   	struct amdxdna_client *client = hwctx->client;
>   	struct amdxdna_dev *xdna = client->xdna;
> +	const struct drm_sched_init_args args = {
> +		.ops = &sched_ops,
> +		.num_rqs = DRM_SCHED_PRIORITY_COUNT,
> +		.credit_limit = HWCTX_MAX_CMDS,
> +		.timeout = msecs_to_jiffies(HWCTX_MAX_TIMEOUT),
> +		.name = hwctx->name,
> +		.dev = xdna->ddev.dev,
> +	};
>   	struct drm_gpu_scheduler *sched;
>   	struct amdxdna_hwctx_priv *priv;
>   	struct amdxdna_gem_obj *heap;
> @@ -573,9 +581,7 @@ int aie2_hwctx_init(struct amdxdna_hwctx *hwctx)
>   	might_lock(&priv->io_lock);
>   	fs_reclaim_release(GFP_KERNEL);
>   
> -	ret = drm_sched_init(sched, &sched_ops, NULL, DRM_SCHED_PRIORITY_COUNT,
> -			     HWCTX_MAX_CMDS, 0, msecs_to_jiffies(HWCTX_MAX_TIMEOUT),
> -			     NULL, NULL, hwctx->name, xdna->ddev.dev);
> +	ret = drm_sched_init(sched, &args);
Reviewed-by: Lizhi Hou <lizhi.hou@....com>
>   	if (ret) {
>   		XDNA_ERR(xdna, "Failed to init DRM scheduler. ret %d", ret);
>   		goto free_cmd_bufs;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ