Re: [PATCH v4] printk: Add console owner and waiter logic to load balance console writes

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

 



Hello,

On (12/08/17 15:00), Petr Mladek wrote:
[..]
> > However, now that cross-release was introduces, lockdep can be applied
> > to semaphore operations. Actually, I have a plan to do that. I think it
> > would be better to make semaphore tracked with lockdep and remove all
> > these manual acquire() and release() here. What do you think about it?
> 
> IMHO, it would be great to add lockdep annotations into semaphore
> operations.

certain types of locks have no guaranteed lock-unlock ordering.
e.g. readers-writer locks, semaphores, etc.

for readers-writer lock we can easily have

CPU0		CPU1		CPU2		CPU3		CPU4
read_lock
		write_lock
		// sleep because
		// of CPU0
								read_lock
read_unlock			read_lock
				read_unlock	read_lock
						read_unlock
								read_unlock
								// wake up CPU1

so for CPU1 the lock was "locked" by CPU0 and "unlocked" by CPU4.

semaphore not necessarily has the mutual-exclusion property, because
its ->count is not required to be set to 1. in printk we use semaphore
with ->count == 1, but that's just an accident.

	-ss


p.s.
frankly, I don't see any "locking issues" in Steven's patch.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux