<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_extra"><br><div class="gmail_quote">Richard Palethorpe <span dir="ltr"><<a href="mailto:rpalethorpe@suse.de" target="_blank">rpalethorpe@suse.de</a>></span> wrote:<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5"><span class="gmail-"></span><br><span class="gmail-"></span></div></div><span class="gmail-">
> You are right, I'm now still looking for a better way to avoid this block<br>
> I/O issue.<br>
<br>
</span>Maybe you could add a field to the worker struct containing the current<br>
file being read and a timestamp of when it started reading that<br>
file. Then we can use that information later to find out if a particular<br>
file is taking a long time to read.<br>
<span class="gmail-"></span><br></blockquote></div><br><div style="font-family:monospace,monospace" class="gmail_default">​I tried to count the reading time of files in children, it shows 0~200 ms has been elapsed for each one.<br></div><div style="font-family:monospace,monospace" class="gmail_default">But for parent, the most slower cost time of stop_worker() is 8ms, and even visit_dir(root_dir)<br>push all of the files, it takes only 1000ms. That probably can prove that why some<br>children stalled there.<br></div><div style="font-family:monospace,monospace" class="gmail_default"><br>========<br>read_all.c:231: INFO: read(/sys/kernel/debug/tracing/per_cpu/cpu11/snapshot_raw), elapsed_ms = 90: EAGAIN/EWOULDBLOCK<br>read_all.c:231: INFO: read(/sys/kernel/debug/tracing/per_cpu/cpu10/trace_pipe), elapsed_ms = 0: EAGAIN/EWOULDBLOCK<br>read_all.c:231: INFO: read(/sys/kernel/debug/tracing/per_cpu/cpu12/trace_pipe), elapsed_ms = 110: EAGAIN/EWOULDBLOCK<br>...<br>read_all.c:231: INFO: read(/sys/kernel/debug/tracing/per_cpu/cpu9/trace_pipe_raw), elapsed_ms = 160: EAGAIN/EWOULDBLOCK<br>...<br>read_all.c:231: INFO: read(/sys/kernel/debug/tracing/per_cpu/cpu9/trace_pipe_raw), elapsed_ms = 180: EAGAIN/EWOULDBLOCK<br>read_all.c:231: INFO: read(/sys/kernel/debug/tracing/per_cpu/cpu11/trace_pipe), elapsed_ms = 0: EAGAIN/EWOULDBLOCK<br>...<br>read_all.c:231: INFO: read(/sys/kernel/debug/tracing/per_cpu/cpu10/snapshot_raw), elapsed_ms = 130: EAGAIN/EWOULDBLOCK<br>read_all.c:231: INFO: read(/sys/kernel/debug/tracing/per_cpu/cpu6/trace_pipe), elapsed_ms = 200: EAGAIN/EWOULDBLOCK<br>read_all.c:231: INFO: read(/sys/kernel/debug/tracing/per_cpu/cpu9/trace_pipe), elapsed_ms = 0: EAGAIN/EWOULDBLOCK<br>read_all.c:231: INFO: read(/sys/kernel/debug/tracing/per_cpu/cpu5/snapshot_raw), elapsed_ms = 0: EAGAIN/EWOULDBLOCK<br><br><br></div><br clear="all"><br>-- <br><div class="gmail_signature">Li Wang<br><a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a></div>
</div></div>