{"action":"created","issue":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/5040","repository_url":"https://api.github.com/repos/zfsonlinux/zfs","labels_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/5040/labels{/name}","comments_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/5040/comments","events_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/5040/events","html_url":"https://github.com/zfsonlinux/zfs/pull/5040","id":173883779,"number":5040,"title":"Illumos 6322 ZFS indirect block predictive prefetch","user":{"login":"kernelOfTruth","id":4529709,"avatar_url":"https://avatars.githubusercontent.com/u/4529709?v=3","gravatar_id":"","url":"https://api.github.com/users/kernelOfTruth","html_url":"https://github.com/kernelOfTruth","followers_url":"https://api.github.com/users/kernelOfTruth/followers","following_url":"https://api.github.com/users/kernelOfTruth/following{/other_user}","gists_url":"https://api.github.com/users/kernelOfTruth/gists{/gist_id}","starred_url":"https://api.github.com/users/kernelOfTruth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kernelOfTruth/subscriptions","organizations_url":"https://api.github.com/users/kernelOfTruth/orgs","repos_url":"https://api.github.com/users/kernelOfTruth/repos","events_url":"https://api.github.com/users/kernelOfTruth/events{/privacy}","received_events_url":"https://api.github.com/users/kernelOfTruth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-29T22:02:23Z","updated_at":"2016-08-29T22:20:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/zfsonlinux/zfs/pulls/5040","html_url":"https://github.com/zfsonlinux/zfs/pull/5040","diff_url":"https://github.com/zfsonlinux/zfs/pull/5040.diff","patch_url":"https://github.com/zfsonlinux/zfs/pull/5040.patch"},"body":"For quite some time I was thinking about possibility to prefetch ZFS indirection tables while doing sequential reads or writes. Recent changes in predictive prefetcher made that much easier to do. My\r\ntests on zvol with 16KB block size on 5x striped and 2x mirrored pool of 10 disks show almost double throughput on sequential read, and almost tripple on sequential rewrite. While for read alike effect\r\ncan be received from increasing maximal prefetch distance (though at higher memory cost), for rewrite there is no other solution so far.\r\n\r\nPorting notes:\r\nChange from upstream in module/zfs/dbuf.c in 'int dbuf_read' due to commit 'Handle block pointers with a corrupt logical size'\r\nhttps://github.com/zfsonlinux/zfs/commit/5f6d0b6f5aa9af2ee5be74ac415a574b732c2c0f\r\n\r\ndifference from upstream in module/zfs/dmu_zfetch.c , uint32_t zfetch_max_idistance -> unsigned int zfetch_max_idistance\r\n\r\nVariables have been initialized at the beginning of the function (void dmu_zfetch) to resemble the order of occurence and account for C99, C11 mode errors.\r\n\r\nAuthored by: Alexander Motin <mav@freebsd.org>\r\nReviewed by: Matthew Ahrens <mahrens@delphix.com>\r\nReviewed by: Paul Dagnelie <pcd@delphix.com>\r\nApproved by: Robert Mustacchi <rm@joyent.com>\r\nPorted-by: kernelOfTruth kerneloftruth@gmail.com\r\nOpenZFS-issue: https://www.illumos.org/issues/6322\r\nOpenZFS-commit: https://github.com/illumos/illumos-gate/commit/cb92f4130ce5b2c4ae1fa5fa6c776f4d4dc28ad9"},"comment":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/comments/243275588","html_url":"https://github.com/zfsonlinux/zfs/pull/5040#issuecomment-243275588","issue_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/5040","id":243275588,"user":{"login":"kernelOfTruth","id":4529709,"avatar_url":"https://avatars.githubusercontent.com/u/4529709?v=3","gravatar_id":"","url":"https://api.github.com/users/kernelOfTruth","html_url":"https://github.com/kernelOfTruth","followers_url":"https://api.github.com/users/kernelOfTruth/followers","following_url":"https://api.github.com/users/kernelOfTruth/following{/other_user}","gists_url":"https://api.github.com/users/kernelOfTruth/gists{/gist_id}","starred_url":"https://api.github.com/users/kernelOfTruth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kernelOfTruth/subscriptions","organizations_url":"https://api.github.com/users/kernelOfTruth/orgs","repos_url":"https://api.github.com/users/kernelOfTruth/repos","events_url":"https://api.github.com/users/kernelOfTruth/events{/privacy}","received_events_url":"https://api.github.com/users/kernelOfTruth/received_events","type":"User","site_admin":false},"created_at":"2016-08-29T22:20:40Z","updated_at":"2016-08-29T22:20:40Z","body":"instead of\r\n\r\n```\r\n        zstream_t *zs;\r\n\tint64_t pf_start, ipf_start, ipf_istart, ipf_iend;\r\n\tint64_t pf_ahead_blks, max_blks, iblk;\r\n\tint epbs, max_dist_blks, pf_nblks, ipf_nblks, i;\r\n\tuint64_t end_of_access_blkid;\r\n\tend_of_access_blkid = blkid + nblks;\r\n```\r\n\r\nthe following can also be used (the compiler did not complain), to show that iblk occurs later\r\n\r\n```\r\n\tzstream_t *zs;\r\n\tint64_t pf_start, ipf_start, ipf_istart, ipf_iend;\r\n\tint64_t pf_ahead_blks, max_blks;\r\n\tint epbs, max_dist_blks, pf_nblks, ipf_nblks, i;\r\n\tuint64_t end_of_access_blkid;\r\n\tint64_t iblk;\r\n\tend_of_access_blkid = blkid + nblks;\r\n```"}}
{"actor":{"display_login":"kernelOfTruth"}}