Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 245566
b: refs/heads/master
c: 60495e7
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Apr 11, 2011
1 parent 45adb90 commit af6ca23
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 54ab4ff4316eb329d2c1acc110fbc623d2966931
refs/heads/master: 60495e7760d8ee364695006af37309b0755e0e17
23 changes: 3 additions & 20 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -892,25 +892,6 @@ static inline struct cpumask *sched_group_cpus(struct sched_group *sg)
return to_cpumask(sg->cpumask);
}

enum sched_domain_level {
SD_LV_NONE = 0,
#ifdef CONFIG_SCHED_SMT
SD_LV_SIBLING,
#endif
#ifdef CONFIG_SCHED_MC
SD_LV_MC,
#endif
#ifdef CONFIG_SCHED_BOOK
SD_LV_BOOK,
#endif
SD_LV_CPU,
#ifdef CONFIG_NUMA
SD_LV_NODE,
SD_LV_ALLNODES,
#endif
SD_LV_MAX
};

struct sched_domain_attr {
int relax_domain_level;
};
Expand All @@ -919,6 +900,8 @@ struct sched_domain_attr {
.relax_domain_level = -1, \
}

extern int sched_domain_level_max;

struct sched_domain {
/* These fields must be setup */
struct sched_domain *parent; /* top domain must be null terminated */
Expand All @@ -936,7 +919,7 @@ struct sched_domain {
unsigned int forkexec_idx;
unsigned int smt_gain;
int flags; /* See SD_* */
enum sched_domain_level level;
int level;

/* Runtime fields. */
unsigned long last_balance; /* init to jiffies. units in jiffies */
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ int current_cpuset_is_being_rebound(void)
static int update_relax_domain_level(struct cpuset *cs, s64 val)
{
#ifdef CONFIG_SMP
if (val < -1 || val >= SD_LV_MAX)
if (val < -1 || val >= sched_domain_level_max)
return -EINVAL;
#endif

Expand Down
9 changes: 6 additions & 3 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -6966,7 +6966,6 @@ sd_init_##type(struct sched_domain_topology_level *tl, int cpu) \
{ \
struct sched_domain *sd = *per_cpu_ptr(tl->data.sd, cpu); \
*sd = SD_##type##_INIT; \
sd->level = SD_LV_##type; \
SD_INIT_NAME(sd, type); \
sd->private = &tl->data; \
return sd; \
Expand All @@ -6988,13 +6987,14 @@ SD_INIT_FUNC(CPU)
#endif

static int default_relax_domain_level = -1;
int sched_domain_level_max;

static int __init setup_relax_domain_level(char *str)
{
unsigned long val;

val = simple_strtoul(str, NULL, 0);
if (val < SD_LV_MAX)
if (val < sched_domain_level_max)
default_relax_domain_level = val;

return 1;
Expand Down Expand Up @@ -7173,8 +7173,11 @@ struct sched_domain *build_sched_domain(struct sched_domain_topology_level *tl,

set_domain_attribute(sd, attr);
cpumask_and(sched_domain_span(sd), cpu_map, tl->mask(cpu));
if (child)
if (child) {
sd->level = child->level + 1;
sched_domain_level_max = max(sched_domain_level_max, sd->level);
child->parent = sd;
}
sd->child = child;

return sd;
Expand Down

0 comments on commit af6ca23

Please sign in to comment.