)]}'
{
  "log": [
    {
      "commit": "e579dcbf23604cb33c08b5c3c3ac06ca36e7c683",
      "tree": "293581684fc47260a4610e4a77510b459346e2aa",
      "parents": [
        "6997a6faaa129a1c91775f7344c8d371a05178ea"
      ],
      "author": {
        "name": "john stultz",
        "email": "johnstul@us.ibm.com",
        "time": "Sun Aug 13 23:24:24 2006 -0700"
      },
      "committer": {
        "name": "Greg Kroah-Hartman",
        "email": "gregkh@suse.de",
        "time": "Mon Aug 14 12:54:29 2006 -0700"
      },
      "message": "[PATCH] futex_handle_fault always fails\n\nWe found this issue last week w/ the -RT kernel, but it seems the same\nissue is in mainline as well.\n\nBasically it is possible for futex_unlock_pi to return without actually\nfreeing the lock.  This is due to buggy logic in the use of\nfutex_handle_fault() and its attempt argument in a failure case.\n\nLooking at futex.c the logic is as follows:\n\n1) In futex_unlock_pi() we start w/ ret\u003d0 and we go down to the first\n   futex_atomic_cmpxchg_inatomic(), where we find uval\u003d\u003d-EFAULT.  We then\n   jump to the pi_faulted label.\n\n2) From pi_faulted: We increment attempt, unlock the sem and hit the\n   retry label.\n\n3) From the retry label, with ret still zero, we again hit EFAULT on the\n   first futex_atomic_cmpxchg_inatomic(), and again goto the pi_faulted\n   label.\n\n4) Again from pi_faulted: we increment attempt and enter the\n   conditional, where we call futex_handle_fault.\n\n5) futex_handle_fault fails, and we goto the out_unlock_release_sem\n   label.\n\n6) From out_unlock_release_sem we return, and since ret is still zero,\n   we return without error, while never actually unlocking the lock.\n\nIssue #1: at the first futex_atomic_cmpxchg_inatomic() we should probably\nbe setting ret\u003d-EFAULT before jumping to pi_faulted: However in our case\nthis doesn\u0027t really affect anything, as the glibc we\u0027re using ignores the\nerror value from futex_unlock_pi().\n\nIssue #2: Look at futex_handle_fault(), its first conditional will return\n-EFAULT if attempt is \u003e\u003d 2.  However, from the \"if(attempt++)\nfutex_handle_fault(attempt)\" logic above, we\u0027ll *never* call\nfutex_handle_fault when attempt is less then two.  So we never get a chance\nto even try to fault the page in.\n\nThe following patch addresses these two issues by 1) Always setting ret to\n-EFAULT if futex_handle_fault fails, and 2) Removing the \u003d in\nfutex_handle_fault\u0027s (attempt \u003e\u003d 2) check.\n\nI\u0027m really not sure this is the right fix, but wanted to bring it up so\nfolks knew the issue is alive and well in the current -git tree.  From\nlooking at the git logs the logic was first introduced (then later copied\nto other places) in the following commit almost a year ago:\n\nhttp://www.kernel.org/git/?p\u003dlinux/kernel/git/torvalds/linux-2.6.git;a\u003dcommitdiff;h\u003d4732efbeb997189d9f9b04708dc26bf8613ed721;hp\u003d5b039e681b8c5f30aac9cc04385cc94be45d0823\n\nCc: Rusty Russell \u003crusty@rustcorp.com.au\u003e\nCc: Ingo Molnar \u003cmingo@elte.hu\u003e\nAcked-by: Thomas Gleixner \u003ctglx@linutronix.de\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@suse.de\u003e\n"
    },
    {
      "commit": "e91467ecd1ef381377fd327c0ded922835ec52ab",
      "tree": "b80a9c5d4b86df9c766c6a9613ae596d19ed0abf",
      "parents": [
        "72f0b4e2133ba1d65147d06016c0b6d2202235ca"
      ],
      "author": {
        "name": "Christian Borntraeger",
        "email": "borntrae@de.ibm.com",
        "time": "Sat Aug 05 12:13:52 2006 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Sun Aug 06 08:57:46 2006 -0700"
      },
      "message": "[PATCH] bug in futex unqueue_me\n\nThis patch adds a barrier() in futex unqueue_me to avoid aliasing of two\npointers.\n\nOn my s390x system I saw the following oops:\n\nUnable to handle kernel pointer dereference at virtual kernel address\n0000000000000000\nOops: 0004 [#1]\nCPU:    0    Not tainted\nProcess mytool (pid: 13613, task: 000000003ecb6ac0, ksp: 00000000366bdbd8)\nKrnl PSW : 0704d00180000000 00000000003c9ac2 (_spin_lock+0xe/0x30)\nKrnl GPRS: 00000000ffffffff 000000003ecb6ac0 0000000000000000 0700000000000000\n           0000000000000000 0000000000000000 000001fe00002028 00000000000c091f\n           000001fe00002054 000001fe00002054 0000000000000000 00000000366bddc0\n           00000000005ef8c0 00000000003d00e8 0000000000144f91 00000000366bdcb8\nKrnl Code: ba 4e 20 00 12 44 b9 16 00 3e a7 84 00 08 e3 e0 f0 88 00 04\nCall Trace:\n([\u003c0000000000144f90\u003e] unqueue_me+0x40/0xe4)\n [\u003c0000000000145a0c\u003e] do_futex+0x33c/0xc40\n [\u003c000000000014643e\u003e] sys_futex+0x12e/0x144\n [\u003c000000000010bb00\u003e] sysc_noemu+0x10/0x16\n [\u003c000002000003741c\u003e] 0x2000003741c\n\nThe code in question is:\n\nstatic int unqueue_me(struct futex_q *q)\n{\n        int ret \u003d 0;\n        spinlock_t *lock_ptr;\n\n        /* In the common case we don\u0027t take the spinlock, which is nice. */\n retry:\n        lock_ptr \u003d q-\u003elock_ptr;\n        if (lock_ptr !\u003d 0) {\n                spin_lock(lock_ptr);\n\t\t/*\n                 * q-\u003elock_ptr can change between reading it and\n                 * spin_lock(), causing us to take the wrong lock.  This\n                 * corrects the race condition.\n[...]\n\nand my compiler (gcc 4.1.0) makes the following out of it:\n\n00000000000003c8 \u003cunqueue_me\u003e:\n     3c8:       eb bf f0 70 00 24       stmg    %r11,%r15,112(%r15)\n     3ce:       c0 d0 00 00 00 00       larl    %r13,3ce \u003cunqueue_me+0x6\u003e\n                        3d0: R_390_PC32DBL      .rodata+0x2a\n     3d4:       a7 f1 1e 00             tml     %r15,7680\n     3d8:       a7 84 00 01             je      3da \u003cunqueue_me+0x12\u003e\n     3dc:       b9 04 00 ef             lgr     %r14,%r15\n     3e0:       a7 fb ff d0             aghi    %r15,-48\n     3e4:       b9 04 00 b2             lgr     %r11,%r2\n     3e8:       e3 e0 f0 98 00 24       stg     %r14,152(%r15)\n     3ee:       e3 c0 b0 28 00 04       lg      %r12,40(%r11)\n\t\t/* write q-\u003elock_ptr in r12 */\n     3f4:       b9 02 00 cc             ltgr    %r12,%r12\n     3f8:       a7 84 00 4b             je      48e \u003cunqueue_me+0xc6\u003e\n\t\t/* if r12 is zero then jump over the code.... */\n     3fc:       e3 20 b0 28 00 04       lg      %r2,40(%r11)\n\t\t/* write q-\u003elock_ptr in r2 */\n     402:       c0 e5 00 00 00 00       brasl   %r14,402 \u003cunqueue_me+0x3a\u003e\n                        404: R_390_PC32DBL      _spin_lock+0x2\n\t\t/* use r2 as parameter for spin_lock */\n\nSo the code becomes more or less:\nif (q-\u003elock_ptr !\u003d 0) spin_lock(q-\u003elock_ptr)\ninstead of\nif (lock_ptr !\u003d 0) spin_lock(lock_ptr)\n\nWhich caused the oops from above.\nAfter adding a barrier gcc creates code without this problem:\n[...] (the same)\n     3ee:       e3 c0 b0 28 00 04       lg      %r12,40(%r11)\n     3f4:       b9 02 00 cc             ltgr    %r12,%r12\n     3f8:       b9 04 00 2c             lgr     %r2,%r12\n     3fc:       a7 84 00 48             je      48c \u003cunqueue_me+0xc4\u003e\n     400:       c0 e5 00 00 00 00       brasl   %r14,400 \u003cunqueue_me+0x38\u003e\n                        402: R_390_PC32DBL      _spin_lock+0x2\n\nAs a general note, this code of unqueue_me seems a bit fishy. The retry logic\nof unqueue_me only works if we can guarantee, that the original value of\nq-\u003elock_ptr is always a spinlock (Otherwise we overwrite kernel memory). We\nknow that q-\u003elock_ptr can change. I dont know what happens with the original\nspinlock, as I am not an expert with the futex code.\n\nCc: Martin Schwidefsky \u003cschwidefsky@de.ibm.com\u003e\nCc: Rusty Russell \u003crusty@rustcorp.com.au\u003e\nAcked-by: Ingo Molnar \u003cmingo@redhat.com\u003e\nCc: Thomas Gleixner \u003ctglx@timesys.com\u003e\nSigned-off-by: Christian Borntraeger \u003cborntrae@de.ibm.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "e3f2ddeac718c768fdac4b7fe69d465172f788a8",
      "tree": "5428532dc6c87710c35a71858425f6d726f0e44c",
      "parents": [
        "627371d73cdd04ed23fe098755b4f855138ad9e0"
      ],
      "author": {
        "name": "Ingo Molnar",
        "email": "mingo@elte.hu",
        "time": "Sat Jul 29 05:17:57 2006 +0200"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Fri Jul 28 21:02:00 2006 -0700"
      },
      "message": "[PATCH] pi-futex: robust-futex exit\n\nFix robust PI-futexes to be properly unlocked on unexpected exit.\n\nFor this to work the kernel has to know whether a futex is a PI or a\nnon-PI one, because the semantics are different.  Since the space in\nrelevant glibc data structures is extremely scarce, the best solution is\nto encode the \u0027PI\u0027 information in bit 0 of the robust list pointer.\nExisting (non-PI) glibc robust futexes have this bit always zero, so the\nABI is kept.  New glibc with PI-robust-futexes will set this bit.\n\nFurther fixes from Thomas Gleixner \u003ctglx@linutronix.de\u003e\n\nSigned-off-by: Ingo Molnar \u003cmingo@elte.hu\u003e\nSigned-off-by: Ulrich Drepper \u003cdrepper@redhat.com\u003e\nSigned-off-by: Thomas Gleixner \u003ctglx@linutronix.de\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "627371d73cdd04ed23fe098755b4f855138ad9e0",
      "tree": "2371684c61f91c39f562a6570784a1bae50f53a5",
      "parents": [
        "c97d20a6c51067a38f53680d9609b4cf2867d077"
      ],
      "author": {
        "name": "Ingo Molnar",
        "email": "mingo@elte.hu",
        "time": "Sat Jul 29 05:16:20 2006 +0200"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Fri Jul 28 21:02:00 2006 -0700"
      },
      "message": "[PATCH] pi-futex: robust-futex exit crash fix\n\nFix pi_state-\u003elist handling bugs: list handling mishap, locking error.\nPlus add more debug checks and fix a few style issues i noticed while\ndebugging this.\n\n(reported by Ulrich Drepper and Jakub Jelinek.)\n\nSigned-off-by: Ingo Molnar \u003cmingo@elte.hu\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "06a9ec291b3aec9c7e36af0a10ad2b556bd7e84f",
      "tree": "a98c1293470967bfa93e250b99b6a0ff129e3dee",
      "parents": [
        "bed936f7eab946c60170bc92a1aea597da158e02"
      ],
      "author": {
        "name": "Thomas Gleixner",
        "email": "tglx@linutronix.de",
        "time": "Mon Jul 10 04:44:30 2006 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Mon Jul 10 13:24:18 2006 -0700"
      },
      "message": "[PATCH] pi-futex: Validate futex type instead of oopsing\n\nCalling futex_lock_pi is called with a reference to a non PI futex and\nwaiters exist already, lookup_pi_state() oopses due to pi_state \u003d\u003d NULL.\nCheck this condition and return -EINVAL to userspace.\n\nSigned-off-by: Thomas Gleixner \u003ctglx@linutronix.de\u003e\nCc: Ingo Molnar \u003cmingo@elte.hu\u003e\nCc: Jakub Jelinek \u003cjakub@redhat.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "8b8f319fc7f4ab59f567d6a401a62659b3d37007",
      "tree": "f483c5447619de848e2357ba157a1e09277b5c93",
      "parents": [
        "f2eace23e924bd3f05aedea4fc505eb5508d2d93"
      ],
      "author": {
        "name": "Ingo Molnar",
        "email": "mingo@elte.hu",
        "time": "Mon Jul 03 00:25:05 2006 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Mon Jul 03 15:27:06 2006 -0700"
      },
      "message": "[PATCH] lockdep: annotate futex\n\nTeach special (recursive) locking code to the lock validator.  Introduces\ndouble_lock_hb() to unify double- hash-bucket-lock taking.\n\nSigned-off-by: Ingo Molnar \u003cmingo@elte.hu\u003e\nSigned-off-by: Arjan van de Ven \u003carjan@linux.intel.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "ed6f7b10e657b98b4ba89385d02852c8bdf3980e",
      "tree": "a53bfca204307322400c3fff1e75563233d38dfc",
      "parents": [
        "a99e4e413e1ab9f3c567b5519f5557afd786dc62"
      ],
      "author": {
        "name": "Ingo Molnar",
        "email": "mingo@elte.hu",
        "time": "Sat Jul 01 04:35:46 2006 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Sat Jul 01 09:55:57 2006 -0700"
      },
      "message": "[PATCH] pi-futex: futex_wake() lockup fix\n\nFix futex_wake() exit condition bug when handling the robust-list with PI\nfutexes on them.\n\n(reported by Ulrich Drepper, debugged by the lock validator.)\n\nSigned-off-by: Ingo Molnar \u003cmingo@elte.hu\u003e\nCc: Ulrich Drepper \u003cdrepper@redhat.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "a99e4e413e1ab9f3c567b5519f5557afd786dc62",
      "tree": "31998183648206018452ae0c3c46aaa19724bd74",
      "parents": [
        "9262e9149f346a5443300f8c451b8e7631e81a42"
      ],
      "author": {
        "name": "Vernon Mauery",
        "email": "vernux@us.ibm.com",
        "time": "Sat Jul 01 04:35:42 2006 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Sat Jul 01 09:55:57 2006 -0700"
      },
      "message": "[PATCH] pi-futex: fix mm_struct memory leak\n\nlock_queue was getting called essentially twice in a row and was\ncontinually incrementing the mm_count ref count, thus causing a memory\nleak.\n\nDinakar Guniguntala provided a proper fix for the problem that simply grabs\nthe spinlock for the hash bucket queue rather than calling lock_queue.\n\nThe second time we do a queue_lock in futex_lock_pi, we really only need to\ntake the hash bucket lock.\n\nSigned-off-by: Dinakar Guniguntala \u003cdino@in.ibm.com\u003e\nSigned-off-by: Vernon Mauery \u003cvernux@us.ibm.com\u003e\nAcked-by: Paul E. McKenney \u003cpaulmck@us.ibm.com\u003e\nSigned-off-by: Ingo Molnar \u003cmingo@elte.hu\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "59e0e0ace7d33e8c0c125042f153f80fcc56b39e",
      "tree": "e73a795bd99b39a886fe3f9b46f85dbf53db5316",
      "parents": [
        "95e02ca9bb5324360e7dea1ea1c563036d84a5e6"
      ],
      "author": {
        "name": "Sebastien Dugue",
        "email": "sebastien.dugue@bull.net",
        "time": "Tue Jun 27 02:55:03 2006 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Tue Jun 27 17:32:48 2006 -0700"
      },
      "message": "[PATCH] futex_requeue() optimization\n\nIn futex_requeue(), when the 2 futexes keys hash to the same bucket, there\nis no need to move the futex_q to the end of the bucket list.\n\nSigned-off-by: Sebastien Dugue \u003csebastien.dugue@bull.net\u003e\nCc: Ingo Molnar \u003cmingo@elte.hu\u003e\nCc: Thomas Gleixner \u003ctglx@linutronix.de\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "c87e2837be82df479a6bae9f155c43516d2feebc",
      "tree": "ad6ab35f0b78f71abaa7b05185e9e3f97809c6de",
      "parents": [
        "0cdbee9920fb37eb2dc49b860c2b28862d647adc"
      ],
      "author": {
        "name": "Ingo Molnar",
        "email": "mingo@elte.hu",
        "time": "Tue Jun 27 02:54:58 2006 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Tue Jun 27 17:32:47 2006 -0700"
      },
      "message": "[PATCH] pi-futex: futex_lock_pi/futex_unlock_pi support\n\nThis adds the actual pi-futex implementation, based on rt-mutexes.\n\n[dino@in.ibm.com: fix an oops-causing race]\nSigned-off-by: Ingo Molnar \u003cmingo@elte.hu\u003e\nSigned-off-by: Thomas Gleixner \u003ctglx@linutronix.de\u003e\nSigned-off-by: Arjan van de Ven \u003carjan@linux.intel.com\u003e\nSigned-off-by: Dinakar Guniguntala \u003cdino@in.ibm.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "e2970f2fb6950183a34e8545faa093eb49d186e1",
      "tree": "a4035274368d846488a3b0152925502c06b064b0",
      "parents": [
        "66e5393a78b3fcca63e7748e38221dcca61c4aab"
      ],
      "author": {
        "name": "Ingo Molnar",
        "email": "mingo@elte.hu",
        "time": "Tue Jun 27 02:54:47 2006 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Tue Jun 27 17:32:46 2006 -0700"
      },
      "message": "[PATCH] pi-futex: futex code cleanups\n\nWe are pleased to announce \"lightweight userspace priority inheritance\" (PI)\nsupport for futexes.  The following patchset and glibc patch implements it,\nontop of the robust-futexes patchset which is included in 2.6.16-mm1.\n\nWe are calling it lightweight for 3 reasons:\n\n - in the user-space fastpath a PI-enabled futex involves no kernel work\n   (or any other PI complexity) at all.  No registration, no extra kernel\n   calls - just pure fast atomic ops in userspace.\n\n - in the slowpath (in the lock-contention case), the system call and\n   scheduling pattern is in fact better than that of normal futexes, due to\n   the \u0027integrated\u0027 nature of FUTEX_LOCK_PI.  [more about that further down]\n\n - the in-kernel PI implementation is streamlined around the mutex\n   abstraction, with strict rules that keep the implementation relatively\n   simple: only a single owner may own a lock (i.e.  no read-write lock\n   support), only the owner may unlock a lock, no recursive locking, etc.\n\n  Priority Inheritance - why, oh why???\n  -------------------------------------\n\nMany of you heard the horror stories about the evil PI code circling Linux for\nyears, which makes no real sense at all and is only used by buggy applications\nand which has horrible overhead.  Some of you have dreaded this very moment,\nwhen someone actually submits working PI code ;-)\n\nSo why would we like to see PI support for futexes?\n\nWe\u0027d like to see it done purely for technological reasons.  We dont think it\u0027s\na buggy concept, we think it\u0027s useful functionality to offer to applications,\nwhich functionality cannot be achieved in other ways.  We also think it\u0027s the\nright thing to do, and we think we\u0027ve got the right arguments and the right\nnumbers to prove that.  We also believe that we can address all the\ncounter-arguments as well.  For these reasons (and the reasons outlined below)\nwe are submitting this patch-set for upstream kernel inclusion.\n\nWhat are the benefits of PI?\n\n  The short reply:\n  ----------------\n\nUser-space PI helps achieving/improving determinism for user-space\napplications.  In the best-case, it can help achieve determinism and\nwell-bound latencies.  Even in the worst-case, PI will improve the statistical\ndistribution of locking related application delays.\n\n  The longer reply:\n  -----------------\n\nFirstly, sharing locks between multiple tasks is a common programming\ntechnique that often cannot be replaced with lockless algorithms.  As we can\nsee it in the kernel [which is a quite complex program in itself], lockless\nstructures are rather the exception than the norm - the current ratio of\nlockless vs.  locky code for shared data structures is somewhere between 1:10\nand 1:100.  Lockless is hard, and the complexity of lockless algorithms often\nendangers to ability to do robust reviews of said code.  I.e.  critical RT\napps often choose lock structures to protect critical data structures, instead\nof lockless algorithms.  Furthermore, there are cases (like shared hardware,\nor other resource limits) where lockless access is mathematically impossible.\n\nMedia players (such as Jack) are an example of reasonable application design\nwith multiple tasks (with multiple priority levels) sharing short-held locks:\nfor example, a highprio audio playback thread is combined with medium-prio\nconstruct-audio-data threads and low-prio display-colory-stuff threads.  Add\nvideo and decoding to the mix and we\u0027ve got even more priority levels.\n\nSo once we accept that synchronization objects (locks) are an unavoidable fact\nof life, and once we accept that multi-task userspace apps have a very fair\nexpectation of being able to use locks, we\u0027ve got to think about how to offer\nthe option of a deterministic locking implementation to user-space.\n\nMost of the technical counter-arguments against doing priority inheritance\nonly apply to kernel-space locks.  But user-space locks are different, there\nwe cannot disable interrupts or make the task non-preemptible in a critical\nsection, so the \u0027use spinlocks\u0027 argument does not apply (user-space spinlocks\nhave the same priority inversion problems as other user-space locking\nconstructs).  Fact is, pretty much the only technique that currently enables\ngood determinism for userspace locks (such as futex-based pthread mutexes) is\npriority inheritance:\n\nCurrently (without PI), if a high-prio and a low-prio task shares a lock [this\nis a quite common scenario for most non-trivial RT applications], even if all\ncritical sections are coded carefully to be deterministic (i.e.  all critical\nsections are short in duration and only execute a limited number of\ninstructions), the kernel cannot guarantee any deterministic execution of the\nhigh-prio task: any medium-priority task could preempt the low-prio task while\nit holds the shared lock and executes the critical section, and could delay it\nindefinitely.\n\n  Implementation:\n  ---------------\n\nAs mentioned before, the userspace fastpath of PI-enabled pthread mutexes\ninvolves no kernel work at all - they behave quite similarly to normal\nfutex-based locks: a 0 value means unlocked, and a value\u003d\u003dTID means locked.\n(This is the same method as used by list-based robust futexes.) Userspace uses\natomic ops to lock/unlock these mutexes without entering the kernel.\n\nTo handle the slowpath, we have added two new futex ops:\n\n  FUTEX_LOCK_PI\n  FUTEX_UNLOCK_PI\n\nIf the lock-acquire fastpath fails, [i.e.  an atomic transition from 0 to TID\nfails], then FUTEX_LOCK_PI is called.  The kernel does all the remaining work:\nif there is no futex-queue attached to the futex address yet then the code\nlooks up the task that owns the futex [it has put its own TID into the futex\nvalue], and attaches a \u0027PI state\u0027 structure to the futex-queue.  The pi_state\nincludes an rt-mutex, which is a PI-aware, kernel-based synchronization\nobject.  The \u0027other\u0027 task is made the owner of the rt-mutex, and the\nFUTEX_WAITERS bit is atomically set in the futex value.  Then this task tries\nto lock the rt-mutex, on which it blocks.  Once it returns, it has the mutex\nacquired, and it sets the futex value to its own TID and returns.  Userspace\nhas no other work to perform - it now owns the lock, and futex value contains\nFUTEX_WAITERS|TID.\n\nIf the unlock side fastpath succeeds, [i.e.  userspace manages to do a TID -\u003e\n0 atomic transition of the futex value], then no kernel work is triggered.\n\nIf the unlock fastpath fails (because the FUTEX_WAITERS bit is set), then\nFUTEX_UNLOCK_PI is called, and the kernel unlocks the futex on the behalf of\nuserspace - and it also unlocks the attached pi_state-\u003ert_mutex and thus wakes\nup any potential waiters.\n\nNote that under this approach, contrary to other PI-futex approaches, there is\nno prior \u0027registration\u0027 of a PI-futex.  [which is not quite possible anyway,\ndue to existing ABI properties of pthread mutexes.]\n\nAlso, under this scheme, \u0027robustness\u0027 and \u0027PI\u0027 are two orthogonal properties\nof futexes, and all four combinations are possible: futex, robust-futex,\nPI-futex, robust+PI-futex.\n\n  glibc support:\n  --------------\n\nUlrich Drepper and Jakub Jelinek have written glibc support for PI-futexes\n(and robust futexes), enabling robust and PI (PTHREAD_PRIO_INHERIT) POSIX\nmutexes.  (PTHREAD_PRIO_PROTECT support will be added later on too, no\nadditional kernel changes are needed for that).  [NOTE: The glibc patch is\nobviously inofficial and unsupported without matching upstream kernel\nfunctionality.]\n\nthe patch-queue and the glibc patch can also be downloaded from:\n\n  http://redhat.com/~mingo/PI-futex-patches/\n\nMany thanks go to the people who helped us create this kernel feature: Steven\nRostedt, Esben Nielsen, Benedikt Spranger, Daniel Walker, John Cooper, Arjan\nvan de Ven, Oleg Nesterov and others.  Credits for related prior projects goes\nto Dirk Grambow, Inaky Perez-Gonzalez, Bill Huey and many others.\n\nClean up the futex code, before adding more features to it:\n\n - use u32 as the futex field type - that\u0027s the ABI\n - use __user and pointers to u32 instead of unsigned long\n - code style / comment style cleanups\n - rename hash-bucket name from \u0027bh\u0027 to \u0027hb\u0027.\n\nI checked the pre and post futex.o object files to make sure this\npatch has no code effects.\n\nSigned-off-by: Ingo Molnar \u003cmingo@elte.hu\u003e\nSigned-off-by: Thomas Gleixner \u003ctglx@linutronix.de\u003e\nSigned-off-by: Arjan van de Ven \u003carjan@linux.intel.com\u003e\nCc: Ulrich Drepper \u003cdrepper@redhat.com\u003e\nCc: Jakub Jelinek \u003cjakub@redhat.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "454e2398be9b9fa30433fccc548db34d19aa9958",
      "tree": "1f61cb0c3716a33b661cfc8977e9beeb480a322c",
      "parents": [
        "1ad5544098a69d7dc1fa508cbb17e13a7a952fd8"
      ],
      "author": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Jun 23 02:02:57 2006 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Fri Jun 23 07:42:45 2006 -0700"
      },
      "message": "[PATCH] VFS: Permit filesystem to override root dentry on mount\n\nExtend the get_sb() filesystem operation to take an extra argument that\npermits the VFS to pass in the target vfsmount that defines the mountpoint.\n\nThe filesystem is then required to manually set the superblock and root dentry\npointers.  For most filesystems, this should be done with simple_set_mnt()\nwhich will set the superblock pointer and then set the root dentry to the\nsuperblock\u0027s s_root (as per the old default behaviour).\n\nThe get_sb() op now returns an integer as there\u0027s now no need to return the\nsuperblock pointer.\n\nThis patch permits a superblock to be implicitly shared amongst several mount\npoints, such as can be done with NFS to avoid potential inode aliasing.  In\nsuch a case, simple_set_mnt() would not be called, and instead the mnt_root\nand mnt_sb would be set directly.\n\nThe patch also makes the following changes:\n\n (*) the get_sb_*() convenience functions in the core kernel now take a vfsmount\n     pointer argument and return an integer, so most filesystems have to change\n     very little.\n\n (*) If one of the convenience function is not used, then get_sb() should\n     normally call simple_set_mnt() to instantiate the vfsmount. This will\n     always return 0, and so can be tail-called from get_sb().\n\n (*) generic_shutdown_super() now calls shrink_dcache_sb() to clean up the\n     dcache upon superblock destruction rather than shrink_dcache_anon().\n\n     This is required because the superblock may now have multiple trees that\n     aren\u0027t actually bound to s_root, but that still need to be cleaned up. The\n     currently called functions assume that the whole tree is rooted at s_root,\n     and that anonymous dentries are not the roots of trees which results in\n     dentries being left unculled.\n\n     However, with the way NFS superblock sharing are currently set to be\n     implemented, these assumptions are violated: the root of the filesystem is\n     simply a dummy dentry and inode (the real inode for \u0027/\u0027 may well be\n     inaccessible), and all the vfsmounts are rooted on anonymous[*] dentries\n     with child trees.\n\n     [*] Anonymous until discovered from another tree.\n\n (*) The documentation has been adjusted, including the additional bit of\n     changing ext2_* into foo_* in the documentation.\n\n[akpm@osdl.org: convert ipath_fs, do other stuff]\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nAcked-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\nCc: Nathan Scott \u003cnathans@sgi.com\u003e\nCc: Roland Dreier \u003crolandd@cisco.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "9741ef964dc8bfeb6520825df9fed8f538c3336e",
      "tree": "6cc09d6b10a9ea9119a3a73e226300d747008bfe",
      "parents": [
        "d425b274ba83ba4e7746a40446ec0ba3267de51f"
      ],
      "author": {
        "name": "Thomas Gleixner",
        "email": "tglx@linutronix.de",
        "time": "Fri Mar 31 02:31:32 2006 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Fri Mar 31 12:18:59 2006 -0800"
      },
      "message": "[PATCH] futex: check and validate timevals\n\nThe futex timeval is not checked for correctness.  The change does not\nbreak existing applications as the timeval is supplied by glibc (and glibc\nalways passes a correct value), but the glibc-internal tests for this\nfunctionality fail.\n\nSigned-off-by: Thomas Gleixner \u003ctglx@tglx.de\u003e\nSigned-off-by: Ingo Molnar \u003cmingo@elte.hu\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "8f17d3a5049d32392b79925c73a0cf99ce6d5af0",
      "tree": "3c2aa0cbe337684d353dd2cfb0c177b4ae15217c",
      "parents": [
        "8fdd6c6df7889dc89df3d9fe0f5bbe6733e39f48"
      ],
      "author": {
        "name": "Ingo Molnar",
        "email": "mingo@elte.hu",
        "time": "Mon Mar 27 01:16:27 2006 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Mon Mar 27 08:44:49 2006 -0800"
      },
      "message": "[PATCH] lightweight robust futexes updates\n\n- fix: initialize the robust list(s) to NULL in copy_process.\n\n- doc update\n\n- cleanup: rename _inuser to _inatomic\n\n- __user cleanups and other small cleanups\n\nSigned-off-by: Ingo Molnar \u003cmingo@elte.hu\u003e\nCc: Thomas Gleixner \u003ctglx@linutronix.de\u003e\nCc: Arjan van de Ven \u003carjan@infradead.org\u003e\nCc: Ulrich Drepper \u003cdrepper@redhat.com\u003e\nCc: Andi Kleen \u003cak@muc.de\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "0771dfefc9e538f077d0b43b6dec19a5a67d0e70",
      "tree": "696267e69228b7406b337f9651dedc75055a589e",
      "parents": [
        "e9056f13bfcdd054a0c3d730e4e096748d8a363a"
      ],
      "author": {
        "name": "Ingo Molnar",
        "email": "mingo@elte.hu",
        "time": "Mon Mar 27 01:16:22 2006 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Mon Mar 27 08:44:49 2006 -0800"
      },
      "message": "[PATCH] lightweight robust futexes: core\n\nAdd the core infrastructure for robust futexes: structure definitions, the new\nsyscalls and the do_exit() based cleanup mechanism.\n\nSigned-off-by: Ingo Molnar \u003cmingo@elte.hu\u003e\nSigned-off-by: Thomas Gleixner \u003ctglx@linutronix.de\u003e\nSigned-off-by: Arjan van de Ven \u003carjan@infradead.org\u003e\nAcked-by: Ulrich Drepper \u003cdrepper@redhat.com\u003e\nCc: Michael Kerrisk \u003cmtk-manpages@gmx.net\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "7ee1dd3fee22f15728f545d266403fc977e1eb99",
      "tree": "e2f9f42b0731d5006fa329a590069be6787af1de",
      "parents": [
        "5c40f7f373889930d176a515ec375b60a70b5b49"
      ],
      "author": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Jan 06 00:11:44 2006 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Fri Jan 06 08:33:33 2006 -0800"
      },
      "message": "[PATCH] FRV: Make futex code compilable on nommu [try #2]\n\nMake the futex code compilable and usable on NOMMU by making the attempt to\nhandle page faults conditional on CONFIG_MMU.  If this is not enabled, then\nwe can assume that EFAULT returned from futex_atomic_op_inuser() is not\nrecoverable, and that the address lies outside of valid memory.\n\nhandle_mm_fault() is made to BUG if called on NOMMU without attempting to\ninvoke the actual handler (__handle_mm_fault).\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "8e31108b9f41069d55cb9b019ac8262c55fd2616",
      "tree": "4d3b74956402b978417ee1026fa18409773cd72e",
      "parents": [
        "6003a93e7bf6c02f33c02976ff364785d4273295"
      ],
      "author": {
        "name": "Andrew Morton",
        "email": "akpm@osdl.org",
        "time": "Fri Dec 23 19:54:46 2005 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Sat Dec 24 12:13:27 2005 -0800"
      },
      "message": "[PATCH] Fix memory ordering problem in wake_futex()\n\nFix a memory ordering problem that occurs on IA64. The \"store\" to q-\u003elock_ptr\nin wake_futex() can become visible before wake_up_all() clears the lock in the\nfutex_q.\n\nSigned-off-by: Jack Steiner \u003csteiner@sgi.com\u003e\nAcked-by: Ingo Molnar \u003cmingo@elte.hu\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "cc3327e7dfc16a9a3e164075234c869867a59e45",
      "tree": "d120c13540a7fa4769c0bf53eb12628a76366631",
      "parents": [
        "7b6ac9dffe6f4dd8776908b234ac1410ed15f112"
      ],
      "author": {
        "name": "Hugh Dickins",
        "email": "hugh@veritas.com",
        "time": "Wed Nov 23 13:37:38 2005 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Wed Nov 23 16:08:38 2005 -0800"
      },
      "message": "[PATCH] mm: unbloat get_futex_key\n\nThe follow_page changes in get_futex_key have left it with two almost\nidentical blocks, when handling the rare case of a futex in a nonlinear vma.\nget_user_pages will itself do that follow_page, and its additional\nfind_extend_vma is hardly any overhead since the vma is already cached.  Let\u0027s\njust delete the follow_page block and let get_user_pages do it.\n\nSigned-off-by: Hugh Dickins \u003chugh@veritas.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "796f8d9b98fc92a5e9aaea8cf932957850332f51",
      "tree": "66e0a2bdf18e03c7dadba7c4c7b896533aa2e762",
      "parents": [
        "d55b5fdaf40846221d543937b786956e27837fda"
      ],
      "author": {
        "name": "David Gibson",
        "email": "david@gibson.dropbear.id.au",
        "time": "Mon Nov 07 00:59:33 2005 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Mon Nov 07 07:53:38 2005 -0800"
      },
      "message": "[PATCH] FUTEX_WAKE_OP: enhanced error handling\n\nThe code for FUTEX_WAKE_OP calls an arch callback,\nfutex_atomic_op_inuser().  That callback can return an error code, but\ncurrently the caller assumes any error is EFAULT, and will try various\nthings to resolve the fault before eventually giving up with EFAULT\n(regardless of the original error code).  This is not a theoretical case -\narch callbacks currently return -ENOSYS if the opcode they are given is\nbogus.\n\nThis patch alters the code to detect non-EFAULT errors and return them\ndirectly to the user.\n\nOf course, whether -ENOSYS is the correct return value for the bogus opcode\ncase, or whether EINVAL would be more appropriate is another question.\n\nSigned-off-by: David Gibson \u003cdwg@au1.ibm.com\u003e\nCc: Rusty Russell \u003crusty@rustcorp.com.au\u003e\nCc: Ingo Molnar \u003cmingo@elte.hu\u003e\nCc: Jamie Lokier \u003cjamie@shareable.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "deceb6cd17e6dfafe4c4f81b1b4153bc41b2cb70",
      "tree": "2a722f50e8edef8609a49f65bfcb222e499c44cc",
      "parents": [
        "c34d1b4d165c67b966bca4aba026443d7ff161eb"
      ],
      "author": {
        "name": "Hugh Dickins",
        "email": "hugh@veritas.com",
        "time": "Sat Oct 29 18:16:33 2005 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Sat Oct 29 21:40:41 2005 -0700"
      },
      "message": "[PATCH] mm: follow_page with inner ptlock\n\nFinal step in pushing down common core\u0027s page_table_lock.  follow_page no\nlonger wants caller to hold page_table_lock, uses pte_offset_map_lock itself;\nand so no page_table_lock is taken in get_user_pages itself.\n\nBut get_user_pages (and get_futex_key) do then need follow_page to pin the\npage for them: take Daniel\u0027s suggestion of bitflags to follow_page.\n\nNeed one for WRITE, another for TOUCH (it was the accessed flag before:\nvanished along with check_user_page_readable, but surely get_numa_maps is\nwrong to mark every page it finds as accessed), another for GET.\n\nAnd another, ANON to dispose of untouched_anonymous_page: it seems silly for\nthat to descend a second time, let follow_page observe if there was no page\ntable and return ZERO_PAGE if so.  Fix minor bug in that: check VM_LOCKED -\nmake_pages_present ought to make readonly anonymous present.\n\nGive get_numa_maps a cond_resched while we\u0027re there.\n\nSigned-off-by: Hugh Dickins \u003chugh@veritas.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "39ed3fdeec1290dd246dcf1da6b278566987a084",
      "tree": "46b4f08e2c61eca5871c4805ec4448f1408f2e69",
      "parents": [
        "580b2e3c0183818adf6151e60270405b02ea8504"
      ],
      "author": {
        "name": "Pekka Enberg",
        "email": "penberg@cs.helsinki.fi",
        "time": "Tue Sep 06 15:17:44 2005 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Wed Sep 07 16:57:33 2005 -0700"
      },
      "message": "[PATCH] futex: remove duplicate code\n\nThis patch cleans up the error path of futex_fd() by removing duplicate\ncode.\n\nSigned-off-by: Pekka Enberg \u003cpenberg@cs.helsinki.fi\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "4732efbeb997189d9f9b04708dc26bf8613ed721",
      "tree": "885308bb2b521e52e13aaa8a67c78b2ab3c18cd8",
      "parents": [
        "5b039e681b8c5f30aac9cc04385cc94be45d0823"
      ],
      "author": {
        "name": "Jakub Jelinek",
        "email": "jakub@redhat.com",
        "time": "Tue Sep 06 15:16:25 2005 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Wed Sep 07 16:57:17 2005 -0700"
      },
      "message": "[PATCH] FUTEX_WAKE_OP: pthread_cond_signal() speedup\n\nATM pthread_cond_signal is unnecessarily slow, because it wakes one waiter\n(which at least on UP usually means an immediate context switch to one of\nthe waiter threads).  This waiter wakes up and after a few instructions it\nattempts to acquire the cv internal lock, but that lock is still held by\nthe thread calling pthread_cond_signal.  So it goes to sleep and eventually\nthe signalling thread is scheduled in, unlocks the internal lock and wakes\nthe waiter again.\n\nNow, before 2003-09-21 NPTL was using FUTEX_REQUEUE in pthread_cond_signal\nto avoid this performance issue, but it was removed when locks were\nredesigned to the 3 state scheme (unlocked, locked uncontended, locked\ncontended).\n\nFollowing scenario shows why simply using FUTEX_REQUEUE in\npthread_cond_signal together with using lll_mutex_unlock_force in place of\nlll_mutex_unlock is not enough and probably why it has been disabled at\nthat time:\n\nThe number is value in cv-\u003e__data.__lock.\n        thr1            thr2            thr3\n0       pthread_cond_wait\n1       lll_mutex_lock (cv-\u003e__data.__lock)\n0       lll_mutex_unlock (cv-\u003e__data.__lock)\n0       lll_futex_wait (\u0026cv-\u003e__data.__futex, futexval)\n0                       pthread_cond_signal\n1                       lll_mutex_lock (cv-\u003e__data.__lock)\n1                                       pthread_cond_signal\n2                                       lll_mutex_lock (cv-\u003e__data.__lock)\n2                                         lll_futex_wait (\u0026cv-\u003e__data.__lock, 2)\n2                       lll_futex_requeue (\u0026cv-\u003e__data.__futex, 0, 1, \u0026cv-\u003e__data.__lock)\n                          # FUTEX_REQUEUE, not FUTEX_CMP_REQUEUE\n2                       lll_mutex_unlock_force (cv-\u003e__data.__lock)\n0                         cv-\u003e__data.__lock \u003d 0\n0                         lll_futex_wake (\u0026cv-\u003e__data.__lock, 1)\n1       lll_mutex_lock (cv-\u003e__data.__lock)\n0       lll_mutex_unlock (cv-\u003e__data.__lock)\n          # Here, lll_mutex_unlock doesn\u0027t know there are threads waiting\n          # on the internal cv\u0027s lock\n\nNow, I believe it is possible to use FUTEX_REQUEUE in pthread_cond_signal,\nbut it will cost us not one, but 2 extra syscalls and, what\u0027s worse, one of\nthese extra syscalls will be done for every single waiting loop in\npthread_cond_*wait.\n\nWe would need to use lll_mutex_unlock_force in pthread_cond_signal after\nrequeue and lll_mutex_cond_lock in pthread_cond_*wait after lll_futex_wait.\n\nAnother alternative is to do the unlocking pthread_cond_signal needs to do\n(the lock can\u0027t be unlocked before lll_futex_wake, as that is racy) in the\nkernel.\n\nI have implemented both variants, futex-requeue-glibc.patch is the first\none and futex-wake_op{,-glibc}.patch is the unlocking inside of the kernel.\n The kernel interface allows userland to specify how exactly an unlocking\noperation should look like (some atomic arithmetic operation with optional\nconstant argument and comparison of the previous futex value with another\nconstant).\n\nIt has been implemented just for ppc*, x86_64 and i?86, for other\narchitectures I\u0027m including just a stub header which can be used as a\nstarting point by maintainers to write support for their arches and ATM\nwill just return -ENOSYS for FUTEX_WAKE_OP.  The requeue patch has been\n(lightly) tested just on x86_64, the wake_op patch on ppc64 kernel running\n32-bit and 64-bit NPTL and x86_64 kernel running 32-bit and 64-bit NPTL.\n\nWith the following benchmark on UP x86-64 I get:\n\nfor i in nptl-orig nptl-requeue nptl-wake_op; do echo time elf/ld.so --library-path .:$i /tmp/bench; \\\nfor j in 1 2; do echo ( time elf/ld.so --library-path .:$i /tmp/bench ) 2\u003e\u00261; done; done\ntime elf/ld.so --library-path .:nptl-orig /tmp/bench\nreal 0m0.655s user 0m0.253s sys 0m0.403s\nreal 0m0.657s user 0m0.269s sys 0m0.388s\ntime elf/ld.so --library-path .:nptl-requeue /tmp/bench\nreal 0m0.496s user 0m0.225s sys 0m0.271s\nreal 0m0.531s user 0m0.242s sys 0m0.288s\ntime elf/ld.so --library-path .:nptl-wake_op /tmp/bench\nreal 0m0.380s user 0m0.176s sys 0m0.204s\nreal 0m0.382s user 0m0.175s sys 0m0.207s\n\nThe benchmark is at:\nhttp://sourceware.org/ml/libc-alpha/2005-03/txt00001.txt\nOlder futex-requeue-glibc.patch version is at:\nhttp://sourceware.org/ml/libc-alpha/2005-03/txt00002.txt\nOlder futex-wake_op-glibc.patch version is at:\nhttp://sourceware.org/ml/libc-alpha/2005-03/txt00003.txt\nWill post a new version (just x86-64 fixes so that the patch\napplies against pthread_cond_signal.S) to libc-hacker ml soon.\n\nAttached is the kernel FUTEX_WAKE_OP patch as well as a simple-minded\ntestcase that will not test the atomicity of the operation, but at least\ncheck if the threads that should have been woken up are woken up and\nwhether the arithmetic operation in the kernel gave the expected results.\n\nAcked-by: Ingo Molnar \u003cmingo@redhat.com\u003e\nCc: Ulrich Drepper \u003cdrepper@redhat.com\u003e\nCc: Jamie Lokier \u003cjamie@shareable.org\u003e\nCc: Rusty Russell \u003crusty@rustcorp.com.au\u003e\nSigned-off-by: Yoichi Yuasa \u003cyuasa@hh.iij4u.or.jp\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "7ed20e1ad521b5f5df61bf6559ae60738e393741",
      "tree": "90931724e45eaedb3445314e8b94e78253642395",
      "parents": [
        "e5bdd883a189243541e7a132385580703b049102"
      ],
      "author": {
        "name": "Jesper Juhl",
        "email": "juhl-lkml@dif.dk",
        "time": "Sun May 01 08:59:14 2005 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@ppc970.osdl.org",
        "time": "Sun May 01 08:59:14 2005 -0700"
      },
      "message": "[PATCH] convert that currently tests _NSIG directly to use valid_signal()\n\nConvert most of the current code that uses _NSIG directly to instead use\nvalid_signal().  This avoids gcc -W warnings and off-by-one errors.\n\nSigned-off-by: Jesper Juhl \u003cjuhl-lkml@dif.dk\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2",
      "tree": "0bba044c4ce775e45a88a51686b5d9f90697ea9d",
      "parents": [],
      "author": {
        "name": "Linus Torvalds",
        "email": "torvalds@ppc970.osdl.org",
        "time": "Sat Apr 16 15:20:36 2005 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@ppc970.osdl.org",
        "time": "Sat Apr 16 15:20:36 2005 -0700"
      },
      "message": "Linux-2.6.12-rc2\n\nInitial git repository build. I\u0027m not bothering with the full history,\neven though we have it. We can create a separate \"historical\" git\narchive of that later if we want to, and in the meantime it\u0027s about\n3.2GB when imported into git - space that would just make the early\ngit days unnecessarily complicated, when we don\u0027t have a lot of good\ninfrastructure for it.\n\nLet it rip!\n"
    }
  ]
}
