[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 12 Dec 2017 14:39:21 +0900
From: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To: Petr Mladek <pmladek@...e.com>
Cc: Byungchul Park <byungchul.park@....com>,
Steven Rostedt <rostedt@...dmis.org>,
LKML <linux-kernel@...r.kernel.org>, akpm@...ux-foundation.org,
linux-mm@...ck.org, Cong Wang <xiyou.wangcong@...il.com>,
Dave Hansen <dave.hansen@...el.com>,
Johannes Weiner <hannes@...xchg.org>,
Mel Gorman <mgorman@...e.de>, Michal Hocko <mhocko@...nel.org>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Vlastimil Babka <vbabka@...e.cz>,
Peter Zijlstra <peterz@...radead.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Jan Kara <jack@...e.cz>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
rostedt@...e.goodmis.org, kernel-team@....com
Subject: Re: [PATCH v4] printk: Add console owner and waiter logic to load
balance console writes
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.
Powered by blists - more mailing lists