Merge branches 'pm-sleep', 'pm-cpufreq' and 'pm-cpuidle'

* pm-sleep:
  PM / hibernate: avoid unsafe pages in e820 reserved regions

* pm-cpufreq:
  cpufreq: arm_big_little: fix module license spec
  cpufreq: speedstep-smi: fix decimal printf specifiers
  cpufreq: OPP: Avoid sleeping while atomic
  cpufreq: cpu0: Do not print error message when deferring
  cpufreq: integrator: Use set_cpus_allowed_ptr

* pm-cpuidle:
  cpuidle: menu: Lookup CPU runqueues less
  cpuidle: menu: Call nr_iowait_cpu less times
  cpuidle: menu: Use ktime_to_us instead of reinventing the wheel
  cpuidle: menu: Use shifts when calculating averages where possible
This commit is contained in:
Rafael J. Wysocki
2014-08-11 23:19:48 +02:00
11 changed files with 66 additions and 40 deletions

View File

@@ -954,6 +954,25 @@ static void mark_nosave_pages(struct memory_bitmap *bm)
}
}
static bool is_nosave_page(unsigned long pfn)
{
struct nosave_region *region;
list_for_each_entry(region, &nosave_regions, list) {
if (pfn >= region->start_pfn && pfn < region->end_pfn) {
pr_err("PM: %#010llx in e820 nosave region: "
"[mem %#010llx-%#010llx]\n",
(unsigned long long) pfn << PAGE_SHIFT,
(unsigned long long) region->start_pfn << PAGE_SHIFT,
((unsigned long long) region->end_pfn << PAGE_SHIFT)
- 1);
return true;
}
}
return false;
}
/**
* create_basic_memory_bitmaps - create bitmaps needed for marking page
* frames that should not be saved and free page frames. The pointers
@@ -2015,7 +2034,7 @@ static int mark_unsafe_pages(struct memory_bitmap *bm)
do {
pfn = memory_bm_next_pfn(bm);
if (likely(pfn != BM_END_OF_MAP)) {
if (likely(pfn_valid(pfn)))
if (likely(pfn_valid(pfn)) && !is_nosave_page(pfn))
swsusp_set_page_free(pfn_to_page(pfn));
else
return -EFAULT;

View File

@@ -2393,6 +2393,13 @@ unsigned long nr_iowait_cpu(int cpu)
return atomic_read(&this->nr_iowait);
}
void get_iowait_load(unsigned long *nr_waiters, unsigned long *load)
{
struct rq *this = this_rq();
*nr_waiters = atomic_read(&this->nr_iowait);
*load = this->cpu_load[0];
}
#ifdef CONFIG_SMP
/*

View File

@@ -8,13 +8,6 @@
#include "sched.h"
unsigned long this_cpu_load(void)
{
struct rq *this = this_rq();
return this->cpu_load[0];
}
/*
* Global load-average calculations
*