lkml.org 
[lkml]   [2022]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 21/21] rcu/context_tracking: Merge dynticks counter and context tracking states
From
Date
On Tue, 2022-05-03 at 12:00 +0200, Frederic Weisbecker wrote:

[...]

> diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h
> index edd9f8f5b753..0841435620cf 100644
> --- a/include/linux/context_tracking_state.h
> +++ b/include/linux/context_tracking_state.h
> @@ -10,12 +10,20 @@
> #define DYNTICK_IRQ_NONIDLE ((LONG_MAX / 2) + 1)
>
> enum ctx_state {
> - CONTEXT_DISABLED = -1, /* returned by ct_state() if unknown */
> - CONTEXT_KERNEL = 0,
> - CONTEXT_USER,
> - CONTEXT_GUEST,
> + CONTEXT_DISABLED = -1, /* returned by ct_state() if unknown */
> + CONTEXT_KERNEL = 0,
> + CONTEXT_IDLE = 1,
> + CONTEXT_USER = 2,
> + CONTEXT_GUEST = 3,
> + CONTEXT_MAX = 4,
> };
>
> +/* Even value for idle, else odd. */
> +#define RCU_DYNTICKS_IDX CONTEXT_MAX
> +
> +#define CT_STATE_MASK (CONTEXT_MAX - 1)
> +#define CT_DYNTICKS_MASK (~CT_STATE_MASK)

Nit: These macros only work as long as we don't introduce new contexts. It's
maybe worth a comment.

Regards,

--
Nicolás Sáenz

\
 
 \ /
  Last update: 2022-05-18 17:33    [W:0.237 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site