)]}'
{
  "commit": "6b10c6c9fbfe754e8482efb8c8b84f8e40c0f2eb",
  "tree": "08f275b1e8d2e9c93bb46367611c43ab88f8f8dc",
  "parents": [
    "6df8ba4f8a4c4abca9ccad10441d0dddbdff301c"
  ],
  "author": {
    "name": "Fengguang Wu",
    "email": "wfg@mail.ustc.edu.cn",
    "time": "Tue Oct 16 01:24:34 2007 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@woody.linux-foundation.org",
    "time": "Tue Oct 16 09:42:52 2007 -0700"
  },
  "message": "readahead: basic support of interleaved reads\n\nThis is a simplified version of the pagecache context based readahead.  It\nhandles the case of multiple threads reading on the same fd and invalidating\neach others\u0027 readahead state.  It does the trick by scanning the pagecache and\nrecovering the current read stream\u0027s readahead status.\n\nThe algorithm works in a opportunistic way, in that it does not try to detect\ninterleaved reads _actively_, which requires a probe into the page cache\n(which means a little more overhead for random reads).  It only tries to\nhandle a previously started sequential readahead whose state was overwritten\nby another concurrent stream, and it can do this job pretty well.\n\nNegative and positive examples(or what you can expect from it):\n\n1) it cannot detect and serve perfect request-by-request interleaved reads\n   right:\n\ttime\tstream 1  stream 2\n\t0 \t1\n\t1 \t          1001\n\t2 \t2\n\t3 \t          1002\n\t4 \t3\n\t5 \t          1003\n\t6 \t4\n\t7 \t          1004\n\t8 \t5\n\t9\t          1005\n\nHere no single readahead will be carried out.\n\n2) However, if it\u0027s two concurrent reads by two threads, the chance of the\n   initial sequential readahead be started is huge. Once the first sequential\n   readahead is started for a stream, this patch will ensure that the readahead\n   window continues to rampup and won\u0027t be disturbed by other streams.\n\n\ttime\tstream 1  stream 2\n\t0 \t1\n\t1 \t2\n\t2 \t          1001\n\t3 \t3\n\t4 \t          1002\n\t5 \t          1003\n\t6 \t4\n\t7 \t5\n\t8 \t          1004\n\t9 \t6\n\t10\t          1005\n\t11\t7\n\t12\t          1006\n\t13\t          1007\n\nHere stream 1 will start a readahead at page 2, and stream 2 will start its\nfirst readahead at page 1003.  From then on the two streams will be served\nright.\n\nCc: Rusty Russell \u003crusty@rustcorp.com.au\u003e\nSigned-off-by: Fengguang Wu \u003cwfg@mail.ustc.edu.cn\u003e\nCc: Rusty Russell \u003crusty@rustcorp.com.au\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": "4a58befbde4a5f157f6c5372d0420ea9c5390e71",
      "old_mode": 33188,
      "old_path": "mm/readahead.c",
      "new_id": "fd588ffc508637d8bbf17b9905e24e509aa42369",
      "new_mode": 33188,
      "new_path": "mm/readahead.c"
    }
  ]
}
