Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125376
b: refs/heads/master
c: 716707b
h: refs/heads/master
v: v3
  • Loading branch information
Vaidyanathan Srinivasan authored and Ingo Molnar committed Dec 19, 2008
1 parent ba54daf commit 7a4eaa9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 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: 3b11ce7f542e415c90267b4482d4611410b468e6
refs/heads/master: 716707b29906e1d8d190defe3d646610b097a861
33 changes: 24 additions & 9 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -763,15 +763,23 @@ enum cpu_idle_type {
#define SD_SERIALIZE 1024 /* Only a single load balancing instance */
#define SD_WAKE_IDLE_FAR 2048 /* Gain latency sacrificing cache hit */

#define BALANCE_FOR_MC_POWER \
(sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0)
extern int sched_mc_power_savings, sched_smt_power_savings;

static inline int sd_balance_for_mc_power(void)
{
if (sched_smt_power_savings)
return SD_POWERSAVINGS_BALANCE;

#define BALANCE_FOR_PKG_POWER \
((sched_mc_power_savings || sched_smt_power_savings) ? \
SD_POWERSAVINGS_BALANCE : 0)
return 0;
}

#define test_sd_parent(sd, flag) ((sd->parent && \
(sd->parent->flags & flag)) ? 1 : 0)
static inline int sd_balance_for_package_power(void)
{
if (sched_mc_power_savings | sched_smt_power_savings)
return SD_POWERSAVINGS_BALANCE;

return 0;
}


struct sched_group {
Expand Down Expand Up @@ -1399,6 +1407,15 @@ struct task_struct {
#endif
};

/* Test a flag in parent sched domain */
static inline int test_sd_parent(struct sched_domain *sd, int flag)
{
if (sd->parent && (sd->parent->flags & flag))
return 1;

return 0;
}

/*
* Priority of a process goes from 0..MAX_PRIO-1, valid RT
* priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
Expand Down Expand Up @@ -2256,8 +2273,6 @@ __trace_special(void *__tr, void *__data,
extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);
extern long sched_getaffinity(pid_t pid, struct cpumask *mask);

extern int sched_mc_power_savings, sched_smt_power_savings;

extern void normalize_rt_tasks(void);

#ifdef CONFIG_GROUP_SCHED
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ int arch_update_cpu_topology(void);
| SD_WAKE_AFFINE \
| SD_WAKE_BALANCE \
| SD_SHARE_PKG_RESOURCES\
| BALANCE_FOR_MC_POWER, \
| sd_balance_for_mc_power(),\
.last_balance = jiffies, \
.balance_interval = 1, \
}
Expand All @@ -150,7 +150,7 @@ int arch_update_cpu_topology(void);
| SD_BALANCE_FORK \
| SD_WAKE_AFFINE \
| SD_WAKE_BALANCE \
| BALANCE_FOR_PKG_POWER,\
| sd_balance_for_package_power(),\
.last_balance = jiffies, \
.balance_interval = 1, \
}
Expand Down

0 comments on commit 7a4eaa9

Please sign in to comment.