cregit-Linux how code gets into the kernel

Release 4.7 include/linux/cpuset.h

Directory: include/linux
#ifndef _LINUX_CPUSET_H

#define _LINUX_CPUSET_H
/*
 *  cpuset interface
 *
 *  Copyright (C) 2003 BULL SA
 *  Copyright (C) 2004-2006 Silicon Graphics, Inc.
 *
 */

#include <linux/sched.h>
#include <linux/cpumask.h>
#include <linux/nodemask.h>
#include <linux/mm.h>
#include <linux/jump_label.h>

#ifdef CONFIG_CPUSETS

extern struct static_key_false cpusets_enabled_key;

static inline bool cpusets_enabled(void) { return static_branch_unlikely(&cpusets_enabled_key); }

Contributors

PersonTokensPropCommitsCommitProp
mel gormanmel gorman1593.75%150.00%
vlastimil babkavlastimil babka16.25%150.00%
Total16100.00%2100.00%


static inline int nr_cpusets(void) { /* jump label reference count + the top-level cpuset */ return static_key_count(&cpusets_enabled_key.key) + 1; }

Contributors

PersonTokensPropCommitsCommitProp
mel gormanmel gorman1990.48%150.00%
vlastimil babkavlastimil babka29.52%150.00%
Total21100.00%2100.00%


static inline void cpuset_inc(void) { static_branch_inc(&cpusets_enabled_key); }

Contributors

PersonTokensPropCommitsCommitProp
mel gormanmel gorman1493.33%150.00%
vlastimil babkavlastimil babka16.67%150.00%
Total15100.00%2100.00%


static inline void cpuset_dec(void) { static_branch_dec(&cpusets_enabled_key); }

Contributors

PersonTokensPropCommitsCommitProp
mel gormanmel gorman1493.33%150.00%
vlastimil babkavlastimil babka16.67%150.00%
Total15100.00%2100.00%

extern int cpuset_init(void); extern void cpuset_init_smp(void); extern void cpuset_update_active_cpus(bool cpu_online); extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask); extern void cpuset_cpus_allowed_fallback(struct task_struct *p); extern nodemask_t cpuset_mems_allowed(struct task_struct *p); #define cpuset_current_mems_allowed (current->mems_allowed) void cpuset_init_current_mems_allowed(void); int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask); extern bool __cpuset_node_allowed(int node, gfp_t gfp_mask);
static inline bool cpuset_node_allowed(int node, gfp_t gfp_mask) { if (cpusets_enabled()) return __cpuset_node_allowed(node, gfp_mask); return true; }

Contributors

PersonTokensPropCommitsCommitProp
david rientjesdavid rientjes1551.72%120.00%
vlastimil babkavlastimil babka931.03%120.00%
paul jacksonpaul jackson26.90%120.00%
vladimir davydovvladimir davydov26.90%120.00%
mel gormanmel gorman13.45%120.00%
Total29100.00%5100.00%


static inline bool __cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) { return __cpuset_node_allowed(zone_to_nid(z), gfp_mask); }

Contributors

PersonTokensPropCommitsCommitProp
paul jacksonpaul jackson2076.92%133.33%
david rientjesdavid rientjes311.54%133.33%
vlastimil babkavlastimil babka311.54%133.33%
Total26100.00%3100.00%


static inline bool cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) { if (cpusets_enabled()) return __cpuset_zone_allowed(z, gfp_mask); return true; }

Contributors

PersonTokensPropCommitsCommitProp
vlastimil babkavlastimil babka31100.00%1100.00%
Total31100.00%1100.00%

extern int cpuset_mems_allowed_intersects(const struct task_struct *tsk1, const struct task_struct *tsk2); #define cpuset_memory_pressure_bump() \ do { \ if (cpuset_memory_pressure_enabled) \ __cpuset_memory_pressure_bump(); \ } while (0) extern int cpuset_memory_pressure_enabled; extern void __cpuset_memory_pressure_bump(void); extern void cpuset_task_status_allowed(struct seq_file *m, struct task_struct *task); extern int proc_cpuset_show(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *tsk); extern int cpuset_mem_spread_node(void); extern int cpuset_slab_spread_node(void);
static inline int cpuset_do_page_mem_spread(void) { return task_spread_page(current); }

Contributors

PersonTokensPropCommitsCommitProp
paul jacksonpaul jackson1280.00%150.00%
li zefanli zefan320.00%150.00%
Total15100.00%2100.00%


static inline int cpuset_do_slab_mem_spread(void) { return task_spread_slab(current); }

Contributors

PersonTokensPropCommitsCommitProp
paul jacksonpaul jackson1280.00%150.00%
li zefanli zefan320.00%150.00%
Total15100.00%2100.00%

extern int current_cpuset_is_being_rebound(void); extern void rebuild_sched_domains(void); extern void cpuset_print_current_mems_allowed(void); /* * read_mems_allowed_begin is required when making decisions involving * mems_allowed such as during page allocation. mems_allowed can be updated in * parallel and depending on the new value an operation can fail potentially * causing process failure. A retry loop with read_mems_allowed_begin and * read_mems_allowed_retry prevents these artificial failures. */
static inline unsigned int read_mems_allowed_begin(void) { if (!cpusets_enabled()) return 0; return read_seqcount_begin(&current->mems_allowed_seq); }

Contributors

PersonTokensPropCommitsCommitProp
mel gormanmel gorman1967.86%375.00%
miao xiemiao xie932.14%125.00%
Total28100.00%4100.00%

/* * If this returns true, the operation that took place after * read_mems_allowed_begin may have failed artificially due to a concurrent * update of mems_allowed. It is up to the caller to retry the operation if * appropriate. */
static inline bool read_mems_allowed_retry(unsigned int seq) { if (!cpusets_enabled()) return false; return read_seqcount_retry(&current->mems_allowed_seq, seq); }

Contributors

PersonTokensPropCommitsCommitProp
mel gormanmel gorman2167.74%375.00%
miao xiemiao xie1032.26%125.00%
Total31100.00%4100.00%


static inline void set_mems_allowed(nodemask_t nodemask) { unsigned long flags; task_lock(current); local_irq_save(flags); write_seqcount_begin(&current->mems_allowed_seq); current->mems_allowed = nodemask; write_seqcount_end(&current->mems_allowed_seq); local_irq_restore(flags); task_unlock(current); }

Contributors

PersonTokensPropCommitsCommitProp
miao xiemiao xie2035.71%240.00%
mel gormanmel gorman1628.57%120.00%
john stultzjohn stultz1425.00%120.00%
paul jacksonpaul jackson610.71%120.00%
Total56100.00%5100.00%

#else /* !CONFIG_CPUSETS */
static inline bool cpusets_enabled(void) { return false; }

Contributors

PersonTokensPropCommitsCommitProp
mel gormanmel gorman12100.00%1100.00%
Total12100.00%1100.00%


static inline int cpuset_init(void) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
paul jacksonpaul jackson12100.00%1100.00%
Total12100.00%1100.00%


static inline void cpuset_init_smp(void) {}

Contributors

PersonTokensPropCommitsCommitProp
paul jacksonpaul jackson8100.00%1100.00%
Total8100.00%1100.00%


static inline void cpuset_update_active_cpus(bool cpu_online) { partition_sched_domains(1, NULL, NULL); }

Contributors

PersonTokensPropCommitsCommitProp
tejun heotejun heo1789.47%150.00%
srivatsa s. bhatsrivatsa s. bhat210.53%150.00%
Total19100.00%2100.00%


static inline void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask) { cpumask_copy(mask, cpu_possible_mask); }

Contributors

PersonTokensPropCommitsCommitProp
paul jacksonpaul jackson1145.83%125.00%
mike travismike travis625.00%125.00%
rusty russellrusty russell520.83%125.00%
li zefanli zefan28.33%125.00%
Total24100.00%4100.00%


static inline void cpuset_cpus_allowed_fallback(struct task_struct *p) { }

Contributors

PersonTokensPropCommitsCommitProp
oleg nesterovoleg nesterov981.82%150.00%
peter zijlstrapeter zijlstra218.18%150.00%
Total11100.00%2100.00%


static inline nodemask_t cpuset_mems_allowed(struct task_struct *p) { return node_possible_map; }

Contributors

PersonTokensPropCommitsCommitProp
paul jacksonpaul jackson15100.00%1100.00%
Total15100.00%1100.00%

#define cpuset_current_mems_allowed (node_states[N_MEMORY])
static inline void cpuset_init_current_mems_allowed(void) {}

Contributors

PersonTokensPropCommitsCommitProp
paul jacksonpaul jackson8100.00%1100.00%
Total8100.00%1100.00%


static inline int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask) { return 1; }

Contributors

PersonTokensPropCommitsCommitProp
paul jacksonpaul jackson1178.57%150.00%
mel gormanmel gorman321.43%150.00%
Total14100.00%2100.00%


static inline bool cpuset_node_allowed(int node, gfp_t gfp_mask) { return true; }

Contributors

PersonTokensPropCommitsCommitProp
david rientjesdavid rientjes1168.75%133.33%
vlastimil babkavlastimil babka425.00%133.33%
vladimir davydovvladimir davydov16.25%133.33%
Total16100.00%3100.00%


static inline bool __cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) { return true; }

Contributors

PersonTokensPropCommitsCommitProp
vlastimil babkavlastimil babka1688.89%150.00%
david rientjesdavid rientjes211.11%150.00%
Total18100.00%2100.00%


static inline bool cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) { return true; }

Contributors

PersonTokensPropCommitsCommitProp
paul jacksonpaul jackson1477.78%240.00%
vlastimil babkavlastimil babka211.11%120.00%
vladimir davydovvladimir davydov15.56%120.00%
al viroal viro15.56%120.00%
Total18100.00%5100.00%


static inline int cpuset_mems_allowed_intersects(const struct task_struct *tsk1, const struct task_struct *tsk2) { return 1; }

Contributors

PersonTokensPropCommitsCommitProp
paul jacksonpaul jackson1463.64%150.00%
david rientjesdavid rientjes836.36%150.00%
Total22100.00%2100.00%


static inline void cpuset_memory_pressure_bump(void) {}

Contributors

PersonTokensPropCommitsCommitProp
paul jacksonpaul jackson8100.00%1100.00%
Total8100.00%1100.00%


static inline void cpuset_task_status_allowed(struct seq_file *m, struct task_struct *task) { }

Contributors

PersonTokensPropCommitsCommitProp
paul jacksonpaul jackson956.25%150.00%
eric w. biedermaneric w. biederman743.75%150.00%
Total16100.00%2100.00%


static inline int cpuset_mem_spread_node(void) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
paul jacksonpaul jackson12100.00%1100.00%
Total12100.00%1100.00%


static inline int cpuset_slab_spread_node(void) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
jack steinerjack steiner12100.00%1100.00%
Total12100.00%1100.00%


static inline int cpuset_do_page_mem_spread(void) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
paul jacksonpaul jackson12100.00%1100.00%
Total12100.00%1100.00%


static inline int cpuset_do_slab_mem_spread(void) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
paul jacksonpaul jackson12100.00%1100.00%
Total12100.00%1100.00%


static inline int current_cpuset_is_being_rebound(void) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
paul menagepaul menage12100.00%1100.00%
Total12100.00%1100.00%


static inline void rebuild_sched_domains(void) { partition_sched_domains(1, NULL, NULL); }

Contributors

PersonTokensPropCommitsCommitProp
maksim krasnyanskiymaksim krasnyanskiy18100.00%2100.00%
Total18100.00%2100.00%


static inline void cpuset_print_current_mems_allowed(void) { }

Contributors

PersonTokensPropCommitsCommitProp
david rientjesdavid rientjes8100.00%2100.00%
Total8100.00%2100.00%


static inline void set_mems_allowed(nodemask_t nodemask) { }

Contributors

PersonTokensPropCommitsCommitProp
miao xiemiao xie9100.00%1100.00%
Total9100.00%1100.00%


static inline unsigned int read_mems_allowed_begin(void) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
mel gormanmel gorman861.54%266.67%
miao xiemiao xie538.46%133.33%
Total13100.00%3100.00%


static inline bool read_mems_allowed_retry(unsigned int seq) { return false; }

Contributors

PersonTokensPropCommitsCommitProp
mel gormanmel gorman1071.43%266.67%
miao xiemiao xie428.57%133.33%
Total14100.00%3100.00%

#endif /* !CONFIG_CPUSETS */ #endif /* _LINUX_CPUSET_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
paul jacksonpaul jackson32536.89%1227.91%
mel gormanmel gorman16218.39%511.63%
vlastimil babkavlastimil babka728.17%12.33%
david rientjesdavid rientjes657.38%49.30%
miao xiemiao xie606.81%24.65%
maksim krasnyanskiymaksim krasnyanskiy252.84%24.65%
li zefanli zefan242.72%36.98%
tejun heotejun heo232.61%12.33%
paul menagepaul menage202.27%12.33%
jack steinerjack steiner192.16%12.33%
oleg nesterovoleg nesterov182.04%12.33%
john stultzjohn stultz141.59%12.33%
eric w. biedermaneric w. biederman131.48%12.33%
al viroal viro131.48%24.65%
mike travismike travis101.14%12.33%
rusty russellrusty russell50.57%12.33%
vladimir davydovvladimir davydov50.57%12.33%
srivatsa s. bhatsrivatsa s. bhat40.45%12.33%
peter zijlstrapeter zijlstra30.34%12.33%
lai jiangshanlai jiangshan10.11%12.33%
Total881100.00%43100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}