)]}'
{
  "commit": "ef3d0fd27e90f67e35da516dafc1482c82939a60",
  "tree": "dea852eab2a52782867becffb11bce2577ed2b91",
  "parents": [
    "847cc6371ba820763773e993000410d6d8d23515"
  ],
  "author": {
    "name": "Andi Kleen",
    "email": "ak@linux.intel.com",
    "time": "Thu Sep 15 16:06:48 2011 -0700"
  },
  "committer": {
    "name": "root",
    "email": "root@serles.lst.de",
    "time": "Fri Oct 28 14:58:58 2011 +0200"
  },
  "message": "vfs: do (nearly) lockless generic_file_llseek\n\nThe i_mutex lock use of generic _file_llseek hurts.  Independent processes\naccessing the same file synchronize over a single lock, even though\nthey have no need for synchronization at all.\n\nUnder high utilization this can cause llseek to scale very poorly on larger\nsystems.\n\nThis patch does some rethinking of the llseek locking model:\n\nFirst the 64bit f_pos is not necessarily atomic without locks\non 32bit systems. This can already cause races with read() today.\nThis was discussed on linux-kernel in the past and deemed acceptable.\nThe patch does not change that.\n\nLet\u0027s look at the different seek variants:\n\nSEEK_SET: Doesn\u0027t really need any locking.\nIf there\u0027s a race one writer wins, the other loses.\n\nFor 32bit the non atomic update races against read()\nstay the same. Without a lock they can also happen\nagainst write() now.  The read() race was deemed\nacceptable in past discussions, and I think if it\u0027s\nok for read it\u0027s ok for write too.\n\n\u003d\u003e Don\u0027t need a lock.\n\nSEEK_END: This behaves like SEEK_SET plus it reads\nthe maximum size too. Reading the maximum size would have the\n32bit atomic problem. But luckily we already have a way to read\nthe maximum size without locking (i_size_read), so we\ncan just use that instead.\n\nWithout i_mutex there is no synchronization with write() anymore,\nhowever since the write() update is atomic on 64bit it just behaves\nlike another racy SEEK_SET.  On non atomic 32bit it\u0027s the same\nas SEEK_SET.\n\n\u003d\u003e Don\u0027t need a lock, but need to use i_size_read()\n\nSEEK_CUR: This has a read-modify-write race window\non the same file. One could argue that any application\ndoing unsynchronized seeks on the same file is already broken.\nBut for the sake of not adding a regression here I\u0027m\nusing the file-\u003ef_lock to synchronize this. Using this\nlock is much better than the inode mutex because it doesn\u0027t\nsynchronize between processes.\n\n\u003d\u003e So still need a lock, but can use a f_lock.\n\nThis patch implements this new scheme in generic_file_llseek.\nI dropped generic_file_llseek_unlocked and changed all callers.\n\nSigned-off-by: Andi Kleen \u003cak@linux.intel.com\u003e\nSigned-off-by: Christoph Hellwig \u003chch@lst.de\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e4e57d59edb7ca7e6634e1ef251bb142bfaa08b8",
      "old_mode": 33188,
      "old_path": "fs/btrfs/file.c",
      "new_id": "1266f6e9cdb22a309d7da8893963fc3765824b65",
      "new_mode": 33188,
      "new_path": "fs/btrfs/file.c"
    },
    {
      "type": "modify",
      "old_id": "54b8f1e7da9465b0f0aad5b245fda0ef7810f84e",
      "old_mode": 33188,
      "old_path": "fs/cifs/cifsfs.c",
      "new_id": "db7ce87d37a5919bee6ca27a6d39c20168924f92",
      "new_mode": 33188,
      "new_path": "fs/cifs/cifsfs.c"
    },
    {
      "type": "modify",
      "old_id": "edeb9e80290382b39491d67c40ed3802535aac2b",
      "old_mode": 33188,
      "old_path": "fs/gfs2/file.c",
      "new_id": "fe6bc0207818ab80c9aa3d8f490e06d45ea006ad",
      "new_mode": 33188,
      "new_path": "fs/gfs2/file.c"
    },
    {
      "type": "modify",
      "old_id": "28b8c3f3cda3af002e99044fee907f119ac78afb",
      "old_mode": 33188,
      "old_path": "fs/nfs/file.c",
      "new_id": "12623abcf3d4c8e5dc24999265aa3878ebf3a1ba",
      "new_mode": 33188,
      "new_path": "fs/nfs/file.c"
    },
    {
      "type": "modify",
      "old_id": "179f1c33ea578481cdc3388d54717089704a51a3",
      "old_mode": 33188,
      "old_path": "fs/read_write.c",
      "new_id": "672b187def6296a1de19bba537047a1e1010f9ae",
      "new_mode": 33188,
      "new_path": "fs/read_write.c"
    },
    {
      "type": "modify",
      "old_id": "c1884e974ff4bfd65e6d56df46c5736a3944fdc4",
      "old_mode": 33188,
      "old_path": "include/linux/fs.h",
      "new_id": "db85196f63088d878645db104c3e1fc172a746eb",
      "new_mode": 33188,
      "new_path": "include/linux/fs.h"
    }
  ]
}
