<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/kernel/sched.c, branch T30_LinuxImageV2.0Beta2_20130626</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>scheduler: Re-compute time-average nr_running on read</title>
<updated>2012-07-01T16:15:19+00:00</updated>
<author>
<name>Alex Frid</name>
<email>afrid@nvidia.com</email>
</author>
<published>2012-05-18T19:18:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1802afb2ad9ee1b6c1e11207f3fcdd3a56a1e0f0'/>
<id>1802afb2ad9ee1b6c1e11207f3fcdd3a56a1e0f0</id>
<content type='text'>
Re-compute time-average nr_running when it is read. This would
prevent reading stalled average value if there were no run-queue
changes for a long time. New average value is returned to the reader,
but not stored to avoid concurrent writes. Light-weight sequential
counter synchronization is used to assure data consistency for
re-computing average.

Change-Id: I8e4ea1b28ea00b3ddaf6ef7cdcd27866f87d360b
Signed-off-by: Alex Frid &lt;afrid@nvidia.com&gt;
(cherry picked from commit 527a759d9b40bf57958eb002edd2bb82014dab99)
Reviewed-on: http://git-master/r/111637
Reviewed-by: Sai Gurrappadi &lt;sgurrappadi@nvidia.com&gt;
Tested-by: Sai Gurrappadi &lt;sgurrappadi@nvidia.com&gt;
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Peter Boonstoppel &lt;pboonstoppel@nvidia.com&gt;
Reviewed-by: Yu-Huan Hsu &lt;yhsu@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Re-compute time-average nr_running when it is read. This would
prevent reading stalled average value if there were no run-queue
changes for a long time. New average value is returned to the reader,
but not stored to avoid concurrent writes. Light-weight sequential
counter synchronization is used to assure data consistency for
re-computing average.

Change-Id: I8e4ea1b28ea00b3ddaf6ef7cdcd27866f87d360b
Signed-off-by: Alex Frid &lt;afrid@nvidia.com&gt;
(cherry picked from commit 527a759d9b40bf57958eb002edd2bb82014dab99)
Reviewed-on: http://git-master/r/111637
Reviewed-by: Sai Gurrappadi &lt;sgurrappadi@nvidia.com&gt;
Tested-by: Sai Gurrappadi &lt;sgurrappadi@nvidia.com&gt;
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Peter Boonstoppel &lt;pboonstoppel@nvidia.com&gt;
Reviewed-by: Yu-Huan Hsu &lt;yhsu@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scheduler: compute time-average nr_running per run-queue</title>
<updated>2012-07-01T16:15:12+00:00</updated>
<author>
<name>Diwakar Tundlam</name>
<email>dtundlam@nvidia.com</email>
</author>
<published>2012-05-07T22:12:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0b5a8a6f30fe0eb7919294c58ddedaeab069ce2a'/>
<id>0b5a8a6f30fe0eb7919294c58ddedaeab069ce2a</id>
<content type='text'>
Compute the time-average number of running tasks per run-queue for a
trailing window of a fixed time period. The detla add/sub to the
average value is weighted by the amount of time per nr_running value
relative to the total measurement period.

Change-Id: I076e24ff4ed65bed3b8dd8d2b279a503318071ff
Signed-off-by: Diwakar Tundlam &lt;dtundlam@nvidia.com&gt;
(cherry picked from commit 3a12d7499cee352e8a46eaf700259ba3c733f0e3)
Reviewed-on: http://git-master/r/111635
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sai Gurrappadi &lt;sgurrappadi@nvidia.com&gt;
Tested-by: Sai Gurrappadi &lt;sgurrappadi@nvidia.com&gt;
Reviewed-by: Peter Boonstoppel &lt;pboonstoppel@nvidia.com&gt;
Reviewed-by: Yu-Huan Hsu &lt;yhsu@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Compute the time-average number of running tasks per run-queue for a
trailing window of a fixed time period. The detla add/sub to the
average value is weighted by the amount of time per nr_running value
relative to the total measurement period.

Change-Id: I076e24ff4ed65bed3b8dd8d2b279a503318071ff
Signed-off-by: Diwakar Tundlam &lt;dtundlam@nvidia.com&gt;
(cherry picked from commit 3a12d7499cee352e8a46eaf700259ba3c733f0e3)
Reviewed-on: http://git-master/r/111635
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sai Gurrappadi &lt;sgurrappadi@nvidia.com&gt;
Tested-by: Sai Gurrappadi &lt;sgurrappadi@nvidia.com&gt;
Reviewed-by: Peter Boonstoppel &lt;pboonstoppel@nvidia.com&gt;
Reviewed-by: Yu-Huan Hsu &lt;yhsu@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scheduler: domain: init next_balance in nohz_idle_balancer with jiffies</title>
<updated>2012-01-30T19:46:41+00:00</updated>
<author>
<name>Diwakar Tundlam</name>
<email>dtundlam@nvidia.com</email>
</author>
<published>2012-01-19T02:58:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d407746008e167f8d125dc6e12040a553e90f96d'/>
<id>d407746008e167f8d125dc6e12040a553e90f96d</id>
<content type='text'>
Bug 878165

The next_balance parameter of nohz_idle_balancer should be initialized
to jiffies since jiffies itself is initialized to 300 seconds shy of
overflow. Otherwise, nohz_idle_balancer does not run for the first 5
mins after bootup.

Change-Id: I18334451f394ead8ddad3b94d725635a31e0173b
Signed-off-by: Diwakar Tundlam &lt;dtundlam@nvidia.com&gt;
Signed-off-by: Varun Wadekar &lt;vwadekar@nvidia.com&gt;
Reviewed-on: http://git-master/r/77300
Reviewed-by: Automatic_Commit_Validation_User
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bug 878165

The next_balance parameter of nohz_idle_balancer should be initialized
to jiffies since jiffies itself is initialized to 300 seconds shy of
overflow. Otherwise, nohz_idle_balancer does not run for the first 5
mins after bootup.

Change-Id: I18334451f394ead8ddad3b94d725635a31e0173b
Signed-off-by: Diwakar Tundlam &lt;dtundlam@nvidia.com&gt;
Signed-off-by: Varun Wadekar &lt;vwadekar@nvidia.com&gt;
Reviewed-on: http://git-master/r/77300
Reviewed-by: Automatic_Commit_Validation_User
</pre>
</div>
</content>
</entry>
<entry>
<title>cpu-hotplug: CPUx should be active before it is marked online</title>
<updated>2011-12-27T05:28:19+00:00</updated>
<author>
<name>Varun Wadekar</name>
<email>vwadekar@nvidia.com</email>
</author>
<published>2011-12-26T11:20:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=66fa0f6523f8013b9f60af94bebbcc216f367a67'/>
<id>66fa0f6523f8013b9f60af94bebbcc216f367a67</id>
<content type='text'>
CPU0		CPUn

_cpu_up()
  __cpu_up()

		boostrap()
		  notify_cpu_starting()
		  set_cpu_online()
		  while (!cpu_active())
		    cpu_relax()

&lt;PREEMPT-out&gt;

smp_call_function(.wait=1)
  /* we find cpu_online() is true */
  arch_send_call_function_ipi_mask()
  /* wait-forever-more */
&lt;PREEMPT-in&gt;
		  local_irq_enable()

  cpu_notify(CPU_ONLINE)
    sched_cpu_active()
      set_cpu_active()

Now the purpose of cpu_active is mostly with bringing down a cpu, where
we mark it !active to avoid the load-balancer from moving tasks to it
while we tear down the cpu. This is required because we only update the
sched_domain tree after we brought the cpu-down. And this is needed so
that some tasks can still run while we bring it down, we just don't want
new tasks to appear.

On cpu-up however the sched_domain tree doesn't yet include the new cpu,
so its invisible to the load-balancer, regardless of the active state.
So instead of setting the active state after we boot the new cpu (and
consequently having to wait for it before enabling interrupts) set the
cpu active before we set it online and avoid the whole mess.

Bug 916986

Original Patch: https://lkml.org/lkml/2011/12/15/255

Change-Id: Ia1c07bdc1b3eb07a7cd4d69756fa7bec509c9400
Reported-by: Stepan Moskovchenko &lt;stepanm@codeaurora.org&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Varun Wadekar &lt;vwadekar@nvidia.com&gt;
Reviewed-on: http://git-master/r/72130
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mayuresh Kulkarni &lt;mkulkarni@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CPU0		CPUn

_cpu_up()
  __cpu_up()

		boostrap()
		  notify_cpu_starting()
		  set_cpu_online()
		  while (!cpu_active())
		    cpu_relax()

&lt;PREEMPT-out&gt;

smp_call_function(.wait=1)
  /* we find cpu_online() is true */
  arch_send_call_function_ipi_mask()
  /* wait-forever-more */
&lt;PREEMPT-in&gt;
		  local_irq_enable()

  cpu_notify(CPU_ONLINE)
    sched_cpu_active()
      set_cpu_active()

Now the purpose of cpu_active is mostly with bringing down a cpu, where
we mark it !active to avoid the load-balancer from moving tasks to it
while we tear down the cpu. This is required because we only update the
sched_domain tree after we brought the cpu-down. And this is needed so
that some tasks can still run while we bring it down, we just don't want
new tasks to appear.

On cpu-up however the sched_domain tree doesn't yet include the new cpu,
so its invisible to the load-balancer, regardless of the active state.
So instead of setting the active state after we boot the new cpu (and
consequently having to wait for it before enabling interrupts) set the
cpu active before we set it online and avoid the whole mess.

Bug 916986

Original Patch: https://lkml.org/lkml/2011/12/15/255

Change-Id: Ia1c07bdc1b3eb07a7cd4d69756fa7bec509c9400
Reported-by: Stepan Moskovchenko &lt;stepanm@codeaurora.org&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Varun Wadekar &lt;vwadekar@nvidia.com&gt;
Reviewed-on: http://git-master/r/72130
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mayuresh Kulkarni &lt;mkulkarni@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cgroup: Add generic cgroup subsystem permission checks</title>
<updated>2011-12-01T05:38:49+00:00</updated>
<author>
<name>Colin Cross</name>
<email>ccross@android.com</email>
</author>
<published>2011-07-13T02:53:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a237ee7830a0445a27af7fd24bdc3414b9553d35'/>
<id>a237ee7830a0445a27af7fd24bdc3414b9553d35</id>
<content type='text'>
Rather than using explicit euid == 0 checks when trying to move
tasks into a cgroup via CFS, move permission checks into each
specific cgroup subsystem. If a subsystem does not specify a
'allow_attach' handler, then we fall back to doing our checks
the old way.

Use the 'allow_attach' handler for the 'cpu' cgroup to allow
non-root processes to add arbitrary processes to a 'cpu' cgroup
if it has the CAP_SYS_NICE capability set.

This version of the patch adds a 'allow_attach' handler instead
of reusing the 'can_attach' handler.  If the 'can_attach' handler
is reused, a new cgroup that implements 'can_attach' but not
the permission checks could end up with no permission checks
at all.

Change-Id: Icfa950aa9321d1ceba362061d32dc7dfa2c64f0c
Original-Author: San Mehat &lt;san@google.com&gt;
Signed-off-by: Colin Cross &lt;ccross@android.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rather than using explicit euid == 0 checks when trying to move
tasks into a cgroup via CFS, move permission checks into each
specific cgroup subsystem. If a subsystem does not specify a
'allow_attach' handler, then we fall back to doing our checks
the old way.

Use the 'allow_attach' handler for the 'cpu' cgroup to allow
non-root processes to add arbitrary processes to a 'cpu' cgroup
if it has the CAP_SYS_NICE capability set.

This version of the patch adds a 'allow_attach' handler instead
of reusing the 'can_attach' handler.  If the 'can_attach' handler
is reused, a new cgroup that implements 'can_attach' but not
the permission checks could end up with no permission checks
at all.

Change-Id: Icfa950aa9321d1ceba362061d32dc7dfa2c64f0c
Original-Author: San Mehat &lt;san@google.com&gt;
Signed-off-by: Colin Cross &lt;ccross@android.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "cgroup: Add generic cgroup subsystem permission checks."</title>
<updated>2011-12-01T05:38:49+00:00</updated>
<author>
<name>Colin Cross</name>
<email>ccross@android.com</email>
</author>
<published>2011-07-13T03:12:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f971f6c015d74c9653a15fa1357144ead2ff7e7e'/>
<id>f971f6c015d74c9653a15fa1357144ead2ff7e7e</id>
<content type='text'>
This reverts commit 1d38bc7d0523af2233b4280e2aeab34c6a076665.

Change-Id: I2c5066b696cbdd5ca117ed74718bcb7e70e878e7
Signed-off-by: Colin Cross &lt;ccross@android.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 1d38bc7d0523af2233b4280e2aeab34c6a076665.

Change-Id: I2c5066b696cbdd5ca117ed74718bcb7e70e878e7
Signed-off-by: Colin Cross &lt;ccross@android.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scheduler: cpuacct: Enable platform callbacks for cpuacct power tracking</title>
<updated>2011-12-01T05:38:19+00:00</updated>
<author>
<name>Mike Chan</name>
<email>mike@android.com</email>
</author>
<published>2010-05-12T22:52:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6c0d4dd0527f87230469a088b3b51823a96de7ce'/>
<id>6c0d4dd0527f87230469a088b3b51823a96de7ce</id>
<content type='text'>
Platform must register cpu power function that return power in
milliWatt seconds.

Change-Id: I1caa0335e316c352eee3b1ddf326fcd4942bcbe8
Signed-off-by: Mike Chan &lt;mike@android.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Platform must register cpu power function that return power in
milliWatt seconds.

Change-Id: I1caa0335e316c352eee3b1ddf326fcd4942bcbe8
Signed-off-by: Mike Chan &lt;mike@android.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scheduler: cpuacct: Enable platform hooks to track cpuusage for CPU frequencies</title>
<updated>2011-12-01T05:38:19+00:00</updated>
<author>
<name>Mike Chan</name>
<email>mike@android.com</email>
</author>
<published>2010-05-11T00:54:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9075fa48d0b4453038b53a12d2a474312bf68742'/>
<id>9075fa48d0b4453038b53a12d2a474312bf68742</id>
<content type='text'>
Introduce new platform callback hooks for cpuacct for tracking CPU frequencies

Not all platforms / architectures have a set CPU_FREQ_TABLE defined
for CPU transition speeds. In order to track time spent in at various
CPU frequencies, we enable platform callbacks from cpuacct for this accounting.

Architectures that support overclock boosting, or don't have pre-defined
frequency tables can implement their own bucketing system that makes sense
given their cpufreq scaling abilities.

New file:
cpuacct.cpufreq reports the CPU time (in nanoseconds) spent at each CPU
frequency.

Change-Id: I10a80b3162e6fff3a8a2f74dd6bb37e88b12ba96
Signed-off-by: Mike Chan &lt;mike@android.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce new platform callback hooks for cpuacct for tracking CPU frequencies

Not all platforms / architectures have a set CPU_FREQ_TABLE defined
for CPU transition speeds. In order to track time spent in at various
CPU frequencies, we enable platform callbacks from cpuacct for this accounting.

Architectures that support overclock boosting, or don't have pre-defined
frequency tables can implement their own bucketing system that makes sense
given their cpufreq scaling abilities.

New file:
cpuacct.cpufreq reports the CPU time (in nanoseconds) spent at each CPU
frequency.

Change-Id: I10a80b3162e6fff3a8a2f74dd6bb37e88b12ba96
Signed-off-by: Mike Chan &lt;mike@android.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cgroup: Add generic cgroup subsystem permission checks.</title>
<updated>2011-12-01T05:38:10+00:00</updated>
<author>
<name>San Mehat</name>
<email>san@google.com</email>
</author>
<published>2009-05-21T21:10:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e84e563ae2ed297d5d35d8da3b7302384ff6c7da'/>
<id>e84e563ae2ed297d5d35d8da3b7302384ff6c7da</id>
<content type='text'>
    Rather than using explicit euid == 0 checks when trying to move
tasks into a cgroup via CFS, move permission checks into each
specific cgroup subsystem. If a subsystem does not specify a
'can_attach' handler, then we fall back to doing our checks the old way.

    This way non-root processes can add arbitrary processes to
a cgroup if all the registered subsystems on that cgroup agree.

    Also change explicit euid == 0 check to CAP_SYS_ADMIN

Signed-off-by: San Mehat &lt;san@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
    Rather than using explicit euid == 0 checks when trying to move
tasks into a cgroup via CFS, move permission checks into each
specific cgroup subsystem. If a subsystem does not specify a
'can_attach' handler, then we fall back to doing our checks the old way.

    This way non-root processes can add arbitrary processes to
a cgroup if all the registered subsystems on that cgroup agree.

    Also change explicit euid == 0 check to CAP_SYS_ADMIN

Signed-off-by: San Mehat &lt;san@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sched: Enable might_sleep before initializing drivers.</title>
<updated>2011-12-01T05:37:51+00:00</updated>
<author>
<name>Arve Hjønnevåg</name>
<email>arve@android.com</email>
</author>
<published>2008-12-11T04:06:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6bd233df04316d8d3ef8445a4c45f8b8afda42d9'/>
<id>6bd233df04316d8d3ef8445a4c45f8b8afda42d9</id>
<content type='text'>
This allows detection of init bugs in built-in drivers.

Signed-off-by: Arve Hjønnevåg &lt;arve@android.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows detection of init bugs in built-in drivers.

Signed-off-by: Arve Hjønnevåg &lt;arve@android.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
