I have a data structure which is used in a kernel thread and in my ioctl function. I know for interrupts I need to use spin_lock_irqsave to disable interrupts but what about syscalls (ie. exceptions)?
Syscalls and exceptions are not same.
When the kernel thread accesses the data structure, should it also disable interrupts so that my user program doesnt send a syscall at that particular point in time?
Once you have the spin lock locked, kernel preemption is disabled. So till the time lock is held, kernel would not be pre-empted. No user space program can preempt the kernel anyway, so the syscall entering is out of the question. HTH. Om. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/