From patchwork Tue Jun 30 03:28:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangguanghui X-Patchwork-Id: 6692931 Return-Path: X-Original-To: patchwork-ocfs2-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 41C1AC05AC for ; Tue, 30 Jun 2015 03:29:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2BD712053E for ; Tue, 30 Jun 2015 03:29:32 +0000 (UTC) Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EBA0B204E4 for ; Tue, 30 Jun 2015 03:29:30 +0000 (UTC) Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t5U3SmM9023592 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 30 Jun 2015 03:28:48 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t5U3Slsh007810 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 30 Jun 2015 03:28:47 GMT Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1Z9mE3-0007GJ-I0; Mon, 29 Jun 2015 20:28:47 -0700 Received: from aserv0021.oracle.com ([141.146.126.233]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1Z9mDe-0007FU-Sv for ocfs2-devel@oss.oracle.com; Mon, 29 Jun 2015 20:28:22 -0700 Received: from aserp1030.oracle.com (aserp1030.oracle.com [141.146.126.68]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t5U3SMYW007167 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 30 Jun 2015 03:28:22 GMT Received: from userp2030.oracle.com (userp2030.oracle.com [156.151.31.89]) by aserp1030.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t5U3SLkI029513 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 30 Jun 2015 03:28:22 GMT Received: from pps.filterd (userp2030.oracle.com [127.0.0.1]) by userp2030.oracle.com (8.14.7/8.14.7) with SMTP id t5U3Pewi043681 for ; Tue, 30 Jun 2015 03:28:21 GMT Received: from h3cmg01-ex.h3c.com (smtp.h3c.com [221.12.31.13] (may be forged)) by userp2030.oracle.com with ESMTP id 1vbew2v8pg-1 for ; Tue, 30 Jun 2015 03:28:21 +0000 Received: from H3CHUB03-EX.srv.huawei-3com.com (unknown [10.63.20.169]) by h3cmg01-ex.h3c.com with smtp id 475c_0724_97fc512f_7ca3_41f5_a2d9_6695b531f27e; Tue, 30 Jun 2015 11:28:18 +0800 Received: from H3CMLB14-EX.srv.huawei-3com.com ([fe80::f804:6772:bd71:f07f]) by H3CHUB03-EX.srv.huawei-3com.com ([fe80::1d84:7d22:976e:809%15]) with mapi id 14.01.0355.002; Tue, 30 Jun 2015 11:28:09 +0800 From: Zhangguanghui To: "ocfs2-devel@oss.oracle.com" Thread-Topic: o2net_sendpage reviews, thanks Thread-Index: AQHQsuTIQLdH7YisCkWRpO1mmP7TeA== Date: Tue, 30 Jun 2015 03:28:08 +0000 Message-ID: <2015063011280785381652@h3c.com> References: <2015060621065807886420@h3c.com>, <2015063011132144102146@h3c.com>, <2015063011180600247349@h3c.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.153.28.119] MIME-Version: 1.0 X-ServerName: [221.12.31.13] X-Proofpoint-Virus-Version: vendor=nai engine=5700 definitions=7847 signatures=670598 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=1 compositescore=0.9 suspectscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 rbsscore=0.9 spamscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1506180000 definitions=main-1506300060 Subject: [Ocfs2-devel] o2net_sendpage reviews, thanks X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_50, HTML_FONT_FACE_BAD, HTML_FONT_LOW_CONTRAST, HTML_MESSAGE, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi 1. In the callback o2net_sendpage -> sendpage() 2. If sendpage (tcp socket send) continuously returns -EAGAIN, then get into an endless loop, even though the function of cond_resched() have already used. 3. I think it is not reasonable, try to continuously send 20 times returns -EAGAIN , shutdown the socket to avoid affecting the entire cluster. Finally, any feedback about this process (positive or negative) would be greatly appreciated. syslog: /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 EAGAINne /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 EAGAINne /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 EAGAINne /var/log/syslog:Jun 29 09:32:58 cvk47 kernel: [156022.769546] (kworker/u130:1,12041,9):o2net_sendpage:1026 sendpage of ________________________________ zhangguanghui 10102 ------------------------------------------------------------------------------------------------------------------------------------- ???????????????????????????????????????? ???????????????????????????????????????? ???????????????????????????????????????? ??? This e-mail and its attachments contain confidential information from H3C, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! --- tcp.c 2015-06-30 11:46:54.727447919 +0800 +++ tcp.c.diff 2015-06-30 11:52:12.823447881 +0800 @@ -949,6 +949,7 @@ { struct o2net_node *nn = o2net_nn_from_num(sc->sc_node->nd_num); ssize_t ret; + int send_fails = 20; while (1) { mutex_lock(&sc->sc_send_lock); @@ -959,10 +960,11 @@ mutex_unlock(&sc->sc_send_lock); if (ret == size) break; - if (ret == (ssize_t)-EAGAIN) { + if (ret == (ssize_t)-EAGAIN && send_fails > 0) { mlog(0, "sendpage of size %zu to " SC_NODEF_FMT " returned EAGAIN\n", size, SC_NODEF_ARGS(sc)); cond_resched(); + --send_fails; continue; } mlog(ML_ERROR, "sendpage of size %zu to " SC_NODEF_FMT