[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200829110155.70c676520ad2cfef8374171d@kernel.org>
Date: Sat, 29 Aug 2020 11:01:55 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Masami Hiramatsu <mhiramat@...nel.org>
Cc: linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>, Eddy_Wu@...ndmicro.com,
x86@...nel.org, davem@...emloft.net, rostedt@...dmis.org,
naveen.n.rao@...ux.ibm.com, anil.s.keshavamurthy@...el.com,
linux-arch@...r.kernel.org, cameron@...dycamel.com,
oleg@...hat.com, will@...nel.org, paulmck@...nel.org
Subject: Re: [PATCH v4 18/23] sched: Fix try_invoke_on_locked_down_task()
semantics
On Fri, 28 Aug 2020 21:29:55 +0900
Masami Hiramatsu <mhiramat@...nel.org> wrote:
> From: Peter Zijlstra <peterz@...radead.org>
In the next version I will drop this since I will merge the kretprobe_holder
things into removing kretporbe hash patch.
However, this patch itself seems fixing a bug of commit 2beaf3280e57
("sched/core: Add function to sample state of locked-down task").
Peter, could you push this separately?
Thank you,
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> ---
> kernel/sched/core.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 2d95dc3f4644..13b0db2d0be2 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -3006,15 +3006,14 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
> */
> bool try_invoke_on_locked_down_task(struct task_struct *p, bool (*func)(struct task_struct *t, void *arg), void *arg)
> {
> - bool ret = false;
> struct rq_flags rf;
> + bool ret = false;
> struct rq *rq;
>
> - lockdep_assert_irqs_enabled();
> - raw_spin_lock_irq(&p->pi_lock);
> + raw_spin_lock_irqsave(&p->pi_lock, rf.flags);
> if (p->on_rq) {
> rq = __task_rq_lock(p, &rf);
> - if (task_rq(p) == rq)
> + if (task_rq(p) == rq && rq->curr != p)
> ret = func(p, arg);
> rq_unlock(rq, &rf);
> } else {
> @@ -3028,7 +3027,7 @@ bool try_invoke_on_locked_down_task(struct task_struct *p, bool (*func)(struct t
> ret = func(p, arg);
> }
> }
> - raw_spin_unlock_irq(&p->pi_lock);
> + raw_spin_unlock_irqrestore(&p->pi_lock, rf.flags);
> return ret;
> }
>
>
--
Masami Hiramatsu <mhiramat@...nel.org>
Powered by blists - more mailing lists