cregit-Linux how code gets into the kernel

Release 4.12 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/sched/topology.h>
#include <linux/sched/task.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 Gorman1593.75%150.00%
Vlastimil 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 Gorman1990.48%150.00%
Vlastimil Babka29.52%150.00%
Total21100.00%2100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Mel Gorman1493.33%150.00%
Vlastimil Babka16.67%150.00%
Total15100.00%2100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Mel Gorman1493.33%150.00%
Vlastimil 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(void); 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 Rientjes1551.72%120.00%
Vlastimil Babka931.03%120.00%
Vladimir Davydov26.90%120.00%
Paul Jackson26.90%120.00%
Mel 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 Jackson1973.08%133.33%
David Rientjes415.38%133.33%
Vlastimil 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 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 Jackson1280.00%150.00%
Li 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 Jackson1280.00%150.00%
Li 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 Gorman1967.86%375.00%
Miao 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 Gorman2167.74%375.00%
Miao 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 Xie2035.71%240.00%
Mel Gorman1628.57%120.00%
John Stultz1425.00%120.00%
Paul Jackson610.71%120.00%
Total56100.00%5100.00%

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

Contributors

PersonTokensPropCommitsCommitProp
Mel Gorman12100.00%1100.00%
Total12100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Paul Jackson12100.00%1100.00%
Total12100.00%1100.00%


static inline void cpuset_init_smp(void) {}

Contributors

PersonTokensPropCommitsCommitProp
Paul Jackson8100.00%1100.00%
Total8100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Tejun Heo1794.44%150.00%
Rakib Mullick15.56%150.00%
Total18100.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 Jackson1145.83%125.00%
Mike Travis625.00%125.00%
Rusty Russell520.83%125.00%
Li Zefan28.33%125.00%
Total24100.00%4100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Oleg Nesterov981.82%150.00%
Peter 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 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 Jackson8100.00%1100.00%
Total8100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Paul Jackson1178.57%150.00%
Mel 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 Rientjes1168.75%133.33%
Vlastimil Babka425.00%133.33%
Vladimir 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 Babka1688.89%150.00%
David 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 Jackson1477.78%240.00%
Vlastimil Babka211.11%120.00%
Al Viro15.56%120.00%
Vladimir Davydov15.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 Jackson1463.64%150.00%
David Rientjes836.36%150.00%
Total22100.00%2100.00%


static inline void cpuset_memory_pressure_bump(void) {}

Contributors

PersonTokensPropCommitsCommitProp
Paul 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 Jackson956.25%150.00%
Eric W. Biedermann743.75%150.00%
Total16100.00%2100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Paul Jackson12100.00%1100.00%
Total12100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Jack Steiner12100.00%1100.00%
Total12100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Paul Jackson12100.00%1100.00%
Total12100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Paul Jackson12100.00%1100.00%
Total12100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Paul Menage12100.00%1100.00%
Total12100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Maksim Krasnyanskiy18100.00%2100.00%
Total18100.00%2100.00%


static inline void cpuset_print_current_mems_allowed(void) { }

Contributors

PersonTokensPropCommitsCommitProp
David Rientjes8100.00%2100.00%
Total8100.00%2100.00%


static inline void set_mems_allowed(nodemask_t nodemask) { }

Contributors

PersonTokensPropCommitsCommitProp
Miao Xie9100.00%1100.00%
Total9100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Mel Gorman861.54%266.67%
Miao Xie538.46%133.33%
Total13100.00%3100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Mel Gorman1071.43%266.67%
Miao Xie428.57%133.33%
Total14100.00%3100.00%

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

Overall Contributors

PersonTokensPropCommitsCommitProp
Paul Jackson32436.61%1125.00%
Mel Gorman16218.31%511.36%
Vlastimil Babka728.14%12.27%
David Rientjes667.46%49.09%
Miao Xie606.78%24.55%
Maksim Krasnyanskiy252.82%24.55%
Li Zefan242.71%36.82%
Tejun Heo232.60%12.27%
Paul Menage202.26%12.27%
Jack Steiner192.15%12.27%
Oleg Nesterov182.03%12.27%
John Stultz141.58%12.27%
Al Viro131.47%24.55%
Eric W. Biedermann131.47%12.27%
Mike Travis101.13%12.27%
Ingo Molnar60.68%24.55%
Rusty Russell50.56%12.27%
Vladimir Davydov50.56%12.27%
Peter Zijlstra30.34%12.27%
Rakib Mullick20.23%12.27%
Lai Jiangshan10.11%12.27%
Total885100.00%44100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.