linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* write_lock_irq(&tasklist_lock)
@ 2018-05-22 19:40 Sodagudi Prasad
  2018-05-22 20:27 ` write_lock_irq(&tasklist_lock) Linus Torvalds
  2018-05-23 13:05 ` write_lock_irq(&tasklist_lock) Will Deacon
  0 siblings, 2 replies; 14+ messages in thread
From: Sodagudi Prasad @ 2018-05-22 19:40 UTC (permalink / raw)
  To: keescook, luto, wad, akpm, riel, tglx, mingo, peterz, ebiggers,
	fweisbec, sherryy, vegard.nossum, cl, aarcange, alexander.levin,
	vegard.nossum, sherryy, fweisbec, ebiggers, peterz
  Cc: linux-kernel, torvalds

Hi All,

When following test is executed on 4.14.41 stable kernel, observed that 
one of the core is waiting for tasklist_lock for long time with IRQs 
disabled.
./stress-ng-64 --get 8 -t 3h --times --metrics-brief

Every time when device is crashed, I observed that one the task stuck at 
fork system call and waiting for tasklist_lock as writer with irq 
disabled.
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/kernel/fork.c?h=linux-4.14.y#n1843

Some other tasks are making getrlimit, prlimit system calls, so that 
these readers are continuously taking tasklist_list read lock.

Writer has disabled local IRQs for long time and waiting to readers to 
finish but readers are keeping tasklist_lock busy
for quite long time.

I think, −−get N option creates N thread and they make following system 
calls.
========================================================================
start N workers that call system calls that fetch data from the kernel, 
currently these are: getpid,
getppid, getcwd, getgid, getegid, getuid, getgroups, getpgrp, getpgid, 
getpriority, getresgid, getresuid,
getrlimit, prlimit, getrusage, getsid, gettid, getcpu, gettimeofday, 
uname, adjtimex, sysfs.
Some of these system calls are OS specific.
========================================================================

Have you observed this type of issues with tasklist_lock ?
Do we need write_lock_irq(&tasklist_lock) in below portion of code ? Can 
I use write_unlock instead of write_lock_irq in portion of code?
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/kernel/fork.c?h=linux-4.14.y#n1843

-Thanks, Prasad

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
Forum,
Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-05-24 21:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-22 19:40 write_lock_irq(&tasklist_lock) Sodagudi Prasad
2018-05-22 20:27 ` write_lock_irq(&tasklist_lock) Linus Torvalds
2018-05-22 21:17   ` write_lock_irq(&tasklist_lock) Peter Zijlstra
2018-05-22 21:31     ` write_lock_irq(&tasklist_lock) Linus Torvalds
2018-05-23  8:19       ` write_lock_irq(&tasklist_lock) Peter Zijlstra
2018-05-23 13:05 ` write_lock_irq(&tasklist_lock) Will Deacon
2018-05-23 15:25   ` write_lock_irq(&tasklist_lock) Linus Torvalds
2018-05-23 15:36     ` write_lock_irq(&tasklist_lock) Will Deacon
2018-05-23 16:26       ` write_lock_irq(&tasklist_lock) Linus Torvalds
2018-05-24 12:49         ` write_lock_irq(&tasklist_lock) Will Deacon
2018-05-24 13:51           ` write_lock_irq(&tasklist_lock) Boqun Feng
2018-05-24 17:37             ` write_lock_irq(&tasklist_lock) Sodagudi Prasad
2018-05-24 18:28               ` write_lock_irq(&tasklist_lock) Peter Zijlstra
2018-05-24 21:14             ` write_lock_irq(&tasklist_lock) Andrea Parri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).