linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Juri Lelli <juri.lelli@redhat.com>,
	peterx@redhat.com, Marcelo Tosatti <mtosatti@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>
Subject: [PATCH v2 3/3] sched: Remove rq.hrtick_csd_pending
Date: Mon, 16 Dec 2019 16:31:25 -0500	[thread overview]
Message-ID: <20191216213125.9536-4-peterx@redhat.com> (raw)
In-Reply-To: <20191216213125.9536-1-peterx@redhat.com>

Now smp_call_function_single_async() provides the protection that
we'll return with -EBUSY if the csd object is still pending, then we
don't need the rq.hrtick_csd_pending any more.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 kernel/sched/core.c  | 9 ++-------
 kernel/sched/sched.h | 1 -
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 44123b4d14e8..ef527545d349 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -268,7 +268,6 @@ static void __hrtick_start(void *arg)
 
 	rq_lock(rq, &rf);
 	__hrtick_restart(rq);
-	rq->hrtick_csd_pending = 0;
 	rq_unlock(rq, &rf);
 }
 
@@ -292,12 +291,10 @@ void hrtick_start(struct rq *rq, u64 delay)
 
 	hrtimer_set_expires(timer, time);
 
-	if (rq == this_rq()) {
+	if (rq == this_rq())
 		__hrtick_restart(rq);
-	} else if (!rq->hrtick_csd_pending) {
+	else
 		smp_call_function_single_async(cpu_of(rq), &rq->hrtick_csd);
-		rq->hrtick_csd_pending = 1;
-	}
 }
 
 #else
@@ -321,8 +318,6 @@ void hrtick_start(struct rq *rq, u64 delay)
 static void hrtick_rq_init(struct rq *rq)
 {
 #ifdef CONFIG_SMP
-	rq->hrtick_csd_pending = 0;
-
 	rq->hrtick_csd.flags = 0;
 	rq->hrtick_csd.func = __hrtick_start;
 	rq->hrtick_csd.info = rq;
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index c8870c5bd7df..79b435bbe129 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -967,7 +967,6 @@ struct rq {
 
 #ifdef CONFIG_SCHED_HRTICK
 #ifdef CONFIG_SMP
-	int			hrtick_csd_pending;
 	call_single_data_t	hrtick_csd;
 #endif
 	struct hrtimer		hrtick_timer;
-- 
2.23.0


  parent reply	other threads:[~2019-12-16 21:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16 21:31 [PATCH v2 0/3] smp: Allow smp_call_function_single_async() to insert locked csd Peter Xu
2019-12-16 21:31 ` [PATCH v2 1/3] " Peter Xu
2020-03-06 14:42   ` [tip: smp/core] " tip-bot2 for Peter Xu
2019-12-16 21:31 ` [PATCH v2 2/3] MIPS: smp: Remove tick_broadcast_count Peter Xu
2020-03-06 14:42   ` [tip: smp/core] " tip-bot2 for Peter Xu
2019-12-16 21:31 ` Peter Xu [this message]
2020-03-06 14:42   ` [tip: smp/core] sched/core: Remove rq.hrtick_csd_pending tip-bot2 for Peter Xu
2020-01-06 16:40 ` [PATCH v2 0/3] smp: Allow smp_call_function_single_async() to insert locked csd Peter Xu
2020-02-17 16:04 ` Peter Xu

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=20191216213125.9536-4-peterx@redhat.com \
    --to=peterx@redhat.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).