<feed xmlns='http://www.w3.org/2005/Atom'>
<title>xavi/android_kernel_m2note/kernel/workqueue.c, branch o-8.1</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://gitea.privatedns.org/xavi/android_kernel_m2note/atom?h=o-8.1</id>
<link rel='self' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/atom?h=o-8.1'/>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/'/>
<updated>2017-12-05T17:08:35+00:00</updated>
<entry>
<title>workqueue: allow work_on_cpu() to be called recursively</title>
<updated>2017-12-05T17:08:35+00:00</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2013-07-24T10:31:42+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=139bbba486195276ac40449bb6364d1db0dd99de'/>
<id>urn:sha1:139bbba486195276ac40449bb6364d1db0dd99de</id>
<content type='text'>
If the @fn call work_on_cpu() again, the lockdep will complain:

&gt; [ INFO: possible recursive locking detected ]
&gt; 3.11.0-rc1-lockdep-fix-a #6 Not tainted
&gt; ---------------------------------------------
&gt; kworker/0:1/142 is trying to acquire lock:
&gt;  ((&amp;wfc.work)){+.+.+.}, at: [&lt;ffffffff81077100&gt;] flush_work+0x0/0xb0
&gt;
&gt; but task is already holding lock:
&gt;  ((&amp;wfc.work)){+.+.+.}, at: [&lt;ffffffff81075dd9&gt;] process_one_work+0x169/0x610
&gt;
&gt; other info that might help us debug this:
&gt;  Possible unsafe locking scenario:
&gt;
&gt;        CPU0
&gt;        ----
&gt;   lock((&amp;wfc.work));
&gt;   lock((&amp;wfc.work));
&gt;
&gt;  *** DEADLOCK ***

It is false-positive lockdep report. In this sutiation,
the two "wfc"s of the two work_on_cpu() are different,
they are both on stack. flush_work() can't be deadlock.

To fix this, we need to avoid the lockdep checking in this case,
thus we instroduce a internal __flush_work() which skip the lockdep.

tj: Minor comment adjustment.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Reported-by: "Srivatsa S. Bhat" &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Reported-by: Alexander Duyck &lt;alexander.h.duyck@intel.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>workqueue: move flush_scheduled_work() to workqueue.h</title>
<updated>2017-12-05T17:08:32+00:00</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2015-05-20T06:41:19+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=a9779640078264a6c825e56030fc1c24572bb5c0'/>
<id>urn:sha1:a9779640078264a6c825e56030fc1c24572bb5c0</id>
<content type='text'>
flush_scheduled_work() is just a simple call to flush_work().

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>kernel/workqueue.c: pr_warning/pr_warn &amp; printk/pr_info</title>
<updated>2017-12-05T17:08:32+00:00</updated>
<author>
<name>Fabian Frederick</name>
<email>fabf@skynet.be</email>
</author>
<published>2014-05-12T17:59:35+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=4431a775e86431609b1e18cc19256b1a60180fa9'/>
<id>urn:sha1:4431a775e86431609b1e18cc19256b1a60180fa9</id>
<content type='text'>
tj: Refreshed on top of wq/for-3.16.

Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>workqueue: simplify wq_update_unbound_numa() by jumping to use_dfl_pwq if the target cpumask equals wq's</title>
<updated>2017-12-05T17:08:31+00:00</updated>
<author>
<name>Daeseok Youn</name>
<email>daeseok.youn@gmail.com</email>
</author>
<published>2014-04-18T00:08:14+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=9a7082532a4e580b917996e8681d608ff1657da2'/>
<id>urn:sha1:9a7082532a4e580b917996e8681d608ff1657da2</id>
<content type='text'>
wq_update_unbound_numa(), when it's decided that the newly updated
cpumask equals the default, looks at whether the current pwq is
already the default one and skips setting pwq to the default one.
This extra step is unnecessary and we can always jump to use_dfl_pwq
instead. Simplify the code by removing the conditional.
This doesn't make any functional difference.

Signed-off-by: Daeseok Youn &lt;daeseok.youn@gmail.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>workqueue: wake regular worker if need_more_worker() when rescuer leave the pool</title>
<updated>2017-12-05T17:08:30+00:00</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2014-07-16T06:56:36+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=64d548dd53c28f6f76eeb3d853181c7cdc40a0ad'/>
<id>urn:sha1:64d548dd53c28f6f76eeb3d853181c7cdc40a0ad</id>
<content type='text'>
We don't need to wake up regular worker when nr_running==1,
so need_more_worker() is sufficient here.

And need_more_worker() gives us better readability due to the name of
"keep_working()" implies the rescuer should keep working now but
the rescuer is actually leaving.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>workqueue: alloc struct worker on its local node</title>
<updated>2017-12-05T17:08:30+00:00</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2014-07-15T09:24:15+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=bef0c7fc30ff2a8a2c02ef93c8490404ae03ecff'/>
<id>urn:sha1:bef0c7fc30ff2a8a2c02ef93c8490404ae03ecff</id>
<content type='text'>
When the create_worker() is called from non-manager, the struct worker
is allocated from the node of the caller which may be different from the
node of pool-&gt;node.

So we add a node ID argument for the alloc_worker() to ensure the
struct worker is allocated from the preferable node.

tj: @nid renamed to @node for consistency.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>workqueue: reuse the already calculated pwq in try_to_grab_pending()</title>
<updated>2017-12-05T17:08:30+00:00</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2014-07-10T16:11:13+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=fab3138887dda43fedd239404b973b4d65718a3e'/>
<id>urn:sha1:fab3138887dda43fedd239404b973b4d65718a3e</id>
<content type='text'>
try_to_grab_pending() was re-calculating the associated pwq using
get_work_pwq() when it already has it cached in a local varible and
the association can't change.  Reuse the local variable instead.

This doesn't introduce any functional changes.

tj: Updated description.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>workqueue: stronger test in process_one_work()</title>
<updated>2017-12-05T17:08:29+00:00</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2014-06-03T07:33:28+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=70b3539d5351588e3080e914ce164fc8a504225e'/>
<id>urn:sha1:70b3539d5351588e3080e914ce164fc8a504225e</id>
<content type='text'>
When POOL_DISASSOCIATED is cleared, the running worker's local CPU should
be the same as pool-&gt;cpu without any exception even during cpu-hotplug.

This patch changes "(proposition_A &amp;&amp; proposition_B &amp;&amp; proposition_C)"
to "(proposition_B &amp;&amp; proposition_C)", so if the old compound
proposition is true, the new one must be true too. so this won't hide
any possible bug which can be hit by old test.

tj: Minor description update and dropped the obvious comment.

CC: Jason J. Herne &lt;jjherne@linux.vnet.ibm.com&gt;
CC: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>workqueue: remove useless WARN_ON_ONCE()</title>
<updated>2017-12-05T17:08:29+00:00</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2014-06-03T07:32:41+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=4fc5def8024efe19e77c10669edfc153aeaef8da'/>
<id>urn:sha1:4fc5def8024efe19e77c10669edfc153aeaef8da</id>
<content type='text'>
The @cpu is fetched via smp_processor_id() in this function,
so the check is useless.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>workqueue: sanity check pool-&gt;cpu in wq_worker_sleeping()</title>
<updated>2017-12-05T17:08:28+00:00</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2014-06-03T07:33:08+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=7578eb53f7b6a461791fdd18ef70eef1da4da47d'/>
<id>urn:sha1:7578eb53f7b6a461791fdd18ef70eef1da4da47d</id>
<content type='text'>
In theory, pool-&gt;cpu is equals to @cpu in wq_worker_sleeping() after
worker-&gt;flags is checked.

And "pool-&gt;cpu != cpu" sanity check will help us if something wrong.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
</feed>
