Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310527
b: refs/heads/master
c: d15cf7c
h: refs/heads/master
i:
  310525: 97e9936
  310523: 4cea736
  310519: 4f8303b
  310511: d044772
  310495: e8ce3e6
  310463: 8771150
  310399: 7e050e6
  310271: 97f304f
v: v3
  • Loading branch information
Len Brown committed Jun 4, 2012
1 parent cd0af08 commit d40fcc4
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 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: 7ae30986dc63d214cb075a40f2cf205f0a7806cd
refs/heads/master: d15cf7c129fa4ec4b44c52521e49ffafb9749029
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ config ACPI_IPMI

config ACPI_HOTPLUG_CPU
bool
depends on EXPERIMENTAL && ACPI_PROCESSOR && HOTPLUG_CPU
depends on ACPI_PROCESSOR && HOTPLUG_CPU
select ACPI_CONTAINER
default y

Expand Down
4 changes: 2 additions & 2 deletions trunk/include/acpi/acpi_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable)

#else /* CONFIG_ACPI */

static inline int register_acpi_bus_type(void *bus) { return 0; }
static inline int unregister_acpi_bus_type(void *bus) { return 0; }
static int register_acpi_bus_type(struct acpi_bus_type *bus) { return 0; }
static int unregister_acpi_bus_type(struct acpi_bus_type *bus) { return 0; }

#endif /* CONFIG_ACPI */

Expand Down
28 changes: 26 additions & 2 deletions trunk/tools/power/x86/turbostat/turbostat.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ int backwards_count;
char *progname;

int num_cpus;
cpu_set_t *cpu_mask;
size_t cpu_mask_size;
cpu_set_t *cpu_present_set, *cpu_mask;
size_t cpu_present_setsize, cpu_mask_size;

struct counters {
unsigned long long tsc; /* per thread */
Expand Down Expand Up @@ -103,6 +103,12 @@ struct timeval tv_even;
struct timeval tv_odd;
struct timeval tv_delta;

int mark_cpu_present(int pkg, int core, int cpu)
{
CPU_SET_S(cpu, cpu_present_setsize, cpu_present_set);
return 0;
}

/*
* cpu_mask_init(ncpus)
*
Expand All @@ -118,13 +124,28 @@ void cpu_mask_init(int ncpus)
}
cpu_mask_size = CPU_ALLOC_SIZE(ncpus);
CPU_ZERO_S(cpu_mask_size, cpu_mask);

/*
* Allocate and initialize cpu_present_set
*/
cpu_present_set = CPU_ALLOC(ncpus);
if (cpu_present_set == NULL) {
perror("CPU_ALLOC");
exit(3);
}
cpu_present_setsize = CPU_ALLOC_SIZE(ncpus);
CPU_ZERO_S(cpu_present_setsize, cpu_present_set);
for_all_cpus(mark_cpu_present);
}

void cpu_mask_uninit()
{
CPU_FREE(cpu_mask);
cpu_mask = NULL;
cpu_mask_size = 0;
CPU_FREE(cpu_present_set);
cpu_present_set = NULL;
cpu_present_setsize = 0;
}

int cpu_migrate(int cpu)
Expand Down Expand Up @@ -1047,6 +1068,9 @@ int fork_it(char **argv)
int retval;
pid_t child_pid;
get_counters(cnt_even);

/* clear affinity side-effect of get_counters() */
sched_setaffinity(0, cpu_present_setsize, cpu_present_set);
gettimeofday(&tv_even, (struct timezone *)NULL);

child_pid = fork();
Expand Down

0 comments on commit d40fcc4

Please sign in to comment.