)]}'
{
  "commit": "da3bbdd4632c0171406b2677e31494afa5bde2f8",
  "tree": "6a1947b2a32041ef0d14044e659ba7d546d55483",
  "parents": [
    "3c82d0ce2c4f642b2f24ef98707a030543b06b90"
  ],
  "author": {
    "name": "Kentaro Makita",
    "email": "k-makita@np.css.fujitsu.com",
    "time": "Wed Jul 23 21:27:13 2008 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Thu Jul 24 10:47:15 2008 -0700"
  },
  "message": "fix soft lock up at NFS mount via per-SB LRU-list of unused dentries\n\n[Summary]\n\n Split LRU-list of unused dentries to one per superblock to avoid soft\n lock up during NFS mounts and remounting of any filesystem.\n\n Previously I posted here:\n http://lkml.org/lkml/2008/3/5/590\n\n[Descriptions]\n\n- background\n\n  dentry_unused is a list of dentries which are not referenced.\n  dentry_unused grows up when references on directories or files are\n  released.  This list can be very long if there is huge free memory.\n\n- the problem\n\n  When shrink_dcache_sb() is called, it scans all dentry_unused linearly\n  under spin_lock(), and if dentry-\u003ed_sb is differnt from given\n  superblock, scan next dentry.  This scan costs very much if there are\n  many entries, and very ineffective if there are many superblocks.\n\n  IOW, When we need to shrink unused dentries on one dentry, but scans\n  unused dentries on all superblocks in the system.  For example, we scan\n  500 dentries to unmount a filesystem, but scans 1,000,000 or more unused\n  dentries on other superblocks.\n\n  In our case , At mounting NFS*, shrink_dcache_sb() is called to shrink\n  unused dentries on NFS, but scans 100,000,000 unused dentries on\n  superblocks in the system such as local ext3 filesystems.  I hear NFS\n  mounting took 1 min on some system in use.\n\n* : NFS uses virtual filesystem in rpc layer, so NFS is affected by\n  this problem.\n\n  100,000,000 is possible number on large systems.\n\n  Per-superblock LRU of unused dentried can reduce the cost in\n  reasonable manner.\n\n- How to fix\n\n  I found this problem is solved by David Chinner\u0027s \"Per-superblock\n  unused dentry LRU lists V3\"(1), so I rebase it and add some fix to\n  reclaim with fairness, which is in Andrew Morton\u0027s comments(2).\n\n  1) http://lkml.org/lkml/2006/5/25/318\n  2) http://lkml.org/lkml/2006/5/25/320\n\n  Split LRU-list of unused dentries to each superblocks.  Then, NFS\n  mounting will check dentries under a superblock instead of all.  But\n  this spliting will break LRU of dentry-unused.  So, I\u0027ve attempted to\n  make reclaim unused dentrins with fairness by calculate number of\n  dentries to scan on this sb based on following way\n\n  number of dentries to scan on this sb \u003d\n  count * (number of dentries on this sb / number of dentries in the machine)\n\n- ToDo\n - I have to measuring performance number and do stress tests.\n\n - When unmount occurs during prune_dcache(), scanning on same\n  superblock, It is unable to reach next superblock because it is gone\n  away.  We restart scannig superblock from first one, it causes\n  unfairness of reclaim unused dentries on first superblock.  But I think\n  this happens very rarely.\n\n- Test Results\n\n  Result on 6GB boxes with excessive unused dentries.\n\nWithout patch:\n\n$ cat /proc/sys/fs/dentry-state\n10181835        10180203        45      0       0       0\n# mount -t nfs 10.124.60.70:/work/kernel-src nfs\nreal    0m1.830s\nuser    0m0.001s\nsys     0m1.653s\n\n With this patch:\n$ cat /proc/sys/fs/dentry-state\n10236610        10234751        45      0       0       0\n# mount -t nfs 10.124.60.70:/work/kernel-src nfs\nreal    0m0.106s\nuser    0m0.002s\nsys     0m0.032s\n\n[akpm@linux-foundation.org: fix comments]\nSigned-off-by: Kentaro Makita \u003ck-makita@np.css.fujitsu.com\u003e\nCc: Neil Brown \u003cneilb@suse.de\u003e\nCc: Trond Myklebust \u003ctrond.myklebust@fys.uio.no\u003e\nCc: David Chinner \u003cdgc@sgi.com\u003e\nCc: \"J. Bruce Fields\" \u003cbfields@fieldses.org\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": "6068c25b393ca21f5faf8c9ca1fdf8d6051fc836",
      "old_mode": 33188,
      "old_path": "fs/dcache.c",
      "new_id": "3818d6ab76ca18e398f6d425b2879012f3a49ff2",
      "new_mode": 33188,
      "new_path": "fs/dcache.c"
    },
    {
      "type": "modify",
      "old_id": "453877c5697be1b927bc8b9654f98f9cad71644b",
      "old_mode": 33188,
      "old_path": "fs/super.c",
      "new_id": "e931ae9511fef01f5ae98ea477b89f491a73bb00",
      "new_mode": 33188,
      "new_path": "fs/super.c"
    },
    {
      "type": "modify",
      "old_id": "ff54ae4933f3a48edce042ca330eec15fd5a1b87",
      "old_mode": 33188,
      "old_path": "include/linux/fs.h",
      "new_id": "e5e6a244096cd03ad0b9e878e72b8702e2c9cb12",
      "new_mode": 33188,
      "new_path": "include/linux/fs.h"
    }
  ]
}
