Received: by 10.192.165.148 with SMTP id m20csp143imm; Thu, 26 Apr 2018 14:43:34 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+5SifU7FLZoW0ZgaBeMEl+Y90vbvxmVq9wxBMJhcub1pRSw7aQKJC3FZLJIf4pQSQ/IbTt X-Received: by 2002:a17:902:3f83:: with SMTP id a3-v6mr35715900pld.279.1524779014366; Thu, 26 Apr 2018 14:43:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524779014; cv=none; d=google.com; s=arc-20160816; b=UVZykl4lEg5/Y5eVvHGkSnSU9nHFj6Yfi1IExLleRyrAbS2w+n5vz6riC0NwBO6/hg /0CRy+8ryJHjsHoqEEs1zohiERUMEzhhUC9TShXLzAZFkHw3UbW5E2Fiunn1xVYBiHI6 Mdm7RKfjicFranyk8pwZw4mT6n3kV0Ur02mMIjb6DBmoiMCd7xzj/Ya1/EcTk96Yx6H/ S2p/ACXXFr+UG6zzHmywYnJBH/bIaS3lVULWfTadYD54pN8Q+cHZ6/2zQVldisUUE1ja b9T2cVdYyC8zjIhLKlw/0srYRgr4IxtxwH8u38V+b2Zub41g6iVz3q9wkk+uZ9V/TA4L J+ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=dTAh083YmaIp2nTR4JDZtw6GfQPiMKbhs5uvdHnhfhQ=; b=ZsqDWsl4aT0PyqevDJmORdy3jvAYrxOntlX1jpvrNvNgKmO35pV+ZaL0XnLPgWN4mL EGy8zd9017tWZNagCGW1P2s5/u9ZvB5KOfuzq7JL4oV+Rd5aE2ar9YAjqpTVYQH25hZ/ vrr+N6r9C0sQcbPX+SwDMDamqDodG0ELob6HAT6+5E66st7oSHsFkVXQsK5F8aLdSJ8Y Yl/iLWs/O88X1KKcf8sGTKfvi3oHD8mCUbPrrJeU8A4uTyxTx6ZMCELqWrAARIOeuBju /wgoJhZGAJBw0wTj0373LRSgkjvji3jmT5XJ7sqE5HKb1D7aEkzM8KMue2LxnFgi/l9C QxVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H7JvHIza; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12-v6si11233903pla.194.2018.04.26.14.43.20; Thu, 26 Apr 2018 14:43:34 -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=@gmail.com header.s=20161025 header.b=H7JvHIza; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755697AbeDZVlD (ORCPT + 99 others); Thu, 26 Apr 2018 17:41:03 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:40872 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752962AbeDZVlC (ORCPT ); Thu, 26 Apr 2018 17:41:02 -0400 Received: by mail-pg0-f67.google.com with SMTP id l2so3593482pgc.7; Thu, 26 Apr 2018 14:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=dTAh083YmaIp2nTR4JDZtw6GfQPiMKbhs5uvdHnhfhQ=; b=H7JvHIzawozKTkyQHMYsPWNaitWA/1tt7XwcwP9ErUIBL82NCPOAFBcfPCiIlFppo3 7Sr9eflxWz8iWKejzBVIuo/TYssSf+U32tMVlv7ExvceK/g9Qi7vXNXAc7kwHzyh7v3Y 3KDh2TFoQYtF0VBW7ZdC+ZG6pwvBEu10NdvVNffAz2ebYC6t0j1Gw1K89+VdDMtaJy+f QMQkm2eP4jfWXMy7DIZwtN3d7bAud9f5sSMda0SEeHMTiPIG0C2FWXAQeW9gQ5WV1+kV +WT2+jUHe0Pes8o3qDjiEmnNt3xvnyrtFWxFPsmGtOyVNgS94wmg+Ka/VoqPZ4nGrOtt OuJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=dTAh083YmaIp2nTR4JDZtw6GfQPiMKbhs5uvdHnhfhQ=; b=hdJAAih7trJkz6RfKU/yP6fEF04SuFWy7Mh6yFsSYiaYR53YzTNh8OlQbcvyble1Dx 3tCW2RXlw4zUwgnBg+spBJDkosm4vipby7IrcakXDy0MuRy+jCZ1hI6VYd9Rtcf295bF GwTVJNDr9HO8pVljau6COSIQC2PRMBrT6XtSqE6X3Kq4g4ImvTUR2t8c8wpqwdZBzepc SiEFIbtIuO0CUMbqjarTUW5v1CqQ4uYFDMlK+YUjoBV7f0WWKBy29Ui1vddf764H6h8k e9jj67dl9+v8hdExhgoe7PmervI1DjVlm67aHFuMG+I7KFND4TJAUfaDAxGIoJts/Yd4 gmlQ== X-Gm-Message-State: ALQs6tCVzbWawaOi9bSXg+c4FtB9RS26nZtaSXyxlj5ZDEPYkj99/6AL 5aUYAkaI8fxTl3dcz6L0ez4= X-Received: by 10.101.77.73 with SMTP id j9mr3389410pgt.210.1524778861951; Thu, 26 Apr 2018 14:41:01 -0700 (PDT) Received: from ?IPv6:2620:15c:2c1:200:55c7:81e6:c7d8:94b? ([2620:15c:2c1:200:55c7:81e6:c7d8:94b]) by smtp.gmail.com with ESMTPSA id w134sm42217262pfd.132.2018.04.26.14.41.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Apr 2018 14:41:00 -0700 (PDT) Subject: Re: [PATCH v2 net-next 0/2] tcp: mmap: rework zerocopy receive To: Andy Lutomirski , Eric Dumazet Cc: Soheil Hassas Yeganeh , Eric Dumazet , "David S. Miller" , Network Development , LKML , Linux-MM References: <20180425214307.159264-1-edumazet@google.com> From: Eric Dumazet Message-ID: <2a8ea6bd-02dd-14dd-c797-2d8cba626f79@gmail.com> Date: Thu, 26 Apr 2018 14:40:59 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/26/2018 02:16 PM, Andy Lutomirski wrote: > At the risk of further muddying the waters, there's another minor tweak > that could improve performance on certain workloads. Currently you mmap() > a range for a given socket and then getsockopt() to receive. If you made > it so you could mmap() something once for any number of sockets (by > mmapping /dev/misc/tcp_zero_receive or whatever), then the performance of > the getsockopt() bit would be identical, but you could release the mapping > for many sockets at once with only a single flush. For some use cases, > this could be a big win. > > You could also add this later easily enough, too. > I believe I implemented what you just described. The getsockopt() call checks that the VMA was created by a mmap() to one TCP socket. It does not check that the vma was created by mmap() on the same socket, because we do not need this extra check really. So you presumably could use mmap() to grab 1GB of virtual space, then split it as you wish for different sockets. Thanks.