From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755168AbcEQCpn (ORCPT ); Mon, 16 May 2016 22:45:43 -0400 Received: from mail-by2on0140.outbound.protection.outlook.com ([207.46.100.140]:2378 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751699AbcEQCpl convert rfc822-to-8bit (ORCPT ); Mon, 16 May 2016 22:45:41 -0400 From: Dexuan Cui To: David Miller CC: "gregkh@linuxfoundation.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devel@linuxdriverproject.org" , "olaf@aepfle.de" , "apw@canonical.com" , "jasowang@redhat.com" , "cavery@redhat.com" , KY Srinivasan , Haiyang Zhang , "joe@perches.com" , "vkuznets@redhat.com" Subject: RE: [PATCH v11 net-next 0/1] introduce Hyper-V VM Sockets(hv_sock) Thread-Topic: [PATCH v11 net-next 0/1] introduce Hyper-V VM Sockets(hv_sock) Thread-Index: AQHRrs19ujvjcLq4HkaGaTsnZlgKbp+8ae9g Date: Tue, 17 May 2016 02:45:37 +0000 Message-ID: References: <1463331162-6679-1-git-send-email-decui@microsoft.com> <20160515.131606.1794366975297405715.davem@davemloft.net> In-Reply-To: <20160515.131606.1794366975297405715.davem@davemloft.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: davemloft.net; dkim=none (message not signed) header.d=none;davemloft.net; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [2404:f801:9000:18::4be] x-ms-office365-filtering-correlation-id: a8a414f1-18ea-4c72-14e8-08d37dfd5400 x-microsoft-exchange-diagnostics: 1;CO2PR03MB2280;5:caz7FouSefqtd1DsyFBjctg0HtL1c76wURPkCrysC12UhVppjygyPGx0/xJdahWCKkEK7WJVeWRQ3XuM6j/NLyxSC26pYAAPce8qOvlDexKgzfNNWqgViIWAE+oi8h/RKsB7xfeQk+Kx7W6nVfXAsg==;24:4rJ7aaM+EuSuOeVn1/XDfVEDjSG6g7OugM/IyBUwWPWeMLTz+qzfyL5oa6M3z5HPE5gdL4HWA97SnjiE9c/hK+8/taO/CelVMCq1f3V7OuQ=;7:GGKZMFFL9b1mGoXlARHBFbdm7X3nwFhG+9b1O5VcBoHVl3d6JXcmA+uUhVjKHmNvS+VEVk3/BJE5tCDghV5F3n0FV3Z8IST926Nb+xmjYUeSwxztYEqgBisrSUuOG218e3bt0VihoZYYphYd1w9uBmAeqDXVpcmGO9xvebnfDx0= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR03MB2280; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(61426038)(61427038);SRVR:CO2PR03MB2280;BCL:0;PCL:0;RULEID:;SRVR:CO2PR03MB2280; x-forefront-prvs: 0945B0CC72 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(5002640100001)(9686002)(3660700001)(81166006)(1220700001)(6116002)(102836003)(2900100001)(586003)(87936001)(2950100001)(92566002)(5003600100002)(19580395003)(4326007)(189998001)(3280700002)(76576001)(5008740100001)(33656002)(74316001)(8990500004)(2906002)(122556002)(10290500002)(10400500002)(5005710100001)(19580405001)(50986999)(8936002)(110136002)(86362001)(76176999)(8676002)(99286002)(77096005)(54356999)(10090500001)(86612001)(5004730100002)(106116001)(3826002);DIR:OUT;SFP:1102;SCL:1;SRVR:CO2PR03MB2280;H:BLUPR03MB1410.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 17 May 2016 02:45:37.6986 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR03MB2280 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: David Miller [mailto:davem@davemloft.net] > Sent: Monday, May 16, 2016 1:16 > To: Dexuan Cui > Cc: gregkh@linuxfoundation.org; netdev@vger.kernel.org; linux- > kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de; > apw@canonical.com; jasowang@redhat.com; cavery@redhat.com; KY > Srinivasan ; Haiyang Zhang ; > joe@perches.com; vkuznets@redhat.com > Subject: Re: [PATCH v11 net-next 0/1] introduce Hyper-V VM Sockets(hv_sock) > > From: Dexuan Cui > Date: Sun, 15 May 2016 09:52:42 -0700 > > > Changes since v10 > > > > 1) add module params: send_ring_page, recv_ring_page. They can be used to > > enlarge the ringbuffer size to get better performance, e.g., > > # modprobe hv_sock recv_ring_page=16 send_ring_page=16 > > By default, recv_ring_page is 3 and send_ring_page is 2. > > > > 2) add module param max_socket_number (the default is 1024). > > A user can enlarge the number to create more than 1024 hv_sock sockets. > > By default, 1024 sockets take about 1024 * (3+2+1+1) * 4KB = 28M bytes. > > (Here 1+1 means 1 page for send/recv buffers per connection, respectively.) > > This is papering around my objections, and create module parameters which > I am fundamentally against. > > You're making the facility unusable by default, just to work around my > memory consumption concerns. > > What will end up happening is that everyone will simply increase the > values. > > You're not really addressing the core issue, and I will be ignoring you > future submissions of this change until you do. David, I am sorry I came across as ignoring your feedback; that was not my intention. The current host side design for this feature is such that each socket connection needs its own channel, which consists of 1. A ring buffer for host to guest communication 2. A ring buffer for guest to host communication The memory for the ring buffers has to be pinned down as this will be accessed both from interrupt level in Linux guest and from the host OS at any time. To address your concerns, I am planning to re-implement both the receive path and the send path so that no additional pinned memory will be needed. Receive Path: When the application does a read on the socket, we will dynamically allocate the buffer and perform the read operation on the incoming ring buffer. Since we will be in the process context, we can sleep here and will set the "GFP_KERNEL | __GFP_NOFAIL" flags. This buffer will be freed once the application consumes all the data. Send Path: On the send side, we will construct the payload to be sent directly on the outgoing ringbuffer. So, with these changes, the only memory that will be pinned down will be the memory for the ring buffers on a per-connection basis and this memory will be pinned down until the connection is torn down. Please let me know if this addresses your concerns. Thanks, -- Dexuan