Skip to contentSkip to conversation

performance difference between ioctl and read/write?

DISCUSSION Takashi Iwai 2 participants 2 messages Mar 11, 2002

lore
Share & tools
lore
#0 lore raw

Hi,

the current alsa driver uses ioctl for read and write pcm data. while writing the 32 -> 64 bit ioctl wrapper, i found that there might be difference between ioctl and read/write wrt the performance on SMP.
sys_ioctl() calls a global lock_kernel() during ioctl operation, while read and write don't.
i'm not sure whether/how this affects. did anybody investigate this already?

Takashi

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

#1 lore raw
Quoted 10 lines · Takashi Iwai

Hi,

the current alsa driver uses ioctl for read and write pcm data. while writing the 32 -> 64 bit ioctl wrapper, i found that there might be difference between ioctl and read/write wrt the performance on SMP.
sys_ioctl() calls a global lock_kernel() during ioctl operation, while read and write don't.
i'm not sure whether/how this affects. did anybody investigate this already?

This lock is released when ioctl code calls schedule*(). We have no CPU intensive data processing in the kernel space, so I think that this penalty is minimal. Sure, it would be better to move such locking from sys_ioctl to driver code.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel