<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/acpi/acpi_pad.c, branch linux-4.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-05-30T05:49:09Z</updated>
<entry>
<title>ACPI: acpi_pad: Fix memory leak in power saving threads</title>
<updated>2018-05-30T05:49:09Z</updated>
<author>
<name>Lenny Szubowicz</name>
</author>
<published>2018-03-27T13:56:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=30ae62408145d5207e0b419403d30b97b2721f64'/>
<id>urn:sha1:30ae62408145d5207e0b419403d30b97b2721f64</id>
<content type='text'>
[ Upstream commit 8b29d29abc484d638213dd79a18a95ae7e5bb402 ]

Fix once per second (round_robin_time) memory leak of about 1 KB in
each acpi_pad kernel idling thread that is activated.

Found by testing with kmemleak.

Signed-off-by: Lenny Szubowicz &lt;lszubowi@redhat.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ACPI / PAD: power_saving_thread() is not freezable</title>
<updated>2015-10-26T03:42:54Z</updated>
<author>
<name>Jiri Kosina</name>
</author>
<published>2015-10-26T03:02:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=21657471688508ced523b3bf0a763d73d546ad1a'/>
<id>urn:sha1:21657471688508ced523b3bf0a763d73d546ad1a</id>
<content type='text'>
power_saving_thread() calls try_to_freeze(), but the thread doesn't mark
itself freezable through set_freezable(), so the try_to_freeze()
call is useless.

Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: Remove FSF mailing addresses</title>
<updated>2015-07-08T00:27:32Z</updated>
<author>
<name>Jarkko Nikula</name>
</author>
<published>2015-06-26T08:27:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4c62dbbce902cf2afa88cac89ec67c828160f431'/>
<id>urn:sha1:4c62dbbce902cf2afa88cac89ec67c828160f431</id>
<content type='text'>
There is no need to carry potentially outdated Free Software Foundation
mailing address in file headers since the COPYING file includes it.

Signed-off-by: Jarkko Nikula &lt;jarkko.nikula@linux.intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>sched/topology: Rename topology_thread_cpumask() to topology_sibling_cpumask()</title>
<updated>2015-05-27T13:22:15Z</updated>
<author>
<name>Bartosz Golaszewski</name>
</author>
<published>2015-05-26T13:11:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=06931e62246844c73fba24d7aeb4a5dc897a2739'/>
<id>urn:sha1:06931e62246844c73fba24d7aeb4a5dc897a2739</id>
<content type='text'>
Rename topology_thread_cpumask() to topology_sibling_cpumask()
for more consistency with scheduler code.

Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
Reviewed-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Benoit Cousson &lt;bcousson@baylibre.com&gt;
Cc: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Cc: Guenter Roeck &lt;linux@roeck-us.net&gt;
Cc: Jean Delvare &lt;jdelvare@suse.de&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Oleg Drokin &lt;oleg.drokin@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Rafael J. Wysocki &lt;rjw@rjwysocki.net&gt;
Cc: Russell King &lt;linux@arm.linux.org.uk&gt;
Cc: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Link: http://lkml.kernel.org/r/1432645896-12588-2-git-send-email-bgolaszewski@baylibre.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>ACPI/PAD: Use explicit broadcast oneshot control function</title>
<updated>2015-04-03T06:44:34Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2015-04-03T00:06:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c79521354e71a1fbcee040ee3147cadc0f8e3c97'/>
<id>urn:sha1:c79521354e71a1fbcee040ee3147cadc0f8e3c97</id>
<content type='text'>
Replace the clockevents_notify() call with an explicit function call.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Cc: Len Brown &lt;lenb@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/1552509.UntNmyqF5v@vostro.rjw.lan
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>ACPI/PAD: Use explicit broadcast control function</title>
<updated>2015-04-03T06:44:32Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2015-04-03T00:01:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=979081e7440056da28b19e57acf20098caf49103'/>
<id>urn:sha1:979081e7440056da28b19e57acf20098caf49103</id>
<content type='text'>
Replace the clockevents_notify() call with an explicit function call.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Cc: Len Brown &lt;lenb@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/1521832.mm0ZfkTzTA@vostro.rjw.lan
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>ACPI/PAD: Remove the local APIC nonsense</title>
<updated>2015-04-03T06:44:31Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2015-04-02T23:46:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3ff70551a942b4c1d3c2e96e31a5c6e369a6d0be'/>
<id>urn:sha1:3ff70551a942b4c1d3c2e96e31a5c6e369a6d0be</id>
<content type='text'>
While looking through the (ab)use of the clockevents_notify()
function I stumbled over the following gem in the acpi_pad code:

  if (lapic_detected_unstable &amp;&amp; !lapic_marked_unstable) {
     /* LAPIC could halt in idle, so notify users */
     for_each_online_cpu(i)
       clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &amp;i);
     lapic_marked_unstable = 1;
  }

This code calls on the cpu which detects the lapic unstable
condition first clockevents_notify() to tell the core code that
the broadcast should be enabled on all online cpus. Brilliant
stuff that as it notifies the core code a num_online_cpus()
times that the broadcast should be enabled on the current cpu.

This probably has never been noticed because that code got never
tested with NOHZ=n and HIGHRES_TIMER=n or it just worked by
chance because one of the other mechanisms told the core in the
right way that the local apic timer is wreckaged.

Sigh, this is:

 - The 4th incarnation of idle drivers which has their own mechanism
   to detect and deal with X86_FEATURE_ARAT.

 - The 2nd incarnation of fake idle mechanisms with a different set of
   brainmelting bugs.

 - Has been merged against an explicit NAK of the scheduler
   maintainer with the promise to improve it over time.

 - Another example of featuritis driven trainwreck engineering.

 - Another pointless waste of my time.

Fix this nonsense by removing that lapic detection and
notification logic and simply call into the clockevents code
unconditonally. The ARAT feature is marked in the lapic
clockevent already so the core code will just ignore the
requests and return.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/1887788.RObRuI4tSv@vostro.rjw.lan
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>cpumask: factor out show_cpumap into separate helper function</title>
<updated>2014-11-07T19:45:00Z</updated>
<author>
<name>Sudeep Holla</name>
</author>
<published>2014-09-30T13:48:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5aaba36318e5995e8c95d077a46d9a4d00fcc1cd'/>
<id>urn:sha1:5aaba36318e5995e8c95d077a46d9a4d00fcc1cd</id>
<content type='text'>
Many sysfs *_show function use cpu{list,mask}_scnprintf to copy cpumap
to the buffer aligned to PAGE_SIZE, append '\n' and '\0' to return null
terminated buffer with newline.

This patch creates a new helper function cpumap_print_to_pagebuf in
cpumask.h using newly added bitmap_print_to_pagebuf and consolidates
most of those sysfs functions using the new helper function.

Signed-off-by: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Suggested-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Tested-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Acked-by: "Rafael J. Wysocki" &lt;rjw@rjwysocki.net&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: x86@kernel.org
Cc: linux-acpi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ACPI / PAD: Use time_before() for time comparison</title>
<updated>2014-05-26T23:38:23Z</updated>
<author>
<name>Manuel Schölling</name>
</author>
<published>2014-05-22T20:56:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4ff248f3bf830ba22c988abb099e1836fbd3b1d0'/>
<id>urn:sha1:4ff248f3bf830ba22c988abb099e1836fbd3b1d0</id>
<content type='text'>
To be future-proof and for better readability the time comparisons are
modified to use time_before() instead of plain, error-prone math.

Signed-off-by: Manuel Schölling &lt;manuel.schoelling@gmx.de&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI / PAD: call schedule() when need_resched() is true</title>
<updated>2014-04-28T10:26:00Z</updated>
<author>
<name>Tony Camuso</name>
</author>
<published>2014-04-25T18:19:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5b59c69ec54849f23b51d18b0a609c4f793bc35a'/>
<id>urn:sha1:5b59c69ec54849f23b51d18b0a609c4f793bc35a</id>
<content type='text'>
The purpose of the acpi_pad driver is to implement the "processor power
aggregator" device as described in the ACPI 4.0 spec section 8.5. It
takes requests from the BIOS (via ACPI) to put a specified number of
CPUs into idle, in order to save power, until further notice.

It does this by creating high-priority threads that try to keep the CPUs
in a high C-state (using the monitor/mwait CPU instructions). The
mwait() call is in a loop that checks periodically if the thread should
end and a few other things.

It was discovered through testing that the power_saving threads were
causing the system to consume more power than the system was consuming
before the threads were created. A counter in the main loop of
power_saving_thread() revealed that it was spinning. The mwait()
instruction was not keeping the CPU in a high C state very much if at
all.

Here is a simplification of the loop in function power_saving_thread() in
drivers/acpi/acpi_pad.c

    while (!kthread_should_stop()) {
         :
        try_to_freeze()
         :
        while (!need_resched()) {
             :
            if (!need_resched())
                __mwait(power_saving_mwait_eax, 1);
             :
            if (jiffies &gt; expire_time) {
                do_sleep = 1;
                break;
            }
        }
    }

If need_resched() returns true, then mwait() is not called. It was
returning true because of things like timer interrupts, as in the
following sequence.

hrtimer_interrupt-&gt;__run_hrtimer-&gt;tick_sched_timer-&gt; update_process_times-&gt;
rcu_check_callbacks-&gt;rcu_pending-&gt;__rcu_pending-&gt;set_need_resched

Kernels 3.5.0-rc2+ do not exhibit this problem, because a patch to
try_to_freeze() in include/linux/freezer.h introduces a call to
might_sleep(), which ultimately calls schedule() to clear the reschedule
flag and allows the the loop to execute the call to mwait().

However, the changes to try_to_freeze are unrelated to acpi_pad, and it
does not seem like a good idea to rely on an unrelated patch in a
function that could later be changed and reintroduce this bug.

Therefore, it seems better to make an explicit call to schedule() in the
outer loop when the need_resched flag is set.

Reported-and-tested-by: Stuart Hayes &lt;stuart_hayes@dell.com&gt;
Signed-off-by: Tony Camuso &lt;tcamuso@redhat.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
