Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp344323imm; Thu, 2 Aug 2018 20:40:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfqsM1BwB83fcjXM4gyIdKps026FTykpr7VgsYulb24F+TQpG6KSwxbacfUTCC4z2SNSNz5 X-Received: by 2002:a17:902:ba88:: with SMTP id k8-v6mr1886758pls.259.1533267649712; Thu, 02 Aug 2018 20:40:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533267649; cv=none; d=google.com; s=arc-20160816; b=wv1IXVFybNXZ75H+IrYYo9hUbaoo8LU5JKKVD0hYj/Gp+EkzvG2pZa9yfEJpnh/JwU wjZhKpfhiK1rtISGjtAhDPtoMSMwduJSkoZV7EhTGKrJQkmZMMojNqJDqbO4gNa6zaeM 2SfgUuBmXOjmFmnryPFReLEvR5aTBaZTM0QpQKvoU5Z8PggBJSNX9HDodSnDcIQTgger WcwlaMYpA6OBktMuZk7hBiUmdXItsBeMyHFuSssdpL5v5Uk1wMLx1AXVkZYXCNLmFiE0 FETfiqGogbz90y0VfDQcPXYeuXDERCTgiNQfHQgWashmQmhelbGnO44XgnU/OtWo/73E 0H7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :content-transfer-encoding:date:message-id:in-reply-to:cc:to:from :reply-to:subject:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=wRjC7el8nU1Xb6elI50sNwaEVMXpWOlgivYXELa9jr8=; b=JgHustOPqmCQkQbPAc9GtnU9Q8kUjx+034Vb7cTAABkDXHCg08Dr6N/NAh89iuEOb3 K7lSqT3FK127k0g/UKLEXTxCDgV2cS33KrFiPOEJcv9b6jcETj9z6f9VDW86U3+3K48t sVsuMuy7FNRTpA5KmdqHVoMXdGkIaEPr34jvNMFlCDIshuj80izaTmIrf6hDQ6TfKd9y SkyoirVF6aTV6B84AfB3wGnlLfysvv6sTVljX6kTQVLjWirnOCYk+9XHOGDcUlU1IhMM NZNLvHa7z2n6RbBoOpZJWeF4VyV3k1NgnTDeQae/+1L/RETVrHv6+E7MDyyZOELcTfde giyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ecL752qA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q16-v6si4124068pfi.183.2018.08.02.20.40.32; Thu, 02 Aug 2018 20:40:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ecL752qA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726128AbeHCFdy (ORCPT + 99 others); Fri, 3 Aug 2018 01:33:54 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:54595 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726012AbeHCFdx (ORCPT ); Fri, 3 Aug 2018 01:33:53 -0400 Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20180803033936epoutp02914648ee41fc5df4645083727cbf10a3~HQrzX1K4I1701917019epoutp02B for ; Fri, 3 Aug 2018 03:39:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20180803033936epoutp02914648ee41fc5df4645083727cbf10a3~HQrzX1K4I1701917019epoutp02B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1533267577; bh=wRjC7el8nU1Xb6elI50sNwaEVMXpWOlgivYXELa9jr8=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=ecL752qAuUYGu/VYC0E25sCKY16KzYTDxs+GWIxoWG2CJmuo8QEywEPERZEpOlkhb A0FQx6/A+vfg6cIU+t4yZeNe3baXx867tq3kaVysblcbDOwnLt3TJ7mYQALy6Z9f+f VV2rNknXz8yLjxc3lkb16LwLpwWbWIo7VxluDa3Q= Received: from epsmges5p3new.samsung.com (unknown [182.195.40.192]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20180803033935epcas5p3f2f33f24214446d4c0b55ad7b29f491f~HQrx4w-d90252302523epcas5p3H; Fri, 3 Aug 2018 03:39:35 +0000 (GMT) X-AuditID: b6c32a4b-239ff700000010d0-32-5b63ce7714ab Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id 9D.FF.04304.77EC36B5; Fri, 3 Aug 2018 12:39:35 +0900 (KST) Mime-Version: 1.0 Subject: RE: [PATCH 1/1] selftest/net: fix FILE_SIZE for 32 bit architecture. Reply-To: maninder1.s@samsung.com From: Maninder Singh To: Eric Dumazet , "davem@davemloft.net" , "shuahkh@osg.samsung.com" CC: "netdev@vger.kernel.org" , "linux-api@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "edumazet@google.com" , PANKAJ MISHRA , AMIT SAHRAWAT , Vaneet Narang X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <4a412194-99aa-7969-54a4-727368fbf82c@gmail.com> X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20180803033159epcms5p1dd2f5a6834268e9a22efa15421795fa0@epcms5p1> Date: Fri, 03 Aug 2018 09:01:59 +0530 X-CMS-MailID: 20180803033159epcms5p1dd2f5a6834268e9a22efa15421795fa0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P X-Brightmail-Tracker: H4sIAAAAAAAAA02Se0hTURzHO/fOeZVW16l11B7z1kAD5+5s8yoqQlIDrQQpqBF2mYcpuQe7 m2UQiSk+QLNQkqU5rBQ1NXynFWS03moUlKImkUmi2dAeJkHb7qz+Op/zPd/z+/7Oj0Pg4hvC UCLHYEFmA5tLCf0FfQ8jI6JOj2g18veVwcyrIcTUjRYJmFnHB1/m/tJLIdP9o1TIvB6sEzIO +xZmeqEXY2pWvgqY4af1INlf3dMyjqnv2KZ81fYuq7rnogsqe1qBerlrR7rwOErIRmwWMkuQ QWvMyjHoEqnUjMx9mUqVnI6i45hYSmJg9SiRSklLj9qfk+vqi5LksblWl5TOchwVnZRgNlot SJJt5CyJlIamFTJaHitTKFyr8kS8QumynETZjqU6H9NN0Zm1xgKsAPzyKwd+BCT3wvaPa4Jy 4E+IySEAHzwpwcsBQYjIAPh7INDtCSQPwzdjjZibxWQ4HKu9BdyWQFIOf/VGuGUhKYOtg3c9 ZYLICgA7rhfj7gOcfIfB7s5wPksEa0tmBTyHwf7mXuBmPzIRjpf+9OX1YDjetviXlxwNgOcg WDz9Euc5AM6sDnn1bbCtu8ITDMkSAPtnXmD8phrAoldT3rRYOPq0wXNbRB6EfTabhwWkFC6P fPFWTYFNM98wvuudsH+xzjMInIyEnYPRvGU7rHnW4bVsghVrH7H1hw1cW2cpLBq/7bP+yGWn 09uCGnZOfMf4QTsBfLwy5lMFJLZ/s7b9l2z7l2wHeCsIQSZOr0Oc0hRjQKdlHKvnrAadTGvU dwHPD92TOgC6RtKGAUkAaqNoTKrViH3YPC5fPwwggVNBosUylyTKYvPPIrMx02zNRdwwULpm cAkPDdYaXf/dYMmklQqVSh4nV8YwKpraKvp6KEMjJnWsBZ1CyITM6/cwwi+0ABTefGG8qxs6 EtTckpw/mXBeYy3Urib3y5MW5lveJfWdixydu7qTbd8dFaZPj3Yeyw98gF+Wfn+ki2g6Ovdm 5Yr99wbBgWbnyKfuiat9afW7Qn+q7pkcB9/Gh8wKn8/n7F8OaVFMBsgcqbUp+JbXTReqU+x0 SZl0497NkaVVpav+nykBl83Se3Azx/4BIsRPULcDAAA= DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20180802103616epcas5p48ec1e2ea3568b11683aa7b55254dffb0 References: <4a412194-99aa-7969-54a4-727368fbf82c@gmail.com> <20180802103616epcas5p48ec1e2ea3568b11683aa7b55254dffb0~HCuTv0d7l2131721317epcas5p4u@epcas5p4.samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, >On 08/02/2018 03:31 AM, Maninder Singh wrote: >> FILE_SZ is defined as (1UL << 35), it will overflow >> for 32 bit system and logic will break. >> >> Signed-off-by: Maninder Singh >> Signed-off-by: Vaneet Narang >> --- >> tools/testing/selftests/net/tcp_mmap.c | 8 ++++---- >> 1 file changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/tools/testing/selftests/net/tcp_mmap.c b/tools/testing/selftests/net/tcp_mmap.c >> index e8c5dff..1d6ca12 100644 >> --- a/tools/testing/selftests/net/tcp_mmap.c >> +++ b/tools/testing/selftests/net/tcp_mmap.c >> @@ -85,7 +85,7 @@ >> #define MSG_ZEROCOPY 0x4000000 >> #endif >> >> -#define FILE_SZ (1UL << 35) >> +#define FILE_SZ (1ULL << 35) ... ... >> @@ -431,7 +431,7 @@ int main(int argc, char *argv[]) >> zflg = 0; >> } >> while (total < FILE_SZ) { >> - long wr = FILE_SZ - total; >> + unsigned long long wr = FILE_SZ - total; >> >> if (wr > chunk_size) >> wr = chunk_size; >> > >What about using more conventional size_t instead of "unsigned long long" ? size_t is also equivalent to unsigned long and it will not hold value of (1 << 35) for 32 bit system. So we can do two things. (1) reduce FILE SIZE to (1 << 30), so that UL (size_t) can hold this value. It will not show any perofrmance boost with ZEROCOPY. (checked on x86_64) (2) use unsigned long long to work with both 32 and 64 bit system. It will show performance boost with ZEROCOPY.(checked on x86_64) What do you think? Thanks and regards, Maninder Singh