Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933209Ab0BPTSd (ORCPT ); Tue, 16 Feb 2010 14:18:33 -0500 Received: from nwd2mail10.analog.com ([137.71.25.55]:5882 "EHLO nwd2mail10.analog.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933090Ab0BPTSc (ORCPT ); Tue, 16 Feb 2010 14:18:32 -0500 X-IronPort-AV: E=Sophos;i="4.49,485,1262581200"; d="scan'208";a="11750381" From: Robin Getz Organization: Analog Devices, Inc. To: Jonathan Cameron Subject: Re: [RFC] Staging: IIO: New ABI V2 Date: Tue, 16 Feb 2010 14:18:27 -0500 User-Agent: KMail/1.9.5 CC: Greg KH , Mike Frysinger , Kay Sievers , LKML , Dmitry Torokhov , "Hennerich, Michael" , Manuel Stahl , Robin Getz , "Trisal, Kalhan" , "Zhang, Xing Z" , Ira Snyder , Jean Delvare , Samu Onkalo , Stefani Seibold References: <4B6C619C.3000302@cam.ac.uk> <20100216024924.GA29008@suse.de> <4B7A7B8F.9080501@cam.ac.uk> In-Reply-To: <4B7A7B8F.9080501@cam.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <201002161418.28097.rgetz@blackfin.uclinux.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2071 Lines: 44 On Tue 16 Feb 2010 06:03, Jonathan Cameron pondered: > On 02/16/10 02:49, Greg KH wrote: > > On Mon, Feb 15, 2010 at 07:58:12PM -0500, Mike Frysinger wrote: > >> On Mon, Feb 15, 2010 at 15:26, Robin Getz wrote: > >>> [snip] > >>> What exists today still requires a copy_[to|from]_user when using > >>> the ring buffer (and then another cache_flush if you are dma'ing > >>> things). These seems pretty expensive and will consume extra cycles > >>> that will limit throughput. > >>> > >>> Any thoughts to a mmaped interface directly to the IIO ring buffer, > >>> so the system could avoid some of the above overhead? (This is what > >>> we had to do for some other drivers - which were able to handle a 40 > >>> MSample/second data processed by userspace for a soft radio). > >> > >> does sysfs currently support mmap-ing of files in there ? > > > > For binary files, yes. If you are going to use mmap, use a character > > device node instead please, that's not what sysfs is for. > All the buffer access is done via character device nodes anyway. > > For anyone entering the discussion at this point: > Only really simple IIO drivers (for typically very slow devices) > are principally accessed through sysfs. For these fast devices we > probably wouldn't provide that route at all, merely using sysfs to > describe the parameters of the device and buffer being used. Can we be a little more specific - what in your mind is "very slow"? and "fast"? Is it designated by samples per second? (and bits per sample doesn't matter?) or is it the result (bits per sample * samples per second/8 == bytes/second?) Many people I know would call a 1Mega sample per second converter very slow, but the kernel handling a memcpy of a continuous 2Mbyte/second (16-bits per sample), stream seems a little wasteful. Thanks -Robin -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/