Unreliable Guide To Locking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I all,
I was reading "Unreliable Guide To Locking" by Rusty Russell:
	http://www.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/index.html

but the table (named Cheat Sheet For Locking) is quite confusing me:

http://www.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/c214.html#MINIMUM-LOCK-REQIREMENTS

maybe it is this really _cheating_ and _unreliable_ :-(

So I want to ask you a two questions:

1. following the table it seems that, if there is a critical section only in one place in user context, no locking is needed (if you cross "User Context A" with "User Context A" you get "None"). But as far as I know, if you have critical section in a "read" syscall for example, you must use some locking because two user processes can read the same device at the same time.

2. Why spin_lock_irqsave is used only between "IRQ Handler A" and "IRQ Handler B"? In all other situation spin_lock_irq is used instead. As far as I know you can use this function (spin_lock_irq) only if you are absolutely sure interrupts are not already disabled. So my question is how can we be absolutely sure in all this situation that interrupts are not already disabled.

Thank you in advance

Luca Ellero


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux