)]}'
{
  "log": [
    {
      "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": "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"
    }
  ]
}
