mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 12:16:20 +00:00
rcu: Do tiny cleanups in rcutiny
No change in functionality - just straighten out a few small stylistic details. Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: David Howells <dhowells@redhat.com> Cc: Josh Triplett <josh@joshtriplett.org> Cc: laijs@cn.fujitsu.com Cc: dipankar@in.ibm.com Cc: mathieu.desnoyers@polymtl.ca Cc: dvhltc@us.ibm.com Cc: niv@us.ibm.com Cc: peterz@infradead.org Cc: rostedt@goodmis.org Cc: Valdis.Kletnieks@vt.edu Cc: avi@redhat.com Cc: mtosatti@redhat.com LKML-Reference: <12565226351355-git-send-email-> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
cf886c44ec
commit
4ce5b90340
2 changed files with 25 additions and 30 deletions
|
@ -22,7 +22,6 @@
|
||||||
* For detailed explanation of Read-Copy Update mechanism see -
|
* For detailed explanation of Read-Copy Update mechanism see -
|
||||||
* Documentation/RCU
|
* Documentation/RCU
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __LINUX_TINY_H
|
#ifndef __LINUX_TINY_H
|
||||||
#define __LINUX_TINY_H
|
#define __LINUX_TINY_H
|
||||||
|
|
||||||
|
@ -70,8 +69,7 @@ static inline void synchronize_rcu_bh_expedited(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct notifier_block;
|
struct notifier_block;
|
||||||
extern int rcu_cpu_notify(struct notifier_block *self,
|
extern int rcu_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu);
|
||||||
unsigned long action, void *hcpu);
|
|
||||||
|
|
||||||
#ifdef CONFIG_NO_HZ
|
#ifdef CONFIG_NO_HZ
|
||||||
|
|
||||||
|
|
|
@ -22,20 +22,19 @@
|
||||||
* For detailed explanation of Read-Copy Update mechanism see -
|
* For detailed explanation of Read-Copy Update mechanism see -
|
||||||
* Documentation/RCU
|
* Documentation/RCU
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/types.h>
|
|
||||||
#include <linux/kernel.h>
|
|
||||||
#include <linux/init.h>
|
|
||||||
#include <linux/rcupdate.h>
|
|
||||||
#include <linux/interrupt.h>
|
|
||||||
#include <linux/sched.h>
|
|
||||||
#include <linux/module.h>
|
|
||||||
#include <linux/completion.h>
|
|
||||||
#include <linux/moduleparam.h>
|
#include <linux/moduleparam.h>
|
||||||
|
#include <linux/completion.h>
|
||||||
|
#include <linux/interrupt.h>
|
||||||
#include <linux/notifier.h>
|
#include <linux/notifier.h>
|
||||||
#include <linux/cpu.h>
|
#include <linux/rcupdate.h>
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/module.h>
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
|
#include <linux/sched.h>
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include <linux/init.h>
|
||||||
#include <linux/time.h>
|
#include <linux/time.h>
|
||||||
|
#include <linux/cpu.h>
|
||||||
|
|
||||||
/* Global control variables for rcupdate callback mechanism. */
|
/* Global control variables for rcupdate callback mechanism. */
|
||||||
struct rcu_ctrlblk {
|
struct rcu_ctrlblk {
|
||||||
|
@ -46,12 +45,11 @@ struct rcu_ctrlblk {
|
||||||
|
|
||||||
/* Definition for rcupdate control block. */
|
/* Definition for rcupdate control block. */
|
||||||
static struct rcu_ctrlblk rcu_ctrlblk = {
|
static struct rcu_ctrlblk rcu_ctrlblk = {
|
||||||
.rcucblist = NULL,
|
|
||||||
.donetail = &rcu_ctrlblk.rcucblist,
|
.donetail = &rcu_ctrlblk.rcucblist,
|
||||||
.curtail = &rcu_ctrlblk.rcucblist,
|
.curtail = &rcu_ctrlblk.rcucblist,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct rcu_ctrlblk rcu_bh_ctrlblk = {
|
static struct rcu_ctrlblk rcu_bh_ctrlblk = {
|
||||||
.rcucblist = NULL,
|
|
||||||
.donetail = &rcu_bh_ctrlblk.rcucblist,
|
.donetail = &rcu_bh_ctrlblk.rcucblist,
|
||||||
.curtail = &rcu_bh_ctrlblk.rcucblist,
|
.curtail = &rcu_bh_ctrlblk.rcucblist,
|
||||||
};
|
};
|
||||||
|
@ -84,8 +82,8 @@ void rcu_exit_nohz(void)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Helper function for rcu_qsctr_inc() and rcu_bh_qsctr_inc().
|
* Helper function for rcu_qsctr_inc() and rcu_bh_qsctr_inc().
|
||||||
* Also disable irqs to avoid confusion due to interrupt handlers invoking
|
* Also disable irqs to avoid confusion due to interrupt handlers
|
||||||
* call_rcu().
|
* invoking call_rcu().
|
||||||
*/
|
*/
|
||||||
static int rcu_qsctr_help(struct rcu_ctrlblk *rcp)
|
static int rcu_qsctr_help(struct rcu_ctrlblk *rcp)
|
||||||
{
|
{
|
||||||
|
@ -99,6 +97,7 @@ static int rcu_qsctr_help(struct rcu_ctrlblk *rcp)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
local_irq_restore(flags);
|
local_irq_restore(flags);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,8 +142,8 @@ void rcu_check_callbacks(int cpu, int user)
|
||||||
*/
|
*/
|
||||||
static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp)
|
static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
|
||||||
struct rcu_head *next, *list;
|
struct rcu_head *next, *list;
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
/* If no RCU callbacks ready to invoke, just return. */
|
/* If no RCU callbacks ready to invoke, just return. */
|
||||||
if (&rcp->rcucblist == rcp->donetail)
|
if (&rcp->rcucblist == rcp->donetail)
|
||||||
|
@ -182,8 +181,7 @@ static void rcu_process_callbacks(struct softirq_action *unused)
|
||||||
* Null function to handle CPU being onlined. Longer term, we want to
|
* Null function to handle CPU being onlined. Longer term, we want to
|
||||||
* make TINY_RCU avoid using rcupdate.c, but later...
|
* make TINY_RCU avoid using rcupdate.c, but later...
|
||||||
*/
|
*/
|
||||||
int rcu_cpu_notify(struct notifier_block *self,
|
int rcu_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu)
|
||||||
unsigned long action, void *hcpu)
|
|
||||||
{
|
{
|
||||||
return NOTIFY_OK;
|
return NOTIFY_OK;
|
||||||
}
|
}
|
||||||
|
@ -223,6 +221,7 @@ static void __call_rcu(struct rcu_head *head,
|
||||||
|
|
||||||
head->func = func;
|
head->func = func;
|
||||||
head->next = NULL;
|
head->next = NULL;
|
||||||
|
|
||||||
local_irq_save(flags);
|
local_irq_save(flags);
|
||||||
*rcp->curtail = head;
|
*rcp->curtail = head;
|
||||||
rcp->curtail = &head->next;
|
rcp->curtail = &head->next;
|
||||||
|
@ -234,8 +233,7 @@ static void __call_rcu(struct rcu_head *head,
|
||||||
* period. But since we have but one CPU, that would be after any
|
* period. But since we have but one CPU, that would be after any
|
||||||
* quiescent state.
|
* quiescent state.
|
||||||
*/
|
*/
|
||||||
void call_rcu(struct rcu_head *head,
|
void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu))
|
||||||
void (*func)(struct rcu_head *rcu))
|
|
||||||
{
|
{
|
||||||
__call_rcu(head, func, &rcu_ctrlblk);
|
__call_rcu(head, func, &rcu_ctrlblk);
|
||||||
}
|
}
|
||||||
|
@ -245,8 +243,7 @@ EXPORT_SYMBOL_GPL(call_rcu);
|
||||||
* Post an RCU bottom-half callback to be invoked after any subsequent
|
* Post an RCU bottom-half callback to be invoked after any subsequent
|
||||||
* quiescent state.
|
* quiescent state.
|
||||||
*/
|
*/
|
||||||
void call_rcu_bh(struct rcu_head *head,
|
void call_rcu_bh(struct rcu_head *head, void (*func)(struct rcu_head *rcu))
|
||||||
void (*func)(struct rcu_head *rcu))
|
|
||||||
{
|
{
|
||||||
__call_rcu(head, func, &rcu_bh_ctrlblk);
|
__call_rcu(head, func, &rcu_bh_ctrlblk);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue