lkml.org 
[lkml]   [2022]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH RFC v6 16/21] dept: Distinguish each work from another
From
Date
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@lge.com>
[...]
> 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

\
 
 \ /
  Last update: 2022-05-04 13:24    [W:0.288 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site