<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Ah, OK!<br>
<br>
Thanks, Neil.&nbsp; That makes sense.&nbsp; I just knew there was no way that had been missed in the WC branch - Just as I'm sure you two noticed it immediately in your testing.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Also useful to know about the timeout functions and 0.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Regards,</p>
<p style="margin-top:0;margin-bottom:0">Patrick</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> James Simmons &lt;jsimmons@infradead.org&gt;<br>
<b>Sent:</b> Sunday, October 28, 2018 10:42:10 PM<br>
<b>To:</b> NeilBrown<br>
<b>Cc:</b> Patrick Farrell; Andreas Dilger; Oleg Drokin; Lustre Development List<br>
<b>Subject:</b> Re: [lustre-devel] [PATCH 12/28] lustre: ptlrpc: do not wakeup every second</font>
<div>&nbsp;</div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText"><br>
&gt; &gt; Neil,<br>
&gt; &gt;<br>
&gt; &gt; Does your statement imply this would spin?&nbsp; It definitely doesnt just<br>
&gt; &gt; spin (that behavior in a main wait for work spot of a (depending on<br>
&gt; &gt; settings) ~per-CPU daemon would render systems unusable and this patch<br>
&gt; &gt; has been in testing for a while).&nbsp; So what is the detailed behavior of<br>
&gt; &gt; a timeout that expires immediately?<br>
&gt; <br>
&gt; Hi Patrick,<br>
&gt;&nbsp; it definitely spins for me.<br>
<br>
Ah that is where the high cpu load is coming from.<br>
&nbsp;<br>
&gt;&nbsp; I should have clarified that the SFS patch<br>
&gt; <br>
&gt;&nbsp;&nbsp;&nbsp; e81847bd0651 LU-9660 ptlrpc: do not wakeup every second<br>
&gt; <br>
&gt;&nbsp; is correct, as __l_wait_event() treats a timeout value of 0 as meaning an<br>
&gt;&nbsp; indefinite timeout.<br>
&gt;&nbsp; The error was in the conversion to wait_event_idle_timeout().&nbsp; The<br>
&gt;&nbsp; various wait_event*timeout() functions treat 0 as 1 less than 1.<br>
&gt;&nbsp; If you want to not have a timeout, you need to not use the *_timeout()<br>
&gt;&nbsp; version.<br>
&gt;&nbsp; If a timeout is undesirable rather than fatal, then<br>
&gt;&nbsp; MAX_SCHEDULE_TIMEOUT can be used.&nbsp; In this case, that seemed best.<br>
<br>
I missed that in the conversion. Now that I know that the mapping I will<br>
do the future server code port correctly ;-)<br>
<br>
&gt; &gt; - Patrick<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; ________________________________<br>
&gt; &gt; From: lustre-devel &lt;lustre-devel-bounces@lists.lustre.org&gt; on behalf of NeilBrown &lt;neilb@suse.com&gt;<br>
&gt; &gt; Sent: Sunday, October 28, 2018 7:03:02 PM<br>
&gt; &gt; To: James Simmons; Andreas Dilger; Oleg Drokin<br>
&gt; &gt; Cc: Lustre Development List<br>
&gt; &gt; Subject: Re: [lustre-devel] [PATCH 12/28] lustre: ptlrpc: do not wakeup every second<br>
&gt; &gt;<br>
&gt; &gt; On Sun, Oct 14 2018, James Simmons wrote:<br>
&gt; &gt;<br>
&gt; &gt;&gt; From: Alex Zhuravlev &lt;bzzz@whamcloud.com&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Even if there are no RPC requests on the set, there is no need to<br>
&gt; &gt;&gt; wake up every second. The thread is woken up when a request is added<br>
&gt; &gt;&gt; to the set or when the STOP bit is set, so it is sufficient to only<br>
&gt; &gt;&gt; wake up when there are requests on the set to worry about.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Signed-off-by: Alex Zhuravlev &lt;bzzz@whamcloud.com&gt;<br>
&gt; &gt;&gt; WC-bug-id: <a href="https://jira.whamcloud.com/browse/LU-9660">https://jira.whamcloud.com/browse/LU-9660</a><br>
&gt; &gt;&gt; Reviewed-on: <a href="https://review.whamcloud.com/28776">https://review.whamcloud.com/28776</a><br>
&gt; &gt;&gt; Reviewed-by: Andreas Dilger &lt;adilger@whamcloud.com&gt;<br>
&gt; &gt;&gt; Reviewed-by: Patrick Farrell &lt;paf@cray.com&gt;<br>
&gt; &gt;&gt; Reviewed-by: Oleg Drokin &lt;green@whamcloud.com&gt;<br>
&gt; &gt;&gt; Signed-off-by: James Simmons &lt;jsimmons@infradead.org&gt;<br>
&gt; &gt;&gt; ---<br>
&gt; &gt;&gt;&nbsp; drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c | 4 &#43;&#43;--<br>
&gt; &gt;&gt;&nbsp; 1 file changed, 2 insertions(&#43;), 2 deletions(-)<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c<br>
&gt; &gt;&gt; index c201a88..5b4977b 100644<br>
&gt; &gt;&gt; --- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c<br>
&gt; &gt;&gt; &#43;&#43;&#43; b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c<br>
&gt; &gt;&gt; @@ -371,7 &#43;371,7 @@ static int ptlrpcd_check(struct lu_env *env, struct ptlrpcd_ctl *pc)<br>
&gt; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&gt; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; -&nbsp;&nbsp;&nbsp;&nbsp; return rc;<br>
&gt; &gt;&gt; &#43;&nbsp;&nbsp;&nbsp;&nbsp; return rc || test_bit(LIOD_STOP, &amp;pc-&gt;pc_flags);<br>
&gt; &gt;&gt;&nbsp; }<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;&nbsp; /**<br>
&gt; &gt;&gt; @@ -441,7 &#43;441,7 @@ static int ptlrpcd(void *arg)<br>
&gt; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lu_context_enter(env.le_ses);<br>
&gt; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (wait_event_idle_timeout(set-&gt;set_waitq,<br>
&gt; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ptlrpcd_check(&amp;env, pc),<br>
&gt; &gt;&gt; -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (timeout ? timeout : 1) * HZ) == 0)<br>
&gt; &gt;&gt; &#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; timeout * HZ) == 0)<br>
&gt; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ptlrpc_expired_set(set);<br>
&gt; &gt;<br>
&gt; &gt; This is incorrect.<br>
&gt; &gt; A timeout of zero means the timeout happens after zero jiffies<br>
&gt; &gt; (immediately), it doesn't mean there is no timeout.<br>
&gt; &gt; If we want a &quot;timeout&quot; of zero to mean &quot;Wait forever&quot;, we need something<br>
&gt; &gt; like:<br>
&gt; &gt;<br>
&gt; &gt;&nbsp;&nbsp; wait_event_idle_timeout(.....,<br>
&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; timeout ? (timeout * HZ) : MAX_SCHEDULE_TIMEOUT) == 0<br>
&gt; &gt;<br>
&gt; &gt; I've updated the patch accordingly.<br>
&gt; &gt;<br>
&gt; &gt; Thanks,<br>
&gt; &gt; NeilBrown<br>
&gt; &gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lu_context_exit(&amp;env.le_ctx);<br>
&gt; &gt;&gt; --<br>
&gt; &gt;&gt; 1.8.3.1<br>
&gt; </div>
</span></font></div>
</body>
</html>