Re: [patch V2 37/38] posix-cpu-timers: Move state tracking to struct posix_cputimers

From: Frederic Weisbecker
Date: Mon Aug 26 2019 - 19:28:54 EST


On Wed, Aug 21, 2019 at 09:09:24PM +0200, Thomas Gleixner wrote:
> Put it where it belongs and clean up the ifdeffery in fork completely.
>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> ---
> V2: Adopt to the per clock base struct
> ---
> include/linux/posix-timers.h | 8 ++++
> include/linux/sched/cputime.h | 9 +++--
> include/linux/sched/signal.h | 6 ---
> init/init_task.c | 2 -
> kernel/fork.c | 6 ---
> kernel/time/posix-cpu-timers.c | 73 ++++++++++++++++++++++-------------------
> 6 files changed, 54 insertions(+), 50 deletions(-)
>
> --- a/include/linux/posix-timers.h
> +++ b/include/linux/posix-timers.h
> @@ -77,15 +77,23 @@ struct posix_cputimer_base {
> /**
> * posix_cputimers - Container for posix CPU timer related data
> * @bases: Base container for posix CPU clocks
> + * @timers_active: Timers are queued.
> + * @expiry_active: Timer expiry is active. Used for
> + * process wide timers to avoid multiple
> + * task trying to handle expiry concurrently

So those two fields are also added to struct task_struct but unused there,
right?


> *
> * Used in task_struct and signal_struct
> */
> struct posix_cputimers {
> struct posix_cputimer_base bases[CPUCLOCK_MAX];
> + unsigned int timers_active;
> + unsigned int expiry_active;
> };