<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
<!--
body
        {line-height:1.5}
blockquote
        {margin-top:0px;
        margin-bottom:0px;
        margin-left:0.5em}
body
        {font-size:16pt;
        font-family:微软雅黑;
        color:rgb(0,0,0);
        line-height:1.5}
-->
</style>
</head>
<body>
<blockquote style="margin-top:0px; margin-bottom:0px; margin-left:0.5em">
<div class="FoxDiv20150630111601972229">
<blockquote style="margin-top:0px; margin-bottom:0px; margin-left:0.5em">
<div class="FoxDiv20150630100730998087">
<div style="font-size:16px"><br>
</div>
<div style="font-size:16px">Hi</div>
<div style="font-size:16px"><br>
</div>
<div style="font-size:16px">1. &nbsp;In the callback&nbsp;o2net_sendpage&nbsp;-&gt;&nbsp;sendpage<span style="line-height:1.5">()</span></div>
<div style="font-size:16px"><span style="line-height:1.5">2. &nbsp;I</span><span style="line-height:1.5">f&nbsp;</span>sendpage<span style="line-height:1.5">&nbsp;(tcp</span><span style="line-height:1.5">&nbsp;socket send) continuously returns&nbsp;</span><span style="line-height:1.5">-EAGAIN</span><span style="line-height:1.5">,
 t</span><span style="line-height:1.5">hen </span><span style="line-height:1.5">get into an endless
</span><span style="line-height:1.5">loop,</span></div>
<div style="font-size:16px"><span style="line-height:1.5">&nbsp; &nbsp; </span><span style="line-height:1.5">even though&nbsp;</span><span style="line-height:1.5">the function of
</span><span style="line-height:1.5">cond_resched()&nbsp;</span><span style="line-height:1.5">have&nbsp;</span><span style="line-height:1.5">already&nbsp;</span><span style="line-height:1.5">used</span><span style="line-height:1.5">.</span></div>
<div style="font-size:16px"><span style="line-height:1.5">3. &nbsp;I think it is not reasonable,&nbsp;</span><span style="line-height:1.5">try to&nbsp;</span><span style="line-height:1.5">continuously&nbsp;</span><span style="line-height:1.5">send&nbsp;</span><span style="line-height:1.5">20
 times&nbsp;</span><span style="line-height:1.5">returns&nbsp;</span><span style="line-height:1.5">-EAGAIN</span><span style="line-height:1.5">&nbsp;,</span></div>
<div style="font-size:16px"><span style="line-height:1.5">&nbsp; &nbsp;&nbsp;</span><span style="line-height:1.5">shutdown the socket to avoid
</span><span style="line-height:1.5">affecting&nbsp;</span><span style="line-height:1.5">the&nbsp;</span><span style="line-height:1.5">entire&nbsp;</span><span style="line-height:1.5">cluster.</span></div>
<div style="font-size:16px"><span style="line-height:1.5"><br>
</span></div>
<div style="font-size:16px"><span style="line-height:1.5; background-color:window">Finally, any feedback about this process
</span><span style="line-height:1.5; background-color:window">(positive or negative) would be greatly appreciated.</span></div>
<div style="font-size:16px">
<pre><span style=""><font face="微软雅黑">--- tcp.c   2015-06-30 11:46:54.727447919 &#43;0800
<br>&#43;&#43;&#43; tcp.c.diff  2015-06-30 11:52:12.823447881 &#43;0800
<br>@@ -949,6 &#43;949,7 @@
<br> {
<br>    struct o2net_node *nn = o2net_nn_from_num(sc-&gt;sc_node-&gt;nd_num);
<br>    ssize_t ret;</font></span></pre>
<pre><span style=""><font face="微软雅黑">&#43;   int send_fails = 20;</font></span></pre>
<pre><span style=""><font face="微软雅黑"><br>    while (1) {
<br>        mutex_lock(&amp;sc-&gt;sc_send_lock);
<br>@@ -959,10 &#43;960,11 @@
<br>        mutex_unlock(&amp;sc-&gt;sc_send_lock);
<br>        if (ret == size)
<br>            break;
<br>-       if (ret == (ssize_t)-EAGAIN) {
<br>&#43;       if (ret == (ssize_t)-EAGAIN &amp;&amp; send_fails &gt; 0) {
<br>            mlog(0, &quot;sendpage of size %zu to &quot; SC_NODEF_FMT
<br>                 &quot; returned EAGAIN\n&quot;, size, SC_NODEF_ARGS(sc));
<br>            cond_resched();
<br>&#43;           --send_fails;
<br>            continue;
<br>        }   <br>        mlog(ML_ERROR, &quot;sendpage of size %zu to &quot; SC_NODEF_FMT</font></span></pre>
<pre><span style=""><font face="微软雅黑"><br></font></span></pre>
<pre><span style=""><font face="微软雅黑">syslog:</font></span></pre>
<pre><span><font face="微软雅黑">/var/log/syslog:Jun 29 09:32:58 cvk47 kernel: [156022.769539] (kworker/u130:1,12041,9):o2net_sendpage:1026 sendpage of size 24 to node cvk61 (num 5) at 172.16.202.61:7100 returned EAGAIN
<br>/var/log/syslog:Jun 29 09:32:58 cvk47 kernel: [156022.769542] (kworker/u130:1,12041,9):o2net_sendpage:1026 sendpage of size 24 to node cvk61 (num 5) at 172.16.202.61:7100 returned EAGAIN
<br>/var/log/syslog:Jun 29 09:32:58 cvk47 kernel: [156022.769544] (kworker/u130:1,12041,9):o2net_sendpage:1026 sendpage of size 24 to node cvk61 (num 5) at 172.16.202.61:7100 returned EAGAIN
<br>/var/log/syslog:Jun 29 09:32:58 cvk47 kernel: [156022.769546] (kworker/u130:1,12041,9):o2net_sendpage:1026 sendpage of</font></span></pre>
</div>
<hr color="#b5c4df" size="1" align="left" style="width:210px; height:1px; font-size:16px">
<div><span>
<div style="margin:10px; font-size:10pt">
<div style="font-size:16px">zhangguanghui 10102</div>
</div>
</span></div>
</div>
</blockquote>
</div>
</blockquote>
<span style="font-size:7.5pt; font-family:华文细黑; color:gray"><span lang="EN-US">-------------------------------------------------------------------------------------------------------------------------------------<br>
</span>本邮件及其附件含有杭州华三通信技术有限公司的保密信息,仅限于发送给上面地址中列出<span lang="EN-US"><br>
</span>的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、<span lang="EN-US"><br>
</span>或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本<span lang="EN-US"><br>
</span>邮件!<span lang="EN-US"><br>
</span></span><span lang="EN-US" style="font-size:7.5pt; font-family:&quot;Arial&quot;,&quot;sans-serif&quot;; color:gray">This e-mail and its attachments contain confidential information from H3C, which is
<br>
intended only for the person or entity whose address is listed above. Any use of the
<br>
information contained herein in any way (including, but not limited to, total or partial
<br>
disclosure, reproduction, or dissemination) by persons other than the intended <br>
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
<br>
by phone or email immediately and delete it!</span>
</body>
</html>