aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-s3c24xx/cpu.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2012-03-30genirq: Adjust irq thread affinity on IRQ_SET_MASK_OK_NOCOPY return valueJiang Liu1-3/+7
irq_move_masked_irq() checks the return code of chip->irq_set_affinity() only for 0, but IRQ_SET_MASK_OK_NOCOPY is also a valid return code, which is there to avoid a redundant copy of the cpumask. But in case of IRQ_SET_MASK_OK_NOCOPY we not only avoid the redundant copy, we also fail to adjust the thread affinity of an eventually threaded interrupt handler. Handle IRQ_SET_MASK_OK (==0) and IRQ_SET_MASK_OK_NOCOPY(==1) return values correctly by checking the valid return values seperately. Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Cc: Jiang Liu <liuj97@gmail.com> Cc: Keping Chen <chenkeping@huawei.com> Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/1333120296-13563-2-git-send-email-jiang.liu@huawei.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2012-03-30ACPI throttling: fix endian bug in acpi_read_throttling_status()Dan Carpenter1-3/+2
Using a u64 here creates an endian bug. We store a u32 number in the top byte which is a larger number than intended on big endian systems. There is no reason to use a 64 bit data type here, I guess it was just an oversight. I removed the initialization to zero as well. It's needed with a u64 but with a u32, the variable gets initialized properly inside the call to acpi_os_read_port(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30Disable MCP limit exceeded messages from Intel IPS driverAndi Kleen1-11/+2
On a system on the thermal limit these are quite noisy and flood the logs. Better would be a counter anyways. But given that we don't even have anything for normal throttling this doesn't seem to be urgent either. Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI video: Don't start video device until its associated input device has been allocatedIgor Murzov1-7/+8
Quoth Dmitry Torokhov: In addition to bus notifier we do install device notifier explicitly so it might fire up early. The easiest fox would be to move acpi_video_bus_start_devices() after input_allocate_device() but before input_register_device() - unregistered input devices can handle input_event() calls just fine. May fix crashes reported in: https://bugzilla.kernel.org/show_bug.cgi?id=40672 Signed-off-by: Igor Murzov <e-mail@date.by> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI video: Harden video bus adding.Igor Murzov1-15/+26
It is always better to check return values, so add some new checks and correct existing ones. v2: Be consistent and don't mix errors from -E* and AE_* namespaces. Signed-off-by: Igor Murzov <e-mail@date.by> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ia64: Fixup asm/cmpxchg.hDavid Howells1-1/+1
The empty asm/cmpxchg.h file that was provided as a temporary build fix for the asm/system.h disintgration build problem should really include <asm/intrinsics.h> to make definitions of xchg() and cmpxchg() available. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-03-30perf tools: Remove auto-generated bison/flex filesIngo Molnar9-8476/+30
These should not be in the Git history - they are auto-generated. Extend the Makefile rules of the parser files to include the generation run. Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/20120327183335.GA27621@gmail.com [ committer note: Fixed up O= handling ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-03-30scripts/patch-kernel: digest kernel.org hosted .xz patchesShawn Landden1-0/+4
kernel.org is hosting patches and kernel compressed with xz (lzma2+). Allow scripts/patch-kernel to decompress these files. Signed-off-by: Shawn Landden <shawnlandden@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-03-30merge_config.sh: Add option to display redundant configsJohn Stultz1-0/+9
Provide a -r option to display when fragments contain redundant options. This is really useful when breaking apart a config into fragments, as well as cleaning up older fragments. Signed-off-by: John Stultz <john.stultz@linaro.org> Acked-by: Darren Hart <dvhart@linux.intel.com> Acked-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-03-30merge_config.sh: Set execute bitJohn Stultz1-0/+0
Somehow the merge_config.sh script didn't get its execute bit set when it was merged. Fix this. Signed-off-by: John Stultz <john.stultz@linaro.org> Acked-by: Darren Hart <dvhart@linux.intel.com> Acked-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-03-30ACPI: Add support for exposing BGRT dataMatthew Garrett4-0/+205
ACPI 5.0 adds the BGRT, a table that contains a pointer to the firmware boot splash and associated metadata. This simple driver exposes it via /sys/firmware/acpi in order to allow bootsplash applications to draw their splash around the firmware image and reduce the number of jarring graphical transitions during boot. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI: export acpi_kobjMatthew Garrett1-0/+1
Drivers may wish to add entries to /sys/firmware/acpi, so export acpi_kobj in order to let them do that. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI: Fix logic for removing mappings in 'acpi_unmap'Myron Stowe1-1/+1
Make sure the removal of mappings uses the same logic that put the mappings in place. Signed-off-by: Myron Stowe <myron.stowe@redhat.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30CPER failed to handle generic error records with multiple sectionsJiang Liu1-0/+2
The function apei_estatus_print() and apei_estatus_check() forget to move ahead the gdata pointer when dealing with multiple generic error data sections. Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI: Clean redundant codes in scan.cAlex He1-4/+1
Clean the redundant codes of apci_bus_get_power_flags(). Signed-off-by: Alex He <alex.he@amd.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI: Fix unprotected smp_processor_id() in acpi_processor_cst_has_changed()Paul E. McKenney1-2/+1
The acpi_processor_cst_has_changed() function is invoked from a CPU_ONLINE or CPU_DEAD function, which might well execute on CPU 0 even though the CPU being hotplugged is some other CPU. In addition, acpi_processor_cst_has_changed() invokes smp_processor_id() without protection, resulting in splats when onlining CPUs. This commit therefore changes the smp_processor_id() to pr->id, as is used elsewhere in the code, for example, in acpi_processor_add(). Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Tested-by: Yong Zhang <yong.zhang0@gmail.com> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI: consistently use should_use_kmap()Jan Beulich1-1/+1
... so that acpi_unmap()'s behavior gets in sync with acpi_map()'s. Signed-off-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30[S390] Fix build errors (fallout from system.h disintegration)Heiko Carstens7-2/+9
Signed-off-by: Heiko Carstens <h.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2012-03-30PNPACPI: Fix device ref leaking in acpi_pnp_matchYinghai Lu1-1/+6
During testing pci root bus removal, found some root bus bridge is not freed. If booting with pnpacpi=off, those hostbridge could be freed without problem. It turns out that some devices reference are not released during acpi_pnp_match. that match should not hold one device ref during every calling. Add pu_device calling before returning. Signed-off-by: Yinghai Lu <yinghai@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI: Fix use-after-free in acpi_map_lsapicPetr Vandrovec1-1/+2
When processor is being hot-added to the system, acpi_map_lsapic invokes ACPI _MAT method to find APIC ID and flags, verifies that returned structure is indeed ACPI's local APIC structure, and that flags contain MADT_ENABLED bit. Then saves APIC ID, frees structure - and accesses structure when computing arguments for acpi_register_lapic call. Which sometime leads to acpi_register_lapic call being made with second argument zero, failing to bring processor online with error 'Unable to map lapic to logical cpu number'. As lapic->lapic_flags & ACPI_MADT_ENABLED was already confirmed to be non-zero few lines above, we can just pass unconditional ACPI_MADT_ENABLED to the acpi_register_lapic. Signed-off-by: Petr Vandrovec <petr@vmware.com> Signed-off-by: Alok N Kataria <akataria@vmware.com> Reviewed-by: Toshi Kani <toshi.kani@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI: processor_driver: add missing kfreeJulia Lawall1-4/+10
The function acpi_processor_add is stored in the ops.add field of a acpi_driver structure. This function is then called in acpi_bus_driver_init. On failure, this function clears the field device->driver_data, but does not free its contents. Thus the free has to be done by the add function. In acpi_processor_add, the corresponding value is pr. This value is currently freed on failure before storing it in device->driver_data, but not after. This free is added in the error handling code at the end of the function. The per_cpu variable processors is also cleared so that it does not refer to a dangling pointer. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Acked-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI, APEI: Fix incorrect APEI register bit width check and usageGary Hade1-21/+40
The current code incorrectly assumes that (1) the APEI register bit width is always 8, 16, 32, or 64 and (2) the APEI register bit width is always equal to the APEI register access width. ERST serialization instructions entries such as: [030h 0048 1] Action : 00 [Begin Write Operation] [031h 0049 1] Instruction : 03 [Write Register Value] [032h 0050 1] Flags (decoded below) : 01 Preserve Register Bits : 1 [033h 0051 1] Reserved : 00 [034h 0052 12] Register Region : [Generic Address Structure] [034h 0052 1] Space ID : 00 [SystemMemory] [035h 0053 1] Bit Width : 03 [036h 0054 1] Bit Offset : 00 [037h 0055 1] Encoded Access Width : 03 [DWord Access:32] [038h 0056 8] Address : 000000007F2D7038 [040h 0064 8] Value : 0000000000000001 [048h 0072 8] Mask : 0000000000000007 break this assumption by yielding: [Firmware Bug]: APEI: Invalid bit width in GAR [0x7f2d7038/3/0] I have found no ACPI specification requirements corresponding with the above assumptions. There is even a good example in the Serialization Instruction Entries section (ACPI 4.0 section 17.4,1.2, ACPI 4.0a section 2.5.1.2, ACPI 5.0 section 18.5.1.2) that mentions a serialization instruction with a bit range of [6:2] which is 5 bits wide, _not_ 8, 16, 32, or 64 bits wide. Compile and boot tested with 3.3.0-rc7 on a IBM HX5. Signed-off-by: Gary Hade <garyhade@us.ibm.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30Update documentation for parameter *notrigger* in einj.txtChen Gong1-0/+8
Add description of parameter notrigger in the einj.txt. One can utilize this new parameter to do some SRAR injection test. Pay attention, the operation is highly depended on the BIOS implementation. If no proper BIOS supports it, even if enabling this parameter, expected result will not happen. v2: Update the documentation suggested by Tony Suggested-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Chen Gong <gong.chen@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI, APEI, EINJ, new parameter to control trigger actionChen Gong1-3/+12
Some APEI firmware implementation will access injected address specified in param1 to trigger the error when injecting memory error, which means if one SRAR error is injected, the crash always happens because it is executed in kernel context. This new parameter can disable trigger action and control is taken over by the user. In this way, an SRAR error can happen in user context instead of crashing the system. This function is highly depended on BIOS implementation so please ensure you know the BIOS trigger procedure before you enable this switch. v2: notrigger should be created together with param1/param2 Tested-by: Tony Luck <tony.luck@lintel.com> Signed-off-by: Chen Gong <gong.chen@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI, APEI, EINJ, limit the range of einj_paramChen Gong1-1/+1
On the platforms with ACPI4.x support, parameter extension is not always doable, which means only parameter extension is enabled, einj_param can take effect. v2->v1: stopping early in einj_get_parameter_address for einj_param Signed-off-by: Chen Gong <gong.chen@linux.intel.com> Acked-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI, APEI, Fix ERST header length checkJiang Liu1-1/+1
This fixes a trivial copy & paste error in ERST header length check. It's just for future safety because sizeof(struct acpi_table_einj) equals to sizeof(struct acpi_table_erst) with current ACPI5.0 specification. It applies to v3.3-rc6. Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Acked-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30cpuidle: power_usage should be declared signed integerBoris Ostrovsky2-2/+2
power_usage is always assigned a negative value and should be declared a signed integer Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30idle, x86: Allow off-lined CPU to enter deeper C statesBoris Ostrovsky4-1/+67
Currently when a CPU is off-lined it enters either MWAIT-based idle or, if MWAIT is not desired or supported, HLT-based idle (which places the processor in C1 state). This patch allows processors without MWAIT support to stay in states deeper than C1. Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI: Add CPU hotplug support for processor device objectsToshi Kani1-10/+38
acpi_processor_install_hotplug_notify() registers processor objects to receive ACPI CPU hotplug event notifications. This patch additionally registers processor device objects (ACPI0007) to receive the notifications as well. Signed-off-by: Toshi Kani <toshi.kani@hp.com> Reviewed-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI / PM: print physical addresses consistently with other parts of kernelBjorn Helgaas1-2/+2
Print physical address info in a style consistent with the %pR style used elsewhere in the kernel. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI: Evaluate thermal trip points before reading temperatureMatthew Garrett1-4/+4
An HP laptop (Pavilion G4-1016tx) has the following code in _TMP: Store (\_SB.PCI0.LPCB.EC0.RTMP, Local0) If (LGreaterEqual (Local0, S4TP)) { Store (One, HTS4) } S4TP is initialised at 0 and not programmed further until either _HOT or _CRT is called. If we evaluate _TMP before the trip points then HTS4 will always be set, causing the firmware to generate a message on boot complaining that the system shut down because of overheating. The simplest solution is just to reverse the checking of trip points and _TMP in thermal init. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI, PCI: Move acpi_dev_run_wake() to ACPI coreLin Ming3-37/+43
acpi_dev_run_wake() is a generic function which can be used by other subsystem too. Rename it to acpi_pm_device_run_wake, to be consistent with acpi_pm_device_sleep_wake. Then move it to ACPI core. Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30cpuidle: remove unused 'governor_data' fieldDaniel Lezcano1-1/+0
As far as I can see, this field is never used in the code. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30cpuidle: remove useless array definition in cpuidle_structureDaniel Lezcano1-1/+1
All the modules name are ro-data, it is never copied to the array. eg. static struct cpuidle_driver intel_idle_driver = { .name = "intel_idle", .owner = THIS_MODULE, }; It safe to assign the pointer of this ro-data to a const char *. By this way we save 12 bytes. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com> Tested-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30cpuidle: use the driver's state_count as defaultDaniel Lezcano2-2/+2
If the state_count is not initialized for the device use the driver's state count as the default. That will prevent to add it manually in the cpuidle driver initialization routine and will save us from duplicate line of code. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30cpuidle: add a sysfs entry to disable specific C state for debug purpose.ShuoX Liu5-1/+51
Some C states of new CPU might be not good. One reason is BIOS might configure them incorrectly. To help developers root cause it quickly, the patch adds a new sysfs entry, so developers could disable specific C state manually. In addition, C state might have much impact on performance tuning, as it takes much time to enter/exit C states, which might delay interrupt processing. With the new debug option, developers could check if a deep C state could impact performance and how much impact it could cause. Also add this option in Documentation/cpuidle/sysfs.txt. [akpm@linux-foundation.org: check kstrtol return value] Signed-off-by: ShuoX Liu <shuox.liu@intel.com> Reviewed-by: Yanmin Zhang <yanmin_zhang@intel.com> Reviewed-and-Tested-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI: Add interface to register/unregister device to/from power resourcesLin Ming2-0/+164
Devices may share same list of power resources in _PR0, for example Device(Dev0) { Name (_PR0, Package (0x01) { P0PR, P1PR }) } Device(Dev1) { Name (_PR0, Package (0x01) { P0PR, P1PR } } Assume Dev0 and Dev1 were runtime suspended. Then Dev0 is resumed first and it goes into D0 state. But Dev1 is left in D0_Uninitialised state. This is wrong. In this case, Dev1 must be resumed too. In order to hand this case, each power resource maintains a list of devices which relies on it. When power resource is ON, it will check if the devices on its list can be resumed. The device can only be resumed when all the power resouces of its _PR0 are ON. Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI: Introduce ACPI D3_COLD state supportZhang Rui2-2/+9
If a device has _PR3, it means the device supports D3_COLD. Add the ability to validate and enter D3_COLD state in ACPI. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPICA: Update to version 20120320Bob Moore1-1/+1
Version 20120320. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPICA: Object repair code: Support to add Package wrappersBob Moore4-105/+64
Repair a common problem with objects that are defined to return a variable-length Package of sub-objects. If there is only one sub-object, some BIOS code mistakenly simply declares the single object instead of a Package with one sub-object. This function attempts to repair this error by wrapping a Package object around the original object, creating the correct and expected Package with one sub-object. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-29Input: wacom - check for allocation failure in probe()Dan Carpenter1-0/+2
We accidentally removed the check for NULL in 3aac0ef10b "Input: wacom - isolate input registration". Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Chris Bagwell <chris@cnpbagwell.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-03-30ACPI: Make ACPI interrupt threadedAndi Kleen1-1/+2
Some ACPI interrupt actions may need to wait, and it's easiest to have a thread context for this. So turn the ACPI interrupt into a threaded interrupt. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-30ACPI: ec: Do request_region outside WARN()Andi Kleen1-4/+4
WARN() is not supposed to have side effects, so move the request_regions outside. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-29sparc: Fix even more fallout from system.h split.David S. Miller2-0/+3
jump_label.c needs asm/cacheflush.h to get flushi(). kgdb_64.c needs asm/cacheflush.h to get flushw_all(). Signed-off-by: David S. Miller <davem@davemloft.net>
2012-03-29sparc: fix fallout from system.h splitStephen Rothwell1-0/+1
Fixes this build error: kernel/signal.c: In function 'ptrace_stop': kernel/signal.c:1860:3: error: implicit declaration of function 'synchronize_user_stack' [-Werror=implicit-function-declaration] Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-03-29cgroup: cgroup_attach_task() could return -errno after successTejun Heo1-1/+1
61d1d219c4 "cgroup: remove extra calls to find_existing_css_set" made cgroup_task_migrate() return void. An unfortunate side effect was that cgroup_attach_task() was depending on that function's return value to clear its @retval on the success path. On cgroup mounts without any subsystem with ->can_attach() callback, cgroup_attach_task() ended up returning @retval without initializing it on success. For some reason, gcc failed to warn about it and it didn't cause cgroup_attach_task() to return non-zero value in many cases, probably due to difference in register allocation. When the problem materializes, systemd fails to populate /systemd cgroup mount and fails to boot. Fix it by initializing @retval to zero on declaration. Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: Jiri Kosina <jkosina@suse.cz> LKML-Reference: <alpine.LNX.2.00.1203282354440.25526@pobox.suse.cz> Reviewed-by: Mandeep Singh Baines <msb@chromium.org> Acked-by: Li Zefan <lizefan@huawei.com>
2012-03-29tools turbostat: harden against cpu online/offlineLen Brown1-54/+61
Sometimes users have turbostat running in interval mode when they take processors offline/online. Previously, turbostat would survive, but not gracefully. Tighten up the error checking so turbostat notices changesn sooner, and print just 1 line on change: turbostat: re-initialized with num_cpus %d Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-29tools turbostat: reduce measurement overhead due to IPIsLen Brown1-0/+46
turbostat uses /dev/cpu/*/msr interface to read MSRs. For modern systems, it reads 10 MSR/CPU. This can be observed as 10 "Function Call Interrupts" per CPU per sample added to /proc/interrupts. This overhead is measurable on large idle systems, and as Yoquan Song pointed out, it can even trick cpuidle into thinking the system is busy. Here turbostat re-schedules itself in-turn to each CPU so that its MSR reads will always be local. This replaces the 10 "Function Call Interrupts" with a single "Rescheduling interrupt" per sample per CPU. On an idle 32-CPU system, this shifts some residency from the shallow c1 state to the deeper c7 state: # ./turbostat.old -s %c0 GHz TSC %c1 %c3 %c6 %c7 %pc2 %pc3 %pc6 %pc7 0.27 1.29 2.29 0.95 0.02 0.00 98.77 20.23 0.00 77.41 0.00 0.25 1.24 2.29 0.98 0.02 0.00 98.75 20.34 0.03 77.74 0.00 0.27 1.22 2.29 0.54 0.00 0.00 99.18 20.64 0.00 77.70 0.00 0.26 1.22 2.29 1.22 0.00 0.00 98.52 20.22 0.00 77.74 0.00 0.26 1.38 2.29 0.78 0.02 0.00 98.95 20.51 0.05 77.56 0.00 ^C i# ./turbostat.new -s %c0 GHz TSC %c1 %c3 %c6 %c7 %pc2 %pc3 %pc6 %pc7 0.27 1.20 2.29 0.24 0.01 0.00 99.49 20.58 0.00 78.20 0.00 0.27 1.22 2.29 0.25 0.00 0.00 99.48 20.79 0.00 77.85 0.00 0.27 1.20 2.29 0.25 0.02 0.00 99.46 20.71 0.03 77.89 0.00 0.28 1.26 2.29 0.25 0.01 0.00 99.46 20.89 0.02 77.67 0.00 0.27 1.20 2.29 0.24 0.01 0.00 99.48 20.65 0.00 78.04 0.00 cc: Youquan Song <youquan.song@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>