[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240313170324.GC25452@redhat.com>
Date: Wed, 13 Mar 2024 18:03:24 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Sasha Levin <sashal@...nel.org>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Dylan Hatch <dylanbhatch@...gle.com>,
"Eric W . Biederman" <ebiederm@...ssion.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 5.10 65/73] exit: wait_task_zombie: kill the no longer
necessary spin_lock_irq(siglock)
I do not know what does 5.10 mean. Does this tree has all the changes
this patch depends on? Say, 1df4bd83cdfdbd0720dd ("do_io_accounting:
use sig->stats_lock") ?
In any case please remove this patch from all your queues, it got the
"stable" tag by mistake.
Oleg.
On 03/13, Sasha Levin wrote:
>
> From: Oleg Nesterov <oleg@...hat.com>
>
> [ Upstream commit c1be35a16b2f1fe21f4f26f9de030ad6eaaf6a25 ]
>
> After the recent changes nobody use siglock to read the values protected
> by stats_lock, we can kill spin_lock_irq(¤t->sighand->siglock) and
> update the comment.
>
> With this patch only __exit_signal() and thread_group_start_cputime() take
> stats_lock under siglock.
>
> Link: https://lkml.kernel.org/r/20240123153359.GA21866@redhat.com
> Signed-off-by: Oleg Nesterov <oleg@...hat.com>
> Signed-off-by: Dylan Hatch <dylanbhatch@...gle.com>
> Cc: Eric W. Biederman <ebiederm@...ssion.com>
> Cc: <stable@...r.kernel.org>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> Signed-off-by: Sasha Levin <sashal@...nel.org>
> ---
> kernel/exit.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/kernel/exit.c b/kernel/exit.c
> index c41bdc0a7f06b..8f25abdd5fa7d 100644
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -1106,17 +1106,14 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p)
> * and nobody can change them.
> *
> * psig->stats_lock also protects us from our sub-threads
> - * which can reap other children at the same time. Until
> - * we change k_getrusage()-like users to rely on this lock
> - * we have to take ->siglock as well.
> + * which can reap other children at the same time.
> *
> * We use thread_group_cputime_adjusted() to get times for
> * the thread group, which consolidates times for all threads
> * in the group including the group leader.
> */
> thread_group_cputime_adjusted(p, &tgutime, &tgstime);
> - spin_lock_irq(¤t->sighand->siglock);
> - write_seqlock(&psig->stats_lock);
> + write_seqlock_irq(&psig->stats_lock);
> psig->cutime += tgutime + sig->cutime;
> psig->cstime += tgstime + sig->cstime;
> psig->cgtime += task_gtime(p) + sig->gtime + sig->cgtime;
> @@ -1139,8 +1136,7 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p)
> psig->cmaxrss = maxrss;
> task_io_accounting_add(&psig->ioac, &p->ioac);
> task_io_accounting_add(&psig->ioac, &sig->ioac);
> - write_sequnlock(&psig->stats_lock);
> - spin_unlock_irq(¤t->sighand->siglock);
> + write_sequnlock_irq(&psig->stats_lock);
> }
>
> if (wo->wo_rusage)
> --
> 2.43.0
>
Powered by blists - more mailing lists