From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754760AbcAHKZm (ORCPT ); Fri, 8 Jan 2016 05:25:42 -0500 Received: from smtp-out4.electric.net ([192.162.216.186]:64064 "EHLO smtp-out4.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754646AbcAHKZi convert rfc822-to-8bit (ORCPT ); Fri, 8 Jan 2016 05:25:38 -0500 From: David Laight To: "'Christoph Hellwig'" , Alan Stern CC: "Steinar H. Gunderson" , Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" Subject: RE: [PATCH] Add support for usbfs zerocopy. Thread-Topic: [PATCH] Add support for usbfs zerocopy. Thread-Index: AQHRSflS3FqNe1oABkOH570G6/nu557xaD3w Date: Fri, 8 Jan 2016 10:22:52 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1CCC00A7@AcuExch.aculab.com> References: <20160106144512.GA21737@imap.gmail.com> <20160108094535.GA17286@infradead.org> In-Reply-To: <20160108094535.GA17286@infradead.org> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 213.249.233.130 X-Env-From: David.Laight@ACULAB.COM X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christoph Hellwig > Sent: 08 January 2016 09:46 > On Wed, Jan 06, 2016 at 10:35:05AM -0500, Alan Stern wrote: > > Indeed, the I/O operations we are using with mmap here are not reads or > > writes; they are ioctls. As far as I know, the kernel doesn't have any > > defined interface for zerocopy ioctls. > > IF it was using mmap for I/O it would read in through the page fault > handler an then mark the page dirty for writeback by the VM. Thats > clearly not the case. Indeed, and never is the case when mmap() is processed by a driver rather than a filesystem. > Instead it's using mmap on a file as a pecial purpose anonymous > memory allocator, bypassing the VM and VM policies, including > allowing to pin kernel memory that way. Opening a driver often allocates kernel memory, not a big deal. David