Re: [RFC] hung_task:add detecting task in D state milliseconds timeout

From: yang che
Date: Mon Jul 06 2020 - 05:43:24 EST


I will learn how to use KernelShark. Try to solve my problem,thanks
for your suggestion.
Talk about I solved a problem with hung task millisecondsï
the process get anon_vma read lock when it directly reclaims
memory, but other process down anon_vma write lock,
long time waiting for write lock up. Since anonymous pages can be
inherited from the parent process,
need to analyze whether the anonymous page inherits the parent
process, find is inherits parent process,
use anon_vma's red black tree and anon_vma_chain find all child
processes have inherited this anonymous page
of the parent process,and analyze the corresponding mapping file of
the current anonymous page in vma.
find what file caused by this problem.
I used crash+ramdump to analyze this problem before, I will try to
use KernelShark analyze this problem.

I want to ask whether the hung task can be added to support the
detection of millisecond settingsï
In theory, there is no harm, and the detection time can be more accurate.

Matthew Wilcox <willy@xxxxxxxxxxxxx> ä2020å7æ6æåä äå1:18åéï
>
> On Fri, Jul 03, 2020 at 11:18:28AM +0800, yang che wrote:
> > my understanding, KernelShark can't trigger panic, hung_task can
> > trigger. According to my use,
> > sometimes need to trigger panic to grab ramdump to analyze lock and
> > memory problems.
>
> You shouldn't need to trigger a panic to analyse locking or memory
> problems. KernelShark is supposed to be able to help you do that without
> bringing down the system. Give it a try, and if it doesn't work, Steven
> Rostedt is very interested in making it work for your case.