)]}'
{
  "commit": "386afc91144b36b42117b0092893f15bc8798a80",
  "tree": "1323fff10c28d7d802bb57d7e11e11907afe7cc0",
  "parents": [
    "3e2e0d2c222bdf5bafd722dec1618fa6073ef372"
  ],
  "author": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Tue Apr 09 10:48:33 2013 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Tue Apr 09 10:48:33 2013 -0700"
  },
  "message": "spinlocks and preemption points need to be at least compiler barriers\n\nIn UP and non-preempt respectively, the spinlocks and preemption\ndisable/enable points are stubbed out entirely, because there is no\nregular code that can ever hit the kind of concurrency they are meant to\nprotect against.\n\nHowever, while there is no regular code that can cause scheduling, we\n_do_ end up having some exceptional (literally!) code that can do so,\nand that we need to make sure does not ever get moved into the critical\nregion by the compiler.\n\nIn particular, get_user() and put_user() is generally implemented as\ninline asm statements (even if the inline asm may then make a call\ninstruction to call out-of-line), and can obviously cause a page fault\nand IO as a result.  If that inline asm has been scheduled into the\nmiddle of a preemption-safe (or spinlock-protected) code region, we\nobviously lose.\n\nNow, admittedly this is *very* unlikely to actually ever happen, and\nwe\u0027ve not seen examples of actual bugs related to this.  But partly\nexactly because it\u0027s so hard to trigger and the resulting bug is so\nsubtle, we should be extra careful to get this right.\n\nSo make sure that even when preemption is disabled, and we don\u0027t have to\ngenerate any actual *code* to explicitly tell the system that we are in\na preemption-disabled region, we need to at least tell the compiler not\nto move things around the critical region.\n\nThis patch grew out of the same discussion that caused commits\n79e5f05edcbf (\"ARC: Add implicit compiler barrier to raw_local_irq*\nfunctions\") and 3e2e0d2c222b (\"tile: comment assumption about\n__insn_mtspr for \u003casm/irqflags.h\u003e\") to come about.\n\nNote for stable: use discretion when/if applying this.  As mentioned,\nthis bug may never have actually bitten anybody, and gcc may never have\ndone the required code motion for it to possibly ever trigger in\npractice.\n\nCc: stable@vger.kernel.org\nCc: Steven Rostedt \u003csrostedt@redhat.com\u003e\nCc: Peter Zijlstra \u003cpeterz@infradead.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5a710b9c578e2881478872d505e8b649e8bdb55f",
      "old_mode": 33188,
      "old_path": "include/linux/preempt.h",
      "new_id": "87a03c746f177be0b4ddc0dee6a61860d596ff3d",
      "new_mode": 33188,
      "new_path": "include/linux/preempt.h"
    },
    {
      "type": "modify",
      "old_id": "a26e2fb604e6e5f004e93da22d4f5355bf9a7358",
      "old_mode": 33188,
      "old_path": "include/linux/spinlock_up.h",
      "new_id": "e2369c167dbd9e7300ecbf617cbc9d8f291c8dc0",
      "new_mode": 33188,
      "new_path": "include/linux/spinlock_up.h"
    }
  ]
}
