https://github.com/torvalds/linux
Revision 7b2b55da1db10a5525460633ae4b6fb0be060c41 authored by Jason Xing on 25 August 2019, 00:54:53 UTC, committed by Linus Torvalds on 25 August 2019, 02:48:42 UTC
Only when calling the poll syscall the first time can user receive
POLLPRI correctly.  After that, user always fails to acquire the event
signal.

Reproduce case:
 1. Get the monitor code in Documentation/accounting/psi.txt
 2. Run it, and wait for the event triggered.
 3. Kill and restart the process.

The question is why we can end up with poll_scheduled = 1 but the work
not running (which would reset it to 0).  And the answer is because the
scheduling side sees group->poll_kworker under RCU protection and then
schedules it, but here we cancel the work and destroy the worker.  The
cancel needs to pair with resetting the poll_scheduled flag.

Link: http://lkml.kernel.org/r/1566357985-97781-1-git-send-email-joseph.qi@linux.alibaba.com
Signed-off-by: Jason Xing <kerneljasonxing@linux.alibaba.com>
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: Caspar Zhang <caspar@linux.alibaba.com>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent bb65f89
History
Tip revision: 7b2b55da1db10a5525460633ae4b6fb0be060c41 authored by Jason Xing on 25 August 2019, 00:54:53 UTC
psi: get poll_work to run when calling poll syscall next time
Tip revision: 7b2b55d
File Mode Size
Kconfig -rw-r--r-- 1.5 KB
Makefile -rw-r--r-- 486 bytes
acl.c -rw-r--r-- 3.1 KB
file.c -rw-r--r-- 3.7 KB
inode.c -rw-r--r-- 9.8 KB
ioctl.c -rw-r--r-- 3.8 KB
jfs_acl.h -rw-r--r-- 525 bytes
jfs_btree.h -rw-r--r-- 3.3 KB
jfs_debug.c -rw-r--r-- 1.9 KB
jfs_debug.h -rw-r--r-- 2.7 KB
jfs_dinode.h -rw-r--r-- 5.1 KB
jfs_discard.c -rw-r--r-- 2.4 KB
jfs_discard.h -rw-r--r-- 337 bytes
jfs_dmap.c -rw-r--r-- 110.9 KB
jfs_dmap.h -rw-r--r-- 10.5 KB
jfs_dtree.c -rw-r--r-- 99.8 KB
jfs_dtree.h -rw-r--r-- 5.9 KB
jfs_extent.c -rw-r--r-- 16.6 KB
jfs_extent.h -rw-r--r-- 626 bytes
jfs_filsys.h -rw-r--r-- 8.2 KB
jfs_imap.c -rw-r--r-- 83.2 KB
jfs_imap.h -rw-r--r-- 5.8 KB
jfs_incore.h -rw-r--r-- 6.8 KB
jfs_inode.c -rw-r--r-- 2.8 KB
jfs_inode.h -rw-r--r-- 1.8 KB
jfs_lock.h -rw-r--r-- 883 bytes
jfs_logmgr.c -rw-r--r-- 58.2 KB
jfs_logmgr.h -rw-r--r-- 14.0 KB
jfs_metapage.c -rw-r--r-- 18.5 KB
jfs_metapage.h -rw-r--r-- 3.5 KB
jfs_mount.c -rw-r--r-- 12.0 KB
jfs_superblock.h -rw-r--r-- 3.4 KB
jfs_txnmgr.c -rw-r--r-- 73.8 KB
jfs_txnmgr.h -rw-r--r-- 7.6 KB
jfs_types.h -rw-r--r-- 3.6 KB
jfs_umount.c -rw-r--r-- 3.3 KB
jfs_unicode.c -rw-r--r-- 2.6 KB
jfs_unicode.h -rw-r--r-- 3.1 KB
jfs_uniupr.c -rw-r--r-- 6.8 KB
jfs_xattr.h -rw-r--r-- 1.8 KB
jfs_xtree.c -rw-r--r-- 91.1 KB
jfs_xtree.h -rw-r--r-- 3.1 KB
namei.c -rw-r--r-- 36.5 KB
resize.c -rw-r--r-- 14.1 KB
super.c -rw-r--r-- 23.6 KB
symlink.c -rw-r--r-- 499 bytes
xattr.c -rw-r--r-- 25.1 KB

back to top