Carregando o restante desta comparação.

Diff_tree_c_6414_65RC1

Criado O diff nunca expira
0 remoções
736 linhas
0 adições
736 linhas
// SPDX-License-Identifier: GPL-2.0+
// SPDX-License-Identifier: GPL-2.0+
/*
/*
* Read-Copy Update mechanism for mutual exclusion (tree-based version)
* Read-Copy Update mechanism for mutual exclusion (tree-based version)
*
*
* Copyright IBM Corporation, 2008
* Copyright IBM Corporation, 2008
*
*
* Authors: Dipankar Sarma <dipankar@in.ibm.com>
* Authors: Dipankar Sarma <dipankar@in.ibm.com>
* Manfred Spraul <manfred@colorfullife.com>
* Manfred Spraul <manfred@colorfullife.com>
* Paul E. McKenney <paulmck@linux.ibm.com>
* Paul E. McKenney <paulmck@linux.ibm.com>
*
*
* Based on the original work by Paul McKenney <paulmck@linux.ibm.com>
* Based on the original work by Paul McKenney <paulmck@linux.ibm.com>
* and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen.
* and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen.
*
*
* For detailed explanation of Read-Copy Update mechanism see -
* For detailed explanation of Read-Copy Update mechanism see -
* Documentation/RCU
* Documentation/RCU
*/
*/


#define pr_fmt(fmt) "rcu: " fmt
#define pr_fmt(fmt) "rcu: " fmt


#include <linux/types.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/spinlock.h>
#include <linux/smp.h>
#include <linux/smp.h>
#include <linux/rcupdate_wait.h>
#include <linux/rcupdate_wait.h>
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/sched/debug.h>
#include <linux/sched/debug.h>
#include <linux/nmi.h>
#include <linux/nmi.h>
#include <linux/atomic.h>
#include <linux/atomic.h>
#include <linux/bitops.h>
#include <linux/bitops.h>
#include <linux/export.h>
#include <linux/export.h>
#include <linux/completion.h>
#include <linux/completion.h>
#include <linux/moduleparam.h>
#include <linux/moduleparam.h>
#include <linux/panic.h>
#include <linux/panic.h>
#include <linux/panic_notifier.h>
#include <linux/panic_notifier.h>
#include <linux/percpu.h>
#include <linux/percpu.h>
#include <linux/notifier.h>
#include <linux/notifier.h>
#include <linux/cpu.h>
#include <linux/cpu.h>
#include <linux/mutex.h>
#include <linux/mutex.h>
#include <linux/time.h>
#include <linux/time.h>
#include <linux/kernel_stat.h>
#include <linux/kernel_stat.h>
#include <linux/wait.h>
#include <linux/wait.h>
#include <linux/kthread.h>
#include <linux/kthread.h>
#include <uapi/linux/sched/types.h>
#include <uapi/linux/sched/types.h>
#include <linux/prefetch.h>
#include <linux/prefetch.h>
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/random.h>
#include <linux/random.h>
#include <linux/trace_events.h>
#include <linux/trace_events.h>
#include <linux/suspend.h>
#include <linux/suspend.h>
#include <linux/ftrace.h>
#include <linux/ftrace.h>
#include <linux/tick.h>
#include <linux/tick.h>
#include <linux/sysrq.h>
#include <linux/sysrq.h>
#include <linux/kprobes.h>
#include <linux/kprobes.h>
#include <linux/gfp.h>
#include <linux/gfp.h>
#include <linux/oom.h>
#include <linux/oom.h>
#include <linux/smpboot.h>
#include <linux/smpboot.h>
#include <linux/jiffies.h>
#include <linux/jiffies.h>
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/sched/isolation.h>
#include <linux/sched/isolation.h>
#include <linux/sched/clock.h>
#include <linux/sched/clock.h>
#include <linux/vmalloc.h>
#include <linux/vmalloc.h>
#include <linux/mm.h>
#include <linux/mm.h>
#include <linux/kasan.h>
#include <linux/kasan.h>
#include <linux/context_tracking.h>
#include <linux/context_tracking.h>
#include "../time/tick-internal.h"
#include "../time/tick-internal.h"


#include "tree.h"
#include "tree.h"
#include "rcu.h"
#include "rcu.h"


#ifdef MODULE_PARAM_PREFIX
#ifdef MODULE_PARAM_PREFIX
#undef MODULE_PARAM_PREFIX
#undef MODULE_PARAM_PREFIX
#endif
#endif
#define MODULE_PARAM_PREFIX "rcutree."
#define MODULE_PARAM_PREFIX "rcutree."


/* Data structures. */
/* Data structures. */


static DEFINE_PER_CPU_SHARED_ALIGNED(struct rcu_data, rcu_data) = {
static DEFINE_PER_CPU_SHARED_ALIGNED(struct rcu_data, rcu_data) = {
.gpwrap = true,
.gpwrap = true,
#ifdef CONFIG_RCU_NOCB_CPU
#ifdef CONFIG_RCU_NOCB_CPU
.cblist.flags = SEGCBLIST_RCU_CORE,
.cblist.flags = SEGCBLIST_RCU_CORE,
#endif
#endif
};
};
static struct rcu_state rcu_state = {
static struct rcu_state rcu_state = {
.level = { &rcu_state.node[0] },
.level = { &rcu_state.node[0] },
.gp_state = RCU_GP_IDLE,
.gp_state = RCU_GP_IDLE,
.gp_seq = (0UL - 300UL) << RCU_SEQ_CTR_SHIFT,
.gp_seq = (0UL - 300UL) << RCU_SEQ_CTR_SHIFT,
.barrier_mutex = __MUTEX_INITIALIZER(rcu_state.barrier_mutex),
.barrier_mutex = __MUTEX_INITIALIZER(rcu_state.barrier_mutex),
.barrier_lock = __RAW_SPIN_LOCK_UNLOCKED(rcu_state.barrier_lock),
.barrier_lock = __RAW_SPIN_LOCK_UNLOCKED(rcu_state.barrier_lock),
.name = RCU_NAME,
.name = RCU_NAME,
.abbr = RCU_ABBR,
.abbr = RCU_ABBR,
.exp_mutex = __MUTEX_INITIALIZER(rcu_state.exp_mutex),
.exp_mutex = __MUTEX_INITIALIZER(rcu_state.exp_mutex),
.exp_wake_mutex = __MUTEX_INITIALIZER(rcu_state.exp_wake_mutex),
.exp_wake_mutex = __MUTEX_INITIALIZER(rcu_state.exp_wake_mutex),
.ofl_lock = __ARCH_SPIN_LOCK_UNLOCKED,
.ofl_lock = __ARCH_SPIN_LOCK_UNLOCKED,
};
};


/* Dump rcu_node combining tree at boot to verify correct setup. */
/* Dump rcu_node combining tree at boot to verify correct setup. */
static bool dump_tree;
static bool dump_tree;
module_param(dump_tree, bool, 0444);
module_param(dump_tree, bool, 0444);
/* By default, use RCU_SOFTIRQ instead of rcuc kthreads. */
/* By default, use RCU_SOFTIRQ instead of rcuc kthreads. */