Re: [PATCH RFC v6 16/21] dept: Distinguish each work from another

From: Sergey Shtylyov
Date: Wed May 04 2022 - 07:23:56 EST


Hello!

On 5/4/22 11:17 AM, Byungchul Park wrote:

> Workqueue already provides concurrency control. By that, any wait in a
> work doesn't prevents events in other works with the control enabled.
> Thus, each work would better be considered a different context.
>
> So let Dept assign a different context id to each work.
>
> Signed-off-by: Byungchul Park <byungchul.park@xxxxxxx>
[...]
> diff --git a/kernel/dependency/dept.c b/kernel/dependency/dept.c
> index 18e5951..6707313 100644
> --- a/kernel/dependency/dept.c
> +++ b/kernel/dependency/dept.c
> @@ -1844,6 +1844,16 @@ void dept_enirq_transition(unsigned long ip)
> dept_exit(flags);
> }
>
> +/*
> + * Assign a different context id to each work.
> + */
> +void dept_work_enter(void)
> +{
> + struct dept_task *dt = dept_task();
> +
> + dt->cxt_id[DEPT_CXT_PROCESS] += (1UL << DEPT_CXTS_NR);

Parens around << unnecessary...

[...]

MBR, Sergey