Kirill Tkhai
0aa1125fa8
locking/rwsem-spinlock: Add killable versions of __down_read()
Rename __down_read() in __down_read_common() and teach it
to abort waiting in case of pending signals and killable
state argument passed.
Note, that we shouldn't wake anybody up in EINTR path, as:
We check for signal_pending_state() after (!waiter.task)
test and under spinlock. So, current task wasn't able to
be woken up. It may be in two cases: a writer is owner
of the sem, or a writer is a first waiter of the sem.
If a writer is owner of the sem, no one else may work
with it in parallel. It will wake somebody, when it
call up_write() or downgrade_write().
If a writer is the first waiter, it will be woken up,
when the last active reader releases the sem, and
sem->count became 0.
Also note, that set_current_state() may be moved down
to schedule() (after !waiter.task check), as all
assignments in this type of semaphore (including wake_up),
occur under spinlock, so we can't miss anything.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: arnd@arndb.de
Cc: avagin@virtuozzo.com
Cc: davem@davemloft.net
Cc: fenghua.yu@intel.com
Cc: gorcunov@virtuozzo.com
Cc: heiko.carstens@de.ibm.com
Cc: hpa@zytor.com
Cc: ink@jurassic.park.msu.ru
Cc: mattst88@gmail.com
Cc: rth@twiddle.net
Cc: schwidefsky@de.ibm.com
Cc: tony.luck@intel.com
Link: http://lkml.kernel.org/r/149789533283.9059.9829416940494747182.stgit@localhost.localdomain
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-08-10 12:28:55 +02:00
..
2017-04-18 13:11:07 -07:00
2016-12-24 11:46:01 -08:00
2017-06-08 18:52:41 -07:00
2017-03-02 08:42:32 +01:00
2017-01-14 11:37:14 +01:00
2016-11-16 10:15:10 +01:00
2016-10-25 11:31:50 +02:00
2017-01-30 11:42:59 +01:00
2017-05-16 08:43:25 -03:00
2017-01-30 11:42:59 +01:00
2017-08-10 12:28:54 +02:00
2017-01-14 11:14:35 +01:00
2017-05-25 12:06:50 -07:00
2017-07-06 16:24:33 -07:00
2017-03-02 08:42:27 +01:00
2017-07-08 11:01:11 +02:00
2017-08-01 14:36:35 +02:00
2017-06-08 10:35:49 +02:00
2017-06-08 10:35:49 +02:00
2017-07-13 11:44:06 +02:00
2017-06-08 10:35:49 +02:00
2017-08-10 12:28:55 +02:00
2017-03-02 08:42:34 +01:00
2017-03-16 09:57:07 +01:00
2016-06-08 15:16:59 +02:00
2017-03-02 08:42:34 +01:00
2017-02-10 09:09:49 +01:00
2017-01-12 09:33:39 +01:00
2017-03-30 09:49:47 +02:00