]> git.baikalelectronics.ru Git - kernel.git/commit
rwsem: simplify __rwsem_do_wake
authorMichel Lespinasse <walken@google.com>
Tue, 7 May 2013 13:45:58 +0000 (06:45 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 7 May 2013 14:20:16 +0000 (07:20 -0700)
commit6b2e96b69dd869e739be299f467ef52dc20e3ae7
treea7b49b135dc7703a4a709562178a847fb9bc4f77
parentb891b2a2bc1462ed701a066e3cf6b0fce929a91d
rwsem: simplify __rwsem_do_wake

This is mostly for cleanup value:

- We don't need several gotos to handle the case where the first
  waiter is a writer. Two simple tests will do (and generate very
  similar code).

- In the remainder of the function, we know the first waiter is a reader,
  so we don't have to double check that. We can use do..while loops
  to iterate over the readers to wake (generates slightly better code).

Signed-off-by: Michel Lespinasse <walken@google.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Acked-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/rwsem-spinlock.c
lib/rwsem.c