)]}'
{
  "commit": "c06aad854fdb9da38fcc22dccfe9d72919453e43",
  "tree": "a27fc99fe974cc5df08393c5b16b4499b07aa3e5",
  "parents": [
    "9a654518e1b774b8e8f74a819fd12a931e7672c9"
  ],
  "author": {
    "name": "Daniel Kobras",
    "email": "kobras@linux.de",
    "time": "Sun Aug 27 01:23:24 2006 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@g5.osdl.org",
    "time": "Sun Aug 27 11:01:28 2006 -0700"
  },
  "message": "[PATCH] dm: Fix deadlock under high i/o load in raid1 setup.\n\nOn an nForce4-equipped machine with two SATA disk in raid1 setup using dmraid,\nwe experienced frequent deadlock of the system under high i/o load.  \u0027cat\n/dev/zero \u003e ~/zero\u0027 was the most reliable way to reproduce them: Randomly\nafter a few GB, \u0027cp\u0027 would be left in \u0027D\u0027 state along with kjournald and\nkmirrord.  The functions cp and kjournald were blocked in did vary, but\nkmirrord\u0027s wchan always pointed to \u0027mempool_alloc()\u0027.  We\u0027ve seen this pattern\non 2.6.15 and 2.6.17 kernels.  http://lkml.org/lkml/2005/4/20/142 indicates\nthat this problem has been around even before.\n\nSo much for the facts, here\u0027s my interpretation: mempool_alloc() first tries\nto atomically allocate the requested memory, or falls back to hand out\npreallocated chunks from the mempool.  If both fail, it puts the calling\nprocess (kmirrord in this case) on a private waitqueue until somebody refills\nthe pool.  Where the only \u0027somebody\u0027 is kmirrord itself, so we have a\ndeadlock.\n\nI worked around this problem by falling back to a (blocking) kmalloc when\nbefore kmirrord would have ended up on the waitqueue.  This defeats part of\nthe benefits of using the mempool, but at least keeps the system running.  And\nit could be done with a two-line change.  Note that mempool_alloc() clears the\nGFP_NOIO flag internally, and only uses it to decide whether to wait or return\nan error if immediate allocation fails, so the attached patch doesn\u0027t change\nbehaviour in the non-deadlocking case.  Path is against current git\n(2.6.18-rc4), but should apply to earlier versions as well.  I\u0027ve tested on\n2.6.15, where this patch makes the difference between random lockup and a\nstable system.\n\nSigned-off-by: Daniel Kobras \u003ckobras@linux.de\u003e\nAcked-by: Alasdair G Kergon \u003cagk@redhat.com\u003e\nCc: \u003cstable@kernel.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "be48cedf986bb5e9ead2b3fb91800941950b9be2",
      "old_mode": 33188,
      "old_path": "drivers/md/dm-raid1.c",
      "new_id": "c54de989eb005e74738800557f37f1ce0459753f",
      "new_mode": 33188,
      "new_path": "drivers/md/dm-raid1.c"
    }
  ]
}
