[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131004184644.GA17576@redhat.com>
Date: Fri, 4 Oct 2013 20:46:44 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Paul McKenney <paulmck@...ux.vnet.ibm.com>,
Peter Zijlstra <peterz@...radead.org>
Cc: Mel Gorman <mgorman@...e.de>, Rik van Riel <riel@...hat.com>,
Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
Ingo Molnar <mingo@...nel.org>,
Andrea Arcangeli <aarcange@...hat.com>,
Johannes Weiner <hannes@...xchg.org>,
Thomas Gleixner <tglx@...utronix.de>,
Steven Rostedt <rostedt@...dmis.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH 5/5] rcusync: make rcu_sync_enter() return "bool"
Change rcu_sync_enter() to return "need_sync" to let the caller
know whether we did the FAST -> SLOW transition or not.
This is particularly useful in exclusive mode, for example
percpu_down_write() can avoid clear_fast_ctr() if rcu_sync_enter()
returns F.
Signed-off-by: Oleg Nesterov <oleg@...hat.com>
---
include/linux/rcusync.h | 2 +-
kernel/rcusync.c | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/linux/rcusync.h b/include/linux/rcusync.h
index 5689f24..6f4c75b 100644
--- a/include/linux/rcusync.h
+++ b/include/linux/rcusync.h
@@ -37,7 +37,7 @@ enum rcu_sync_type { RCU_SYNC, RCU_SCHED_SYNC, RCU_BH_SYNC };
extern void rcu_sync_init(struct rcu_sync_struct *,
enum rcu_sync_type, bool excl);
-extern void rcu_sync_enter(struct rcu_sync_struct *);
+extern bool rcu_sync_enter(struct rcu_sync_struct *);
extern void rcu_sync_exit(struct rcu_sync_struct *);
extern void rcu_sync_dtor(struct rcu_sync_struct *);
diff --git a/kernel/rcusync.c b/kernel/rcusync.c
index 667eb7d..d03d8e5 100644
--- a/kernel/rcusync.c
+++ b/kernel/rcusync.c
@@ -42,7 +42,7 @@ void rcu_sync_init(struct rcu_sync_struct *rss,
rss->exclusive = excl;
}
-void rcu_sync_enter(struct rcu_sync_struct *rss)
+bool rcu_sync_enter(struct rcu_sync_struct *rss)
{
bool need_wait, need_sync;
@@ -73,6 +73,8 @@ void rcu_sync_enter(struct rcu_sync_struct *rss)
*/
BUG_ON(rss->gp_state != GP_PASSED);
}
+
+ return need_sync;
}
static void rcu_sync_func(struct rcu_head *rcu)
--
1.5.5.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists