1
0
Fork 0
remarkable-linux/include
Tim Chen 333c5ae994 idle governor: Avoid lock acquisition to read pm_qos before entering idle
Thanks to the reviews and comments by Rafael, James, Mark and Andi.
Here's version 2 of the patch incorporating your comments and also some
update to my previous patch comments.

I noticed that before entering idle state, the menu idle governor will
look up the current pm_qos target value according to the list of qos
requests received.  This look up currently needs the acquisition of a
lock to access the list of qos requests to find the qos target value,
slowing down the entrance into idle state due to contention by multiple
cpus to access this list.  The contention is severe when there are a lot
of cpus waking and going into idle.  For example, for a simple workload
that has 32 pair of processes ping ponging messages to each other, where
64 cpu cores are active in test system, I see the following profile with
37.82% of cpu cycles spent in contention of pm_qos_lock:

-     37.82%          swapper  [kernel.kallsyms]          [k]
_raw_spin_lock_irqsave
   - _raw_spin_lock_irqsave
      - 95.65% pm_qos_request
           menu_select
           cpuidle_idle_call
         - cpu_idle
              99.98% start_secondary

A better approach will be to cache the updated pm_qos target value so
reading it does not require lock acquisition as in the patch below.
With this patch the contention for pm_qos_lock is removed and I saw a
2.2X increase in throughput for my message passing workload.

cc: stable@kernel.org
Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: James Bottomley <James.Bottomley@suse.de>
Acked-by: mark gross <markgross@thegnar.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2011-05-29 00:50:59 -04:00
..
acpi Merge branch 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2011-01-20 16:28:34 -08:00
asm-generic mm: <asm-generic/pgtable.h> must include <linux/mm_types.h> 2011-02-28 17:46:49 -08:00
crypto crypto: padlock - Move padlock.h into include/crypto 2011-01-07 14:52:00 +11:00
drm drm: fix unsigned vs signed comparison issue in modeset ctl ioctl. 2011-02-28 15:24:35 +10:00
keys RxRPC: Fix v1 keys 2011-03-02 22:18:53 -08:00
linux idle governor: Avoid lock acquisition to read pm_qos before entering idle 2011-05-29 00:50:59 -04:00
math-emu
media [media] v4l: Include linux/videodev2.h in media/v4l2-ctrls.h 2011-01-19 11:52:09 -02:00
mtd mtd: Define MLC Flash as a different flash type 2010-10-25 00:50:20 +01:00
net net_sched: long word align struct qdisc_skb_cb data 2011-02-23 14:17:02 -08:00
pcmcia pcmcia: re-enable Zoomed Video support 2011-02-20 12:47:34 +01:00
rdma RDMA: Update workqueue usage 2011-01-16 21:16:31 -08:00
rxrpc
scsi [SCSI] fix incorrect value of SCSI_MAX_SG_CHAIN_SEGMENTS due to include file ordering 2011-01-24 11:49:34 -06:00
sound ASoC: WM8903: Fix mic detection register definitions 2011-02-13 19:38:06 +00:00
target [SCSI] target: Fix t_transport_aborted handling in LUN_RESET + active I/O shutdown 2011-02-28 11:23:32 -06:00
trace blktrace: Remove blk_fill_rwbs_rq. 2011-03-03 10:53:20 -05:00
video Merge branch 'fbdev/udlfb' 2011-01-06 18:10:09 +09:00
xen Merge branch 'stable/gntdev' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen 2011-01-13 18:46:48 -08:00
Kbuild