)]}'
{
  "commit": "e2848a0efedef4dad52d1334d37f8719cd6268fd",
  "tree": "f5d2b600b1275793e7c490f34ae9ec902af138b5",
  "parents": [
    "e31d9eb5c17ae3b80f9e9403f8a5eaf6dba879c9"
  ],
  "author": {
    "name": "Nick Piggin",
    "email": "npiggin@suse.de",
    "time": "Mon Feb 04 22:29:10 2008 -0800"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@woody.linux-foundation.org",
    "time": "Tue Feb 05 09:44:17 2008 -0800"
  },
  "message": "radix-tree: avoid atomic allocations for preloaded insertions\n\nMost pagecache (and some other) radix tree insertions have the great\nopportunity to preallocate a few nodes with relaxed gfp flags.  But the\npreallocation is squandered when it comes time to allocate a node, we\ndefault to first attempting a GFP_ATOMIC allocation -- that doesn\u0027t\nnormally fail, but it can eat into atomic memory reserves that we don\u0027t\nneed to be using.\n\nAnother upshot of this is that it removes the sometimes highly contended\nzone-\u003elock from underneath tree_lock.  Pagecache insertions are always\nperformed with a radix tree preload, and after this change, such a\nsituation will never fall back to kmem_cache_alloc within\nradix_tree_node_alloc.\n\nDavid Miller reports seeing this allocation fail on a highly threaded\nsparc64 system:\n\n[527319.459981] dd: page allocation failure. order:0, mode:0x20\n[527319.460403] Call Trace:\n[527319.460568]  [00000000004b71e0] __slab_alloc+0x1b0/0x6a8\n[527319.460636]  [00000000004b7bbc] kmem_cache_alloc+0x4c/0xa8\n[527319.460698]  [000000000055309c] radix_tree_node_alloc+0x20/0x90\n[527319.460763]  [0000000000553238] radix_tree_insert+0x12c/0x260\n[527319.460830]  [0000000000495cd0] add_to_page_cache+0x38/0xb0\n[527319.460893]  [00000000004e4794] mpage_readpages+0x6c/0x134\n[527319.460955]  [000000000049c7fc] __do_page_cache_readahead+0x170/0x280\n[527319.461028]  [000000000049cc88] ondemand_readahead+0x208/0x214\n[527319.461094]  [0000000000496018] do_generic_mapping_read+0xe8/0x428\n[527319.461152]  [0000000000497948] generic_file_aio_read+0x108/0x170\n[527319.461217]  [00000000004badac] do_sync_read+0x88/0xd0\n[527319.461292]  [00000000004bb5cc] vfs_read+0x78/0x10c\n[527319.461361]  [00000000004bb920] sys_read+0x34/0x60\n[527319.461424]  [0000000000406294] linux_sparc_syscall32+0x3c/0x40\n\nThe calltrace is significant: __do_page_cache_readahead allocates a number\nof pages with GFP_KERNEL, and hence it should have reclaimed sufficient\nmemory to satisfy GFP_ATOMIC allocations.  However after the list of pages\ngoes to mpage_readpages, there can be significant intervals (including disk\nIO) before all the pages are inserted into the radix-tree.  So the reserves\ncan easily be depleted at that point.  The patch is confirmed to fix the\nproblem.\n\nSigned-off-by: Nick Piggin \u003cnpiggin@suse.de\u003e\nCc: \"David S. Miller\" \u003cdavem@davemloft.net\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "48c250fe2233d82c6d8fd563e83c234cdf1109ee",
      "old_mode": 33188,
      "old_path": "lib/radix-tree.c",
      "new_id": "65f0e758ec3819d57f1799e5563a9f90dc0e41eb",
      "new_mode": 33188,
      "new_path": "lib/radix-tree.c"
    },
    {
      "type": "modify",
      "old_id": "76bea88cbebcb6201d87574890f476ff0051caee",
      "old_mode": 33188,
      "old_path": "mm/filemap.c",
      "new_id": "96920f8405627fd98ae2347b4fda0c57b6aedee5",
      "new_mode": 33188,
      "new_path": "mm/filemap.c"
    },
    {
      "type": "modify",
      "old_id": "dbc2ca2057a54ff2c4a709de4b6e9a01694241bb",
      "old_mode": 33188,
      "old_path": "mm/rmap.c",
      "new_id": "0334c8f6b741072c4fb1fb4830223c1530e5919c",
      "new_mode": 33188,
      "new_path": "mm/rmap.c"
    }
  ]
}
