* sysfs vs. ioctl
@ 2010-02-23 16:47 Neshama Parhoti
2010-02-23 16:58 ` Arnd Bergmann
0 siblings, 1 reply; 3+ messages in thread
From: Neshama Parhoti @ 2010-02-23 16:47 UTC (permalink / raw)
To: linux-kernel
hi all,
we are in the process of writing a new driver and we don't know
whether to choose a sysfs or ioctl interface to user space.
we know that sysfs is preferred, but we're concerned it will have bad
performance when compared to ioctl (our driver will have its interface
might be used many dozens of times per second, possible even more than
100 times per second).
so should we opt for ioctls if a usage is expected even every 5
miliseconds (in extreme scenarios) ?
thank you in advance for the help
~pnesh
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: sysfs vs. ioctl
2010-02-23 16:47 sysfs vs. ioctl Neshama Parhoti
@ 2010-02-23 16:58 ` Arnd Bergmann
2010-02-24 5:28 ` Neshama Parhoti
0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2010-02-23 16:58 UTC (permalink / raw)
To: Neshama Parhoti; +Cc: linux-kernel
On Tuesday 23 February 2010, Neshama Parhoti wrote:
> we are in the process of writing a new driver and we don't know
> whether to choose a sysfs or ioctl interface to user space.
>
> we know that sysfs is preferred, but we're concerned it will have bad
> performance when compared to ioctl (our driver will have its interface
> might be used many dozens of times per second, possible even more than
> 100 times per second).
>
> so should we opt for ioctls if a usage is expected even every 5
> miliseconds (in extreme scenarios) ?
The question is not that easy to answer generally, there are many
aspects that influence what interface to use, and sysfs is not
generally slower than ioctl either.
Can you describe what your driver is doing? One rule of thumb
is that if you already require a character device, using ioctl
is the right answer, but you shouldn't create a character device
if all you want to do over it is a single ioctl operation.
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: sysfs vs. ioctl
2010-02-23 16:58 ` Arnd Bergmann
@ 2010-02-24 5:28 ` Neshama Parhoti
0 siblings, 0 replies; 3+ messages in thread
From: Neshama Parhoti @ 2010-02-24 5:28 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linux-kernel
On Tue, Feb 23, 2010 at 6:58 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> One rule of thumb is that if you already require a character device, using ioctl
> is the right answer, but you shouldn't create a character device
> if all you want to do over it is a single ioctl operation.
thank you so much this really helped !
~pnesh
>
> Arnd
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-02-24 5:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-23 16:47 sysfs vs. ioctl Neshama Parhoti
2010-02-23 16:58 ` Arnd Bergmann
2010-02-24 5:28 ` Neshama Parhoti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome