]> git.neil.brown.name Git - history.git/commit
[PATCH] futex-2.5.40-B5
authorIngo Molnar <mingo@elte.hu>
Thu, 3 Oct 2002 06:32:09 +0000 (23:32 -0700)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Thu, 3 Oct 2002 06:32:09 +0000 (23:32 -0700)
commit6a20c6fee5ba95d7244762a1873a1754d006ec7b
treec317a54b2bd273476965de6739d2fd584a211ec8
parent26f7ff2e91aede98d2598b73158000ce62ffa8e7
[PATCH] futex-2.5.40-B5

This does a number of futex bugfixes, performance improvements and
cleanups.

The bugfixes are:

 - fix locking bug noticed by Martin Wirth: the ordering of
   page_table_lock, vcache_lock and futex_lock was inconsistent and
   created the possibility of an SMP deadlock.

 - fix spurious wakeup noticed by Andrew Morton: the get_user() in
   futex_wait() can set the task state to TASK_RUNNING.

 - fix futex_wake COW race, noticed by Martin Wirth - futex_wake() has to
   go through the same lookup rules as the futex_wait() code, otherwise it
   might end up trying to wake up based on the wrong physical page.

Improvements:

 - speed up the basic addrs => page lookup done by the futex code. It used
   to do an unconditional get_user_pages() call, which did a vma lookup
   and other heavy-handed tactics - while the common case is that the
   page is mapped and available. Furthermore, due to the COW-race code we
   had to re-check the mapping anyway, which made the get_user_pages()
   thing pretty unnecessery. This inefficiency was noticed by Martin
   Wirth.

   the new lookup code first does a lightweight follow_page(), then if no
   page is present we do the get_user_pages() thing.

 - locking cleanups - the new lookup code made some things simpler, eg.
   the hash calculation can now be done in queue_me().

 - added comments

 - reduced include file use.

 - increased the futex hashtable.
kernel/futex.c