All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: linux-next: Signed-off-by missing for commit in the rcu tree
Date: Wed, 18 Nov 2020 15:40:49 -0800	[thread overview]
Message-ID: <20201118234049.GA3254@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <20200928173313.GP29330@paulmck-ThinkPad-P72>

On Mon, Sep 28, 2020 at 10:33:13AM -0700, Paul E. McKenney wrote:
> On Mon, Sep 28, 2020 at 09:57:29AM +0200, Peter Zijlstra wrote:
> > On Thu, Sep 17, 2020 at 11:00:05AM -0700, Paul E. McKenney wrote:
> > > On Thu, Sep 17, 2020 at 01:26:52PM +1000, Stephen Rothwell wrote:
> > > > Hi all,
> > > > 
> > > > Commit
> > > > 
> > > >   903c5302fa2d ("sched/core: Allow try_invoke_on_locked_down_task() with irqs disabled")
> > > > 
> > > > is missing a Signed-off-by from its author and committer.
> > > > 
> > > > I didn't complain about this when it was first present because I figured
> > > > it was just a debugging commit that would be removed quickly.  However,
> > > > there are now quite a few follow up commits ...
> > > 
> > > Without Peter's Signed-off-by, I clearly won't be submitting it to the
> > > upcoming merge window.
> > > 
> > > Peter, this is now quite close to your original patch.  May I please
> > > add your Signed-off-by?
> > 
> > Sure!
> 
> Much appreciated!!!
> 
> But I already replaced that commit with one that moves the call to
> try_invoke_on_locked_down_task() an interrupts-enabled region of code.
> Which is probably what I should have done to start with...  :-/

Except that Marco Elver is making that fail, so I am resuscitating your
patch with your Signed-off-by, as shown below.

So once again, much appreciated!!!

							Thanx, Paul

------------------------------------------------------------------------

commit 444ef3bbd0f243b912fdfd51f326704f8ee872bf
Author: Peter Zijlstra <peterz@infradead.org>
Date:   Sat Aug 29 10:22:24 2020 -0700

    sched/core: Allow try_invoke_on_locked_down_task() with irqs disabled
    
    The try_invoke_on_locked_down_task() function currently requires
    that interrupts be enabled, but it is called with interrupts
    disabled from rcu_print_task_stall(), resulting in an "IRQs not
    enabled as expected" diagnostic.  This commit therefore updates
    try_invoke_on_locked_down_task() to use raw_spin_lock_irqsave() instead
    of raw_spin_lock_irq(), thus allowing use from either context.
    
    Link: https://lore.kernel.org/lkml/000000000000903d5805ab908fc4@google.com/
    Link: https://lore.kernel.org/lkml/20200928075729.GC2611@hirez.programming.kicks-ass.net/
    Reported-by: syzbot+cb3b69ae80afd6535b0e@syzkaller.appspotmail.com
    Signed-off-by: Peter Zijlstra <peterz@infradead.org>
    Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index e172f2d..09ef5cf 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2984,7 +2984,7 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
 
 /**
  * try_invoke_on_locked_down_task - Invoke a function on task in fixed state
- * @p: Process for which the function is to be invoked.
+ * @p: Process for which the function is to be invoked, can be @current.
  * @func: Function to invoke.
  * @arg: Argument to function.
  *
@@ -3002,12 +3002,11 @@ 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)
@@ -3024,7 +3023,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;
 }
 

  reply	other threads:[~2020-11-18 23:41 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17  3:26 linux-next: Signed-off-by missing for commit in the rcu tree Stephen Rothwell
2020-09-17 18:00 ` Paul E. McKenney
2020-09-22 22:35   ` Stephen Rothwell
2020-09-28  7:57   ` Peter Zijlstra
2020-09-28 17:33     ` Paul E. McKenney
2020-11-18 23:40       ` Paul E. McKenney [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-02-07 20:39 Stephen Rothwell
2024-02-08 16:07 ` Paul E. McKenney
2023-06-08 22:31 Stephen Rothwell
2023-06-09 19:00 ` Paul E. McKenney
2023-06-08 22:27 Stephen Rothwell
2023-06-08 22:28 ` Stephen Rothwell
2023-06-09  4:08   ` Zhangjin Wu
2023-06-09  9:24     ` Willy Tarreau
2023-05-16 22:41 Stephen Rothwell
2023-05-16 22:54 ` Paul E. McKenney
2023-03-08  2:16 Stephen Rothwell
2023-03-08 17:41 ` Paul E. McKenney
2022-09-22 10:12 Stephen Rothwell
2022-09-22 13:55 ` Paul E. McKenney
2022-01-03 21:38 Stephen Rothwell
2022-01-03 23:33 ` Paul E. McKenney
2021-05-23  3:02 Stephen Rothwell
2021-05-24  3:49 ` Paul E. McKenney
2021-03-08  6:03 Stephen Rothwell
2021-03-09  5:24 ` Paul E. McKenney
2021-01-10  2:24 Stephen Rothwell
2021-01-10  5:15 ` Paul E. McKenney
2020-11-22 10:08 Stephen Rothwell
2020-11-22 10:09 ` Stephen Rothwell
2020-11-22 17:51   ` Paul E. McKenney
2020-09-29 22:37 Stephen Rothwell
2020-09-30  4:43 ` Paul E. McKenney
2020-02-12 22:25 Stephen Rothwell
2020-02-13 21:38 ` Joel Fernandes
2020-02-27 15:10   ` Paul E. McKenney
2019-10-28 20:53 Stephen Rothwell
2019-10-29  0:37 ` Paul E. McKenney
2018-04-23 21:48 Stephen Rothwell
2018-04-23 22:16 ` Paul E. McKenney
2018-02-26 22:38 Stephen Rothwell
2018-02-26 23:22 ` Paul E. McKenney
2017-11-29  0:51 Stephen Rothwell
2017-11-29  1:14 ` Paul E. McKenney
2017-11-29  2:48   ` Lihao Liang
2017-11-29  2:48     ` Lihao Liang
2017-11-29  3:14     ` Hanjun Guo
2017-11-29  3:14       ` Hanjun Guo
2017-11-29  3:29       ` Lihao Liang
2017-11-29  3:29         ` Lihao Liang
2017-11-29 20:54         ` Paul E. McKenney
2017-07-30 13:48 Stephen Rothwell
2017-07-30 16:57 ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201118234049.GA3254@paulmck-ThinkPad-P72 \
    --to=paulmck@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.