From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
Mike Galbraith <efault@gmx.de>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@elte.hu>
Subject: [014/151] sched: Rate-limit newidle
Date: Wed, 16 Dec 2009 19:55:11 -0800 [thread overview]
Message-ID: <20091217035644.782513558@mini.kroah.org> (raw)
In-Reply-To: <20091217040208.GA26571@kroah.com>
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mike Galbraith <efault@gmx.de>
commit 1b9508f6831e10d53256825de8904caa22d1ca2c upstream.
Rate limit newidle to migration_cost. It's a win for all
stages of sysbench oltp tests.
Signed-off-by: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
kernel/sched.c | 22 +++++++++++++++++++++-
kernel/sched_debug.c | 4 ++++
2 files changed, 25 insertions(+), 1 deletion(-)
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -591,6 +591,8 @@ struct rq {
u64 rt_avg;
u64 age_stamp;
+ u64 idle_stamp;
+ u64 avg_idle;
#endif
/* calc_load related fields */
@@ -2384,6 +2386,17 @@ static int try_to_wake_up(struct task_st
if (rq != orig_rq)
update_rq_clock(rq);
+ if (rq->idle_stamp) {
+ u64 delta = rq->clock - rq->idle_stamp;
+ u64 max = 2*sysctl_sched_migration_cost;
+
+ if (delta > max)
+ rq->avg_idle = max;
+ else
+ update_avg(&rq->avg_idle, delta);
+ rq->idle_stamp = 0;
+ }
+
WARN_ON(p->state != TASK_WAKING);
cpu = task_cpu(p);
@@ -4429,6 +4442,11 @@ static void idle_balance(int this_cpu, s
int pulled_task = 0;
unsigned long next_balance = jiffies + HZ;
+ this_rq->idle_stamp = this_rq->clock;
+
+ if (this_rq->avg_idle < sysctl_sched_migration_cost)
+ return;
+
for_each_domain(this_cpu, sd) {
unsigned long interval;
@@ -4443,8 +4461,10 @@ static void idle_balance(int this_cpu, s
interval = msecs_to_jiffies(sd->balance_interval);
if (time_after(next_balance, sd->last_balance + interval))
next_balance = sd->last_balance + interval;
- if (pulled_task)
+ if (pulled_task) {
+ this_rq->idle_stamp = 0;
break;
+ }
}
if (pulled_task || time_after(jiffies, this_rq->next_balance)) {
/*
--- a/kernel/sched_debug.c
+++ b/kernel/sched_debug.c
@@ -285,12 +285,16 @@ static void print_cpu(struct seq_file *m
#ifdef CONFIG_SCHEDSTATS
#define P(n) SEQ_printf(m, " .%-30s: %d\n", #n, rq->n);
+#define P64(n) SEQ_printf(m, " .%-30s: %Ld\n", #n, rq->n);
P(yld_count);
P(sched_switch);
P(sched_count);
P(sched_goidle);
+#ifdef CONFIG_SMP
+ P64(avg_idle);
+#endif
P(ttwu_count);
P(ttwu_local);
next prev parent reply other threads:[~2009-12-17 4:51 UTC|newest]
Thread overview: 152+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-17 4:02 [000/151] 2.6.32.2-stable review Greg KH
2009-12-17 3:54 ` [001/151] USB: usb-storage: fix bug in fill_inquiry Greg KH
2009-12-17 3:54 ` [002/151] USB: option: add pid for ZTE Greg KH
2009-12-17 3:55 ` [003/151] firewire: ohci: handle receive packets with a data length of zero Greg KH
2009-12-17 3:55 ` [004/151] rcu: Prepare for synchronization fixes: clean up for non-NO_HZ handling of ->completed counter Greg KH
2009-12-17 3:55 ` [005/151] rcu: Fix synchronization for rcu_process_gp_end() uses " Greg KH
2009-12-17 3:55 ` [006/151] rcu: Fix note_new_gpnum() uses of ->gpnum Greg KH
2009-12-17 3:55 ` [007/151] rcu: Remove inline from forward-referenced functions Greg KH
2009-12-17 3:55 ` [008/151] perf_event: Fix invalid type in ioctl definition Greg KH
2009-12-17 3:55 ` [009/151] perf_event: Initialize data.period in perf_swevent_hrtimer() Greg KH
2009-12-17 3:55 ` [010/151] perf: Dont free perf_mmap_data until work has been done Greg KH
2009-12-17 3:55 ` [011/151] PM / Runtime: Fix lockdep warning in __pm_runtime_set_status() Greg KH
2009-12-17 3:55 ` [012/151] sched: Check for an idle shared cache in select_task_rq_fair() Greg KH
2009-12-17 3:55 ` [013/151] sched: Fix affinity logic " Greg KH
2009-12-17 3:55 ` Greg KH [this message]
2009-12-17 3:55 ` [015/151] sched: Fix and clean up rate-limit newidle code Greg KH
2009-12-17 3:55 ` [016/151] x86/amd-iommu: attach devices to pre-allocated domains early Greg KH
2009-12-17 3:55 ` [017/151] x86/amd-iommu: un__init iommu_setup_msi Greg KH
2009-12-17 3:55 ` [018/151] x86, Calgary IOMMU quirk: Find nearest matching Calgary while walking up the PCI tree Greg KH
2009-12-17 3:55 ` [019/151] x86: Fix iommu=nodac parameter handling Greg KH
2009-12-17 3:55 ` [020/151] x86: GART: pci-gart_64.c: Use correct length in strncmp Greg KH
2009-12-17 3:55 ` [021/151] x86: ASUS P4S800 reboot=bios quirk Greg KH
2009-12-17 3:55 ` [022/151] x86, apic: Enable lapic nmi watchdog on AMD Family 11h Greg KH
2009-12-17 3:55 ` [023/151] ssb: Fix range check in sprom write Greg KH
2009-12-17 3:55 ` [024/151] ath5k: allow setting txpower to 0 Greg KH
2009-12-17 3:55 ` [025/151] ath5k: enable EEPROM checksum check Greg KH
2009-12-17 3:55 ` [026/151] hrtimer: Fix /proc/timer_list regression Greg KH
2009-12-17 3:55 ` [027/151] ALSA: hrtimer - Fix lock-up Greg KH
2009-12-17 3:55 ` [028/151] ALSA: hda - Terradici HDA controllers does not support 64-bit mode Greg KH
2009-12-17 3:55 ` [029/151] KVM: x86 emulator: limit instructions to 15 bytes Greg KH
2009-12-17 3:55 ` [030/151] KVM: s390: Fix prefix register checking in arch/s390/kvm/sigp.c Greg KH
2009-12-17 3:55 ` [031/151] KVM: s390: Make psw available on all exits, not just a subset Greg KH
2009-12-17 3:55 ` [032/151] KVM: fix irq_source_id size verification Greg KH
2009-12-17 3:55 ` [033/151] KVM: x86: include pvclock MSRs in msrs_to_save Greg KH
2009-12-17 3:55 ` [034/151] x86: Prevent GCC 4.4.x (pentium-mmx et al) function prologue wreckage Greg KH
2009-12-17 3:55 ` [035/151] x86: Use -maccumulate-outgoing-args for sane mcount prologues Greg KH
2009-12-17 3:55 ` [036/151] x86, mce: dont restart timer if disabled Greg KH
2009-12-17 3:55 ` [037/151] x86/mce: Set up timer unconditionally Greg KH
2009-12-17 3:55 ` [038/151] x86: SGI UV: Fix BAU initialization Greg KH
2009-12-17 3:55 ` [039/151] x86: Fix duplicated UV BAU interrupt vector Greg KH
2009-12-17 3:55 ` [040/151] x86: Add new Intel CPU cache size descriptors Greg KH
2009-12-17 3:55 ` [041/151] x86: Fix typo in Intel CPU cache size descriptor Greg KH
2009-12-17 3:55 ` [042/151] pata_hpt{37x|3x2n}: fix timing register masks (take 2) Greg KH
2009-12-17 3:55 ` [043/151] [S390] s390: clear high-order bits of registers after sam64 Greg KH
2009-12-17 3:55 ` [044/151] V4L/DVB: Fix test in copy_reg_bits() Greg KH
2009-12-17 3:55 ` [045/151] bsdacct: fix uid/gid misreporting Greg KH
2009-12-17 3:55 ` [046/151] UBI: flush wl before clearing update marker Greg KH
2009-12-17 3:55 ` [047/151] jbd2: dont wipe the journal on a failed journal checksum Greg KH
2009-12-17 3:55 ` [048/151] USB: xhci: Add correct email and files to MAINTAINERS entry Greg KH
2009-12-17 3:55 ` [049/151] USB: musb_gadget_ep0: fix unhandled endpoint 0 IRQs, again Greg KH
2009-12-17 3:55 ` [050/151] USB: option.c: add support for D-Link DWM-162-U5 Greg KH
2009-12-17 3:55 ` [051/151] USB: usbtmc: repeat usb_bulk_msg until whole message is transfered Greg KH
2009-12-17 3:55 ` [052/151] USB: usb-storage: add BAD_SENSE flag Greg KH
2009-12-17 3:55 ` [053/151] USB: Close usb_find_interface race v3 Greg KH
2009-12-17 3:55 ` [054/151] [ARM] pxa/em-x270: fix usb hub power up/reset sequence Greg KH
2009-12-17 3:55 ` [055/151] hfs: fix a potential buffer overflow Greg KH
2009-12-17 3:55 ` [056/151] SUNRPC: IS_ERR/PTR_ERR confusion Greg KH
2009-12-17 3:55 ` [057/151] NFS: Fix nfs_migrate_page() Greg KH
2009-12-17 3:55 ` [058/151] md/bitmap: protect against bitmap removal while being updated Greg KH
2009-12-17 3:55 ` [059/151] futex: Take mmap_sem for get_user_pages in fault_in_user_writeable Greg KH
2009-12-17 3:55 ` [060/151] devpts_get_tty() should validate inode Greg KH
2009-12-17 3:55 ` [061/151] debugfs: fix create mutex racy fops and private data Greg KH
2009-12-17 3:55 ` [062/151] Driver core: fix race in dev_driver_string Greg KH
2009-12-17 3:56 ` [063/151] Serial: Do not read IIR in serial8250_start_tx when UART_BUG_TXEN Greg KH
2009-12-17 3:56 ` [064/151] mac80211: Fix bug in computing crc over dynamic IEs in beacon Greg KH
2009-12-17 3:56 ` [065/151] mac80211: Fixed bug in mesh portal paths Greg KH
2009-12-17 3:56 ` [066/151] mac80211: Revert Use correct sign for mesh active path refresh Greg KH
2009-12-17 3:56 ` [067/151] mac80211: fix scan abort sanity checks Greg KH
2009-12-17 3:56 ` [068/151] wireless: correctly report signal value for IEEE80211_HW_SIGNAL_UNSPEC Greg KH
2009-12-17 3:56 ` [069/151] rtl8187: Fix wrong rfkill switch mask for some models Greg KH
2009-12-17 3:56 ` [070/151] x86: Fix bogus warning in apic_noop.apic_write() Greg KH
2009-12-17 3:56 ` [071/151] mm: hugetlb: fix hugepage memory leak in mincore() Greg KH
2009-12-17 3:56 ` [072/151] mm: hugetlb: fix hugepage memory leak in walk_page_range() Greg KH
2009-12-17 3:56 ` [073/151] powerpc/windfarm: Add detection for second cpu pump Greg KH
2009-12-17 3:56 ` [074/151] powerpc/therm_adt746x: Record pwm invert bit at module load time] Greg KH
2009-12-17 3:56 ` [075/151] powerpc: Fix usage of 64-bit instruction in 32-bit altivec code Greg KH
2009-12-17 3:56 ` [076/151] drm/radeon/kms: Add quirk for HIS X1300 board Greg KH
2009-12-17 3:56 ` [077/151] drm/radeon/kms: handle vblanks properly with dpms on Greg KH
2009-12-17 3:56 ` [078/151] drm/radeon/kms: fix legacy crtc2 dpms Greg KH
2009-12-17 3:56 ` [079/151] drm/radeon/kms: fix vram setup on rs600 Greg KH
2009-12-17 3:56 ` [080/151] drm/radeon/kms: rs6xx/rs740: clamp vram to aperture size Greg KH
2009-12-17 3:56 ` [081/151] drm/ttm: Fix build failure due to missing struct page Greg KH
2009-12-17 3:56 ` [082/151] drm/i915: Set the error code after failing to insert new offset into mm ht Greg KH
2009-12-17 3:56 ` [083/151] drm/i915: Add the missing clonemask for display port on Ironlake Greg KH
2009-12-17 3:56 ` [084/151] xen/xenbus: make DEVICE_ATTR()s static Greg KH
2009-12-17 3:56 ` [085/151] xen: re-register runstate area earlier on resume Greg KH
2009-12-17 3:56 ` [086/151] xen: restore runstate_info even if !have_vcpu_info_placement Greg KH
2009-12-17 3:56 ` [087/151] xen: correctly restore pfn_to_mfn_list_list after resume Greg KH
2009-12-17 3:56 ` [088/151] xen: register timer interrupt with IRQF_TIMER Greg KH
2009-12-17 3:56 ` [089/151] xen: register runstate on secondary CPUs Greg KH
2009-12-17 3:56 ` [090/151] xen: dont call dpm_resume_noirq() with interrupts disabled Greg KH
2009-12-17 3:56 ` [091/151] xen: register runstate info for boot CPU early Greg KH
2009-12-17 3:56 ` [092/151] xen: call clock resume notifier on all CPUs Greg KH
2009-12-17 3:56 ` [093/151] xen: improve error handling in do_suspend Greg KH
2009-12-17 3:56 ` [094/151] xen: dont leak IRQs over suspend/resume Greg KH
2009-12-17 3:56 ` [095/151] xen: use iret for return from 64b kernel to 32b usermode Greg KH
2009-12-17 3:56 ` [096/151] xen: explicitly create/destroy stop_machine workqueues outside suspend/resume region Greg KH
2009-12-17 3:56 ` [097/151] Xen balloon: fix totalram_pages counting Greg KH
2009-12-17 3:56 ` [098/151] xen: try harder to balloon up under memory pressure Greg KH
2009-12-17 3:56 ` [099/151] dm exception store: free tmp_store on persistent flag error Greg KH
2009-12-17 3:56 ` [100/151] dm snapshot: only take lock for statustype info not table Greg KH
2009-12-17 3:56 ` [101/151] dm crypt: move private iv fields to structs Greg KH
2009-12-17 3:56 ` [102/151] dm crypt: restructure essiv error path Greg KH
2009-12-17 3:56 ` [103/151] dm: avoid _hash_lock deadlock Greg KH
2009-12-17 3:56 ` [104/151] dm snapshot: cope with chunk size larger than origin Greg KH
2009-12-17 3:56 ` [105/151] dm crypt: separate essiv allocation from initialisation Greg KH
2009-12-17 3:56 ` [106/151] dm crypt: make wipe message also wipe essiv key Greg KH
2009-12-17 3:56 ` [107/151] slc90e66: fix UDMA handling Greg KH
2009-12-17 3:56 ` [108/151] tcp: Stalling connections: Fix timeout calculation routine Greg KH
2009-12-17 3:56 ` [109/151] ip_fragment: also adjust skb->truesize for packets not owned by a socket Greg KH
2009-12-17 3:56 ` [110/151] b44 WOL setup: one-bit-off stack corruption kernel panic fix Greg KH
2009-12-17 3:56 ` [111/151] sparc64: Dont specify IRQF_SHARED for LDC interrupts Greg KH
2009-12-17 3:56 ` [112/151] sparc64: Fix overly strict range type matching for PCI devices Greg KH
2009-12-17 3:56 ` [113/151] sparc64: Fix stack debugging IRQ stack regression Greg KH
2009-12-17 3:56 ` [114/151] sparc: Set UTS_MACHINE correctly Greg KH
2009-12-17 3:56 ` [115/151] b43legacy: avoid PPC fault during resume Greg KH
2009-12-17 3:56 ` [116/151] tracing: Fix event format export Greg KH
2009-12-17 3:56 ` [117/151] ath9k: Fix TX hang poll routine Greg KH
2009-12-17 3:56 ` [118/151] ath9k: fix processing of TX PS null data frames Greg KH
2009-12-17 3:56 ` [119/151] ath9k: Fix maximum tx fifo settings for single stream devices Greg KH
2009-12-17 3:56 ` [120/151] ath9k: fix tx status reporting Greg KH
2009-12-17 3:56 ` [121/151] mac80211: Fix dynamic power save for scanning Greg KH
2009-12-17 3:56 ` [122/151] drm/i915: Fix sync to vblank when VGA output is turned off Greg KH
2009-12-17 3:57 ` [123/151] memcg: fix memory.memsw.usage_in_bytes for root cgroup Greg KH
2009-12-17 3:57 ` [124/151] thinkpad-acpi: fix default brightness_mode for R50e/R51 Greg KH
2009-12-17 3:57 ` [125/151] thinkpad-acpi: preserve rfkill state across suspend/resume Greg KH
2009-12-17 3:57 ` [126/151] sysctl_max_map_count should be non-negative Greg KH
2009-12-17 3:57 ` [127/151] ipw2100: fix rebooting hang with driver loaded Greg KH
2009-12-17 3:57 ` [128/151] matroxfb: fix problems with display stability Greg KH
2009-12-17 3:57 ` [129/151] acerhdf: add new BIOS versions Greg KH
2009-12-17 3:57 ` [130/151] asus-laptop: change light sens default values Greg KH
2009-12-17 3:57 ` [131/151] vmalloc: conditionalize build of pcpu_get_vm_areas() Greg KH
2009-12-17 3:57 ` [132/151] ACPI: Use the ARB_DISABLE for the CPU which model id is less than 0x0f Greg KH
2009-12-17 3:57 ` [133/151] net: Fix userspace RTM_NEWLINK notifications Greg KH
2009-12-17 3:57 ` [134/151] ext3: Fix data / filesystem corruption when write fails to copy data Greg KH
2009-12-17 3:57 ` [135/151] V4L/DVB (13116): gspca - ov519: Webcam 041e:4067 added Greg KH
2009-12-17 3:57 ` [136/151] bcm63xx_enet: fix compilation failure after get_stats_count removal Greg KH
2009-12-17 3:57 ` [137/151] x86: Under BIOS control, restore APs APIC_LVTTHMR to the BSP value Greg KH
2009-12-17 3:57 ` [138/151] drm/i915: Avoid NULL dereference with component_only tv_modes Greg KH
2009-12-17 3:57 ` [139/151] drm/i915: PineView only has LVDS and CRT ports Greg KH
2009-12-17 3:57 ` [140/151] drm/i915: Fix LVDS stability issue on Ironlake Greg KH
2009-12-17 3:57 ` [141/151] mm: sigbus instead of abusing oom Greg KH
2009-12-17 3:57 ` [142/151] ipvs: zero usvc and udest Greg KH
2009-12-17 3:57 ` [143/151] jffs2: Fix long-standing bug with symlink garbage collection Greg KH
2009-12-17 3:57 ` [144/151] intel-iommu: Detect DMAR in hyperspace at probe time Greg KH
2009-12-17 3:57 ` [145/151] intel-iommu: Apply BIOS sanity checks for interrupt remapping too Greg KH
2009-12-17 3:57 ` [146/151] intel-iommu: Check for an RMRR which ends before it starts Greg KH
2009-12-17 3:57 ` [147/151] intel-iommu: Fix oops with intel_iommu=igfx_off Greg KH
2009-12-17 3:57 ` [148/151] intel-iommu: ignore page table validation in pass through mode Greg KH
2009-12-17 3:57 ` [149/151] netfilter: xtables: document minimal required version Greg KH
2009-12-17 3:57 ` [150/151] perf_event: Fix incorrect range check on cpu number Greg KH
2009-12-17 3:57 ` [151/151] implement early_io{re,un}map for ia64 Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091217035644.782513558@mini.kroah.org \
--to=gregkh@suse.de \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=stable-review@kernel.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox