<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/kernel/workqueue.c, branch linux-5.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-06-16T10:05:02Z</updated>
<entry>
<title>wq: handle VM suspension in stall detection</title>
<updated>2021-06-16T10:05:02Z</updated>
<author>
<name>Sergey Senozhatsky</name>
</author>
<published>2021-05-20T10:14:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8b30908df8d53db5ccb7f1bcd1c97d3aa75bbd62'/>
<id>urn:sha1:8b30908df8d53db5ccb7f1bcd1c97d3aa75bbd62</id>
<content type='text'>
[ Upstream commit 940d71c6462e8151c78f28e4919aa8882ff2054e ]

If VCPU is suspended (VM suspend) in wq_watchdog_timer_fn() then
once this VCPU resumes it will see the new jiffies value, while it
may take a while before IRQ detects PVCLOCK_GUEST_STOPPED on this
VCPU and updates all the watchdogs via pvclock_touch_watchdogs().
There is a small chance of misreported WQ stalls in the meantime,
because new jiffies is time_after() old 'ts + thresh'.

wq_watchdog_timer_fn()
{
	for_each_pool(pool, pi) {
		if (time_after(jiffies, ts + thresh)) {
			pr_emerg("BUG: workqueue lockup - pool");
		}
	}
}

Save jiffies at the beginning of this function and use that value
for stall detection. If VM gets suspended then we continue using
"old" jiffies value and old WQ touch timestamps. If IRQ at some
point restarts the stall detection cycle (pvclock_touch_watchdogs())
then old jiffies will always be before new 'ts + thresh'.

Signed-off-by: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>workqueue/watchdog: Make unbound workqueues aware of touch_softlockup_watchdog()</title>
<updated>2021-04-04T17:26:49Z</updated>
<author>
<name>Wang Qing</name>
</author>
<published>2021-03-24T11:40:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=89e28ce60cb65971c73359c66d076aa20a395cd5'/>
<id>urn:sha1:89e28ce60cb65971c73359c66d076aa20a395cd5</id>
<content type='text'>
84;0;0c84;0;0c
There are two workqueue-specific watchdog timestamps:

    + @wq_watchdog_touched_cpu (per-CPU) updated by
      touch_softlockup_watchdog()

    + @wq_watchdog_touched (global) updated by
      touch_all_softlockup_watchdogs()

watchdog_timer_fn() checks only the global @wq_watchdog_touched for
unbound workqueues. As a result, unbound workqueues are not aware
of touch_softlockup_watchdog(). The watchdog might report a stall
even when the unbound workqueues are blocked by a known slow code.

Solution:
touch_softlockup_watchdog() must touch also the global @wq_watchdog_touched
timestamp.

The global timestamp can no longer be used for bound workqueues because
it is now updated from all CPUs. Instead, bound workqueues have to check
only @wq_watchdog_touched_cpu and these timestamps have to be updated for
all CPUs in touch_all_softlockup_watchdogs().

Beware:
The change might cause the opposite problem. An unbound workqueue
might get blocked on CPU A because of a real softlockup. The workqueue
watchdog would miss it when the timestamp got touched on CPU B.

It is acceptable because softlockups are detected by softlockup
watchdog. The workqueue watchdog is there to detect stalls where
a work never finishes, for example, because of dependencies of works
queued into the same workqueue.

V3:
- Modify the commit message clearly according to Petr's suggestion.

Signed-off-by: Wang Qing &lt;wangqing@vivo.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>workqueue: Move the position of debug_work_activate() in __queue_work()</title>
<updated>2021-04-04T17:26:46Z</updated>
<author>
<name>Zqiang</name>
</author>
<published>2021-02-18T03:16:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0687c66b5f666b5ad433f4e94251590d9bc9d10e'/>
<id>urn:sha1:0687c66b5f666b5ad433f4e94251590d9bc9d10e</id>
<content type='text'>
The debug_work_activate() is called on the premise that
the work can be inserted, because if wq be in WQ_DRAINING
status, insert work may be failed.

Fixes: e41e704bc4f4 ("workqueue: improve destroy_workqueue() debuggability")
Signed-off-by: Zqiang &lt;qiang.zhang@windriver.com&gt;
Reviewed-by: Lai Jiangshan &lt;jiangshanlai@gmail.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq</title>
<updated>2021-02-23T01:06:54Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2021-02-23T01:06:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ac9e806c9c018a6cc6e82d50275a4ac185343b4f'/>
<id>urn:sha1:ac9e806c9c018a6cc6e82d50275a4ac185343b4f</id>
<content type='text'>
Pull qorkqueue updates from Tejun Heo:
 "Tracepoint and comment updates only"

* 'for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
  workqueue: Use %s instead of function name
  workqueue: tracing the name of the workqueue instead of it's address
  workqueue: fix annotation for WQ_SYSFS
</content>
</entry>
<entry>
<title>workqueue: Use %s instead of function name</title>
<updated>2021-01-27T14:42:48Z</updated>
<author>
<name>Stephen Zhang</name>
</author>
<published>2021-01-23T08:04:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e9ad2eb3d9ae05471c9b9fafcc0a31d8f565ca5b'/>
<id>urn:sha1:e9ad2eb3d9ae05471c9b9fafcc0a31d8f565ca5b</id>
<content type='text'>
It is better to replace the function name with %s, in case the function
name changes.

Signed-off-by: Stephen Zhang &lt;stephenzhangzsd@gmail.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>workqueue: Restrict affinity change to rescuer</title>
<updated>2021-01-22T14:09:43Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2021-01-15T18:08:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=640f17c82460e9724fd256f0a1f5d99e7ff0bda4'/>
<id>urn:sha1:640f17c82460e9724fd256f0a1f5d99e7ff0bda4</id>
<content type='text'>
create_worker() will already set the right affinity using
kthread_bind_mask(), this means only the rescuer will need to change
it's affinity.

Howveer, while in cpu-hot-unplug a regular task is not allowed to run
on online&amp;&amp;!active as it would be pushed away quite agressively. We
need KTHREAD_IS_PER_CPU to survive in that environment.

Therefore set the affinity after getting that magic flag.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Reviewed-by: Valentin Schneider &lt;valentin.schneider@arm.com&gt;
Tested-by: Valentin Schneider &lt;valentin.schneider@arm.com&gt;
Link: https://lkml.kernel.org/r/20210121103506.826629830@infradead.org
</content>
</entry>
<entry>
<title>workqueue: Tag bound workers with KTHREAD_IS_PER_CPU</title>
<updated>2021-01-22T14:09:42Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2021-01-12T10:26:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5c25b5ff89f004c30b04759dc34ace8585a4085f'/>
<id>urn:sha1:5c25b5ff89f004c30b04759dc34ace8585a4085f</id>
<content type='text'>
Mark the per-cpu workqueue workers as KTHREAD_IS_PER_CPU.

Workqueues have unfortunate semantics in that per-cpu workers are not
default flushed and parked during hotplug, however a subset does
manual flush on hotplug and hard relies on them for correctness.

Therefore play silly games..

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Reviewed-by: Valentin Schneider &lt;valentin.schneider@arm.com&gt;
Tested-by: Valentin Schneider &lt;valentin.schneider@arm.com&gt;
Link: https://lkml.kernel.org/r/20210121103506.693465814@infradead.org
</content>
</entry>
<entry>
<title>workqueue: Use cpu_possible_mask instead of cpu_active_mask to break affinity</title>
<updated>2021-01-22T14:09:41Z</updated>
<author>
<name>Lai Jiangshan</name>
</author>
<published>2021-01-11T15:26:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=547a77d02f8cfb345631ce23b5b548d27afa0fc4'/>
<id>urn:sha1:547a77d02f8cfb345631ce23b5b548d27afa0fc4</id>
<content type='text'>
The scheduler won't break affinity for us any more, and we should
"emulate" the same behavior when the scheduler breaks affinity for
us.  The behavior is "changing the cpumask to cpu_possible_mask".

And there might be some other CPUs online later while the worker is
still running with the pending work items.  The worker should be allowed
to use the later online CPUs as before and process the work items ASAP.
If we use cpu_active_mask here, we can't achieve this goal but
using cpu_possible_mask can.

Fixes: 06249738a41a ("workqueue: Manually break affinity on hotplug")
Signed-off-by: Lai Jiangshan &lt;laijs@linux.alibaba.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Reviewed-by: Valentin Schneider &lt;valentin.schneider@arm.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Tested-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
Tested-by: Valentin Schneider &lt;valentin.schneider@arm.com&gt;
Link: https://lkml.kernel.org/r/20210111152638.2417-4-jiangshanlai@gmail.com
</content>
</entry>
<entry>
<title>Merge branch 'for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq</title>
<updated>2020-12-28T19:23:02Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2020-12-28T19:23:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c76e02c59e13ae6c22cc091786d16c01bee23a14'/>
<id>urn:sha1:c76e02c59e13ae6c22cc091786d16c01bee23a14</id>
<content type='text'>
Pull workqueue update from Tejun Heo:
 "The same as the cgroup tree - one commit which was scheduled for the
  5.11 merge window.

  All the commit does is avoding spurious worker wakeups from workqueue
  allocation / config change path to help cpuisol use cases"

* 'for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
  workqueue: Kick a worker based on the actual activation of delayed works
</content>
</entry>
<entry>
<title>Merge branch 'akpm' (patches from Andrew)</title>
<updated>2020-12-15T20:53:37Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2020-12-15T20:53:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ac73e3dc8acd0a3be292755db30388c3580f5674'/>
<id>urn:sha1:ac73e3dc8acd0a3be292755db30388c3580f5674</id>
<content type='text'>
Merge misc updates from Andrew Morton:

 - a few random little subsystems

 - almost all of the MM patches which are staged ahead of linux-next
   material. I'll trickle to post-linux-next work in as the dependents
   get merged up.

Subsystems affected by this patch series: kthread, kbuild, ide, ntfs,
ocfs2, arch, and mm (slab-generic, slab, slub, dax, debug, pagecache,
gup, swap, shmem, memcg, pagemap, mremap, hmm, vmalloc, documentation,
kasan, pagealloc, memory-failure, hugetlb, vmscan, z3fold, compaction,
oom-kill, migration, cma, page-poison, userfaultfd, zswap, zsmalloc,
uaccess, zram, and cleanups).

* emailed patches from Andrew Morton &lt;akpm@linux-foundation.org&gt;: (200 commits)
  mm: cleanup kstrto*() usage
  mm: fix fall-through warnings for Clang
  mm: slub: convert sysfs sprintf family to sysfs_emit/sysfs_emit_at
  mm: shmem: convert shmem_enabled_show to use sysfs_emit_at
  mm:backing-dev: use sysfs_emit in macro defining functions
  mm: huge_memory: convert remaining use of sprintf to sysfs_emit and neatening
  mm: use sysfs_emit for struct kobject * uses
  mm: fix kernel-doc markups
  zram: break the strict dependency from lzo
  zram: add stat to gather incompressible pages since zram set up
  zram: support page writeback
  mm/process_vm_access: remove redundant initialization of iov_r
  mm/zsmalloc.c: rework the list_add code in insert_zspage()
  mm/zswap: move to use crypto_acomp API for hardware acceleration
  mm/zswap: fix passing zero to 'PTR_ERR' warning
  mm/zswap: make struct kernel_param_ops definitions const
  userfaultfd/selftests: hint the test runner on required privilege
  userfaultfd/selftests: fix retval check for userfaultfd_open()
  userfaultfd/selftests: always dump something in modes
  userfaultfd: selftests: make __{s,u}64 format specifiers portable
  ...
</content>
</entry>
</feed>
