)]}'
{
  "log": [
    {
      "commit": "e30e2fdfe56288576ee9e04dbb06b4bd5f282203",
      "tree": "15c207b3c124d1fa5ef2ee400b3f27ca233d47a5",
      "parents": [
        "ecefc36b41ac0fe92d76273a23faf27b2da13411"
      ],
      "author": {
        "name": "Srivatsa S. Bhat",
        "email": "srivatsa.bhat@linux.vnet.ibm.com",
        "time": "Thu Dec 22 02:45:29 2011 +0530"
      },
      "committer": {
        "name": "Al Viro",
        "email": "viro@zeniv.linux.org.uk",
        "time": "Thu Dec 22 02:02:20 2011 -0500"
      },
      "message": "VFS: Fix race between CPU hotplug and lglocks\n\nCurrently, the *_global_[un]lock_online() routines are not at all synchronized\nwith CPU hotplug. Soft-lockups detected as a consequence of this race was\nreported earlier at https://lkml.org/lkml/2011/8/24/185. (Thanks to Cong Meng\nfor finding out that the root-cause of this issue is the race condition\nbetween br_write_[un]lock() and CPU hotplug, which results in the lock states\ngetting messed up).\n\nFixing this race by just adding {get,put}_online_cpus() at appropriate places\nin *_global_[un]lock_online() is not a good option, because, then suddenly\nbr_write_[un]lock() would become blocking, whereas they have been kept as\nnon-blocking all this time, and we would want to keep them that way.\n\nSo, overall, we want to ensure 3 things:\n1. br_write_lock() and br_write_unlock() must remain as non-blocking.\n2. The corresponding lock and unlock of the per-cpu spinlocks must not happen\n   for different sets of CPUs.\n3. Either prevent any new CPU online operation in between this lock-unlock, or\n   ensure that the newly onlined CPU does not proceed with its corresponding\n   per-cpu spinlock unlocked.\n\nTo achieve all this:\n(a) We introduce a new spinlock that is taken by the *_global_lock_online()\n    routine and released by the *_global_unlock_online() routine.\n(b) We register a callback for CPU hotplug notifications, and this callback\n    takes the same spinlock as above.\n(c) We maintain a bitmap which is close to the cpu_online_mask, and once it is\n    initialized in the lock_init() code, all future updates to it are done in\n    the callback, under the above spinlock.\n(d) The above bitmap is used (instead of cpu_online_mask) while locking and\n    unlocking the per-cpu locks.\n\nThe callback takes the spinlock upon the CPU_UP_PREPARE event. So, if the\nbr_write_lock-unlock sequence is in progress, the callback keeps spinning,\nthus preventing the CPU online operation till the lock-unlock sequence is\ncomplete. This takes care of requirement (3).\n\nThe bitmap that we maintain remains unmodified throughout the lock-unlock\nsequence, since all updates to it are managed by the callback, which takes\nthe same spinlock as the one taken by the lock code and released only by the\nunlock routine. Combining this with (d) above, satisfies requirement (2).\n\nOverall, since we use a spinlock (mentioned in (a)) to prevent CPU hotplug\noperations from racing with br_write_lock-unlock, requirement (1) is also\ntaken care of.\n\nBy the way, it is to be noted that a CPU offline operation can actually run\nin parallel with our lock-unlock sequence, because our callback doesn\u0027t react\nto notifications earlier than CPU_DEAD (in order to maintain our bitmap\nproperly). And this means, since we use our own bitmap (which is stale, on\npurpose) during the lock-unlock sequence, we could end up unlocking the\nper-cpu lock of an offline CPU (because we had locked it earlier, when the\nCPU was online), in order to satisfy requirement (2). But this is harmless,\nthough it looks a bit awkward.\n\nDebugged-by: Cong Meng \u003cmc@linux.vnet.ibm.com\u003e\nSigned-off-by: Srivatsa S. Bhat \u003csrivatsa.bhat@linux.vnet.ibm.com\u003e\nSigned-off-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\nCc: stable@vger.kernel.org\n"
    },
    {
      "commit": "a73f8844e1fc54c3762555c1cf1f71774142ca91",
      "tree": "6cf860dead41a30f5fac677f0cd478efad564c8f",
      "parents": [
        "39aa3cb3e8250db9188a6f1e3fb62ffa1a717678"
      ],
      "author": {
        "name": "Jonathan Corbet",
        "email": "corbet@lwn.net",
        "time": "Wed Sep 08 16:54:54 2010 -0600"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Thu Sep 09 09:09:43 2010 -0700"
      },
      "message": "lglock: make lg_lock_global() actually lock globally\n\nlg_lock_global() currently only acquires spinlocks for online CPUs, but\nit\u0027s meant to lock all possible CPUs.  Lglock-protected resources may be\nassociated with removed CPUs - and, indeed, that could happen with the\nper-superblock open files lists.\n\nAt Nick\u0027s suggestion, change for_each_online_cpu() to\nfor_each_possible_cpu() to protect accesses to those resources.\n\nCc: Al Viro \u003cviro@ZenIV.linux.org.uk\u003e\nAcked-by: Nick Piggin \u003cnpiggin@kernel.dk\u003e\nSigned-off-by: Jonathan Corbet \u003ccorbet@lwn.net\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "2dc91abe03d8ce6dd7f9251faffafca5f6b9e85d",
      "tree": "1712fcb512310a80a7d2c7f92b30ce91750efaf1",
      "parents": [
        "d996b62a8df1d935b01319bf8defb95b5709f7b8"
      ],
      "author": {
        "name": "Nick Piggin",
        "email": "npiggin@kernel.dk",
        "time": "Wed Aug 18 04:37:37 2010 +1000"
      },
      "committer": {
        "name": "Al Viro",
        "email": "viro@zeniv.linux.org.uk",
        "time": "Wed Aug 18 08:35:48 2010 -0400"
      },
      "message": "lglock: introduce special lglock and brlock spin locks\n\nlglock: introduce special lglock and brlock spin locks\n\nThis patch introduces \"local-global\" locks (lglocks). These can be used to:\n\n- Provide fast exclusive access to per-CPU data, with exclusive access to\n  another CPU\u0027s data allowed but possibly subject to contention, and to provide\n  very slow exclusive access to all per-CPU data.\n- Or to provide very fast and scalable read serialisation, and to provide\n  very slow exclusive serialisation of data (not necessarily per-CPU data).\n\nBrlocks are also implemented as a short-hand notation for the latter use\ncase.\n\nThanks to Paul for local/global naming convention.\n\nCc: linux-kernel@vger.kernel.org\nCc: Al Viro \u003cviro@ZenIV.linux.org.uk\u003e\nCc: \"Paul E. McKenney\" \u003cpaulmck@linux.vnet.ibm.com\u003e\nSigned-off-by: Nick Piggin \u003cnpiggin@kernel.dk\u003e\nSigned-off-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\n"
    }
  ]
}
