)]}'
{
  "commit": "74d4affde8feb8d5bdebf7fba8e90e4eae3b7b1d",
  "tree": "ea70d2323c8a424e8c20389514c6c91f149cdf72",
  "parents": [
    "094029479be8eb380447f42eff1b35362ef1a464"
  ],
  "author": {
    "name": "Jeremy Fitzhardinge",
    "email": "jeremy@goop.org",
    "time": "Mon Jul 07 12:07:50 2008 -0700"
  },
  "committer": {
    "name": "Ingo Molnar",
    "email": "mingo@elte.hu",
    "time": "Wed Jul 16 11:15:52 2008 +0200"
  },
  "message": "x86/paravirt: add hooks for spinlock operations\n\nTicket spinlocks have absolutely ghastly worst-case performance\ncharacteristics in a virtual environment.  If there is any contention\nfor physical CPUs (ie, there are more runnable vcpus than cpus), then\nticket locks can cause the system to end up spending 90+% of its time\nspinning.\n\nThe problem is that (v)cpus waiting on a ticket spinlock will be\ngranted access to the lock in strict order they got their tickets.  If\nthe hypervisor scheduler doesn\u0027t give the vcpus time in that order,\nthey will burn timeslices waiting for the scheduler to give the right\nvcpu some time.  In the worst case it could take O(n^2) vcpu scheduler\ntimeslices for everyone waiting on the lock to get it, not counting\nnew cpus trying to take the lock while the log-jam is sorted out.\n\nThese hooks allow a paravirt backend to replace the spinlock\nimplementation.\n\nAt the very least, this could revert the implementation back to the\nold lock algorithm, which allows the next scheduled vcpu to take the\nlock, and has basically fairly good performance.\n\nIt also allows the spinlocks to take advantages of the hypervisor\nfeatures to make locks more efficient (spin and block, for example).\n\nThe cost to native execution is an extra direct call when using a\nspinlock function.  There\u0027s no overhead if CONFIG_PARAVIRT is turned\noff.\n\nThe lock structure is fixed at a single \"unsigned int\", initialized to\nzero, but the spinlock implementation can use it as it wishes.\n\nThanks to Thomas Friebel\u0027s Xen Summit talk \"Preventing Guests from\nSpinning Around\" for pointing out this problem.\n\nSigned-off-by: Jeremy Fitzhardinge \u003cjeremy.fitzhardinge@citrix.com\u003e\nCc: Jens Axboe \u003caxboe@kernel.dk\u003e\nCc: Peter Zijlstra \u003ca.p.zijlstra@chello.nl\u003e\nCc: Christoph Lameter \u003cclameter@linux-foundation.org\u003e\nCc: Petr Tesarik \u003cptesarik@suse.cz\u003e\nCc: Virtualization \u003cvirtualization@lists.linux-foundation.org\u003e\nCc: Xen devel \u003cxen-devel@lists.xensource.com\u003e\nCc: Thomas Friebel \u003cthomas.friebel@amd.com\u003e\nCc: Nick Piggin \u003cnickpiggin@yahoo.com.au\u003e\nSigned-off-by: Ingo Molnar \u003cmingo@elte.hu\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2963ab5d91eec94f7b9748f53e98004ed4d19663",
      "old_mode": 33188,
      "old_path": "arch/x86/kernel/paravirt.c",
      "new_id": "f33816868707dca960c084858e4ab727eb10f104",
      "new_mode": 33188,
      "new_path": "arch/x86/kernel/paravirt.c"
    },
    {
      "type": "modify",
      "old_id": "eef8095a09dcca01b0cb7ad4aa4c76ef52fe10f9",
      "old_mode": 33188,
      "old_path": "include/asm-x86/paravirt.h",
      "new_id": "feb6bb66c5e222192beacf03e530c042a1350e46",
      "new_mode": 33188,
      "new_path": "include/asm-x86/paravirt.h"
    },
    {
      "type": "modify",
      "old_id": "21e89bf92f1c8cd547b697fcc37021388d8115e2",
      "old_mode": 33188,
      "old_path": "include/asm-x86/spinlock.h",
      "new_id": "9726144cdabac781bb60d87e3039c6d926ebb498",
      "new_mode": 33188,
      "new_path": "include/asm-x86/spinlock.h"
    },
    {
      "type": "modify",
      "old_id": "9029cf78cf5dce2ece4ede3251a300697d74f9b2",
      "old_mode": 33188,
      "old_path": "include/asm-x86/spinlock_types.h",
      "new_id": "06c071c9eee9f1d2e5288930b91e511a3d094d61",
      "new_mode": 33188,
      "new_path": "include/asm-x86/spinlock_types.h"
    }
  ]
}
