{"action":"created","issue":{"url":"https://api.github.com/repos/cloudius-systems/osv/issues/656","repository_url":"https://api.github.com/repos/cloudius-systems/osv","labels_url":"https://api.github.com/repos/cloudius-systems/osv/issues/656/labels{/name}","comments_url":"https://api.github.com/repos/cloudius-systems/osv/issues/656/comments","events_url":"https://api.github.com/repos/cloudius-systems/osv/issues/656/events","html_url":"https://github.com/cloudius-systems/osv/issues/656","id":108569088,"number":656,"title":"Support for AIO, for Seastar","user":{"login":"nyh","id":584227,"avatar_url":"https://avatars.githubusercontent.com/u/584227?v=3","gravatar_id":"","url":"https://api.github.com/users/nyh","html_url":"https://github.com/nyh","followers_url":"https://api.github.com/users/nyh/followers","following_url":"https://api.github.com/users/nyh/following{/other_user}","gists_url":"https://api.github.com/users/nyh/gists{/gist_id}","starred_url":"https://api.github.com/users/nyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyh/subscriptions","organizations_url":"https://api.github.com/users/nyh/orgs","repos_url":"https://api.github.com/users/nyh/repos","events_url":"https://api.github.com/users/nyh/events{/privacy}","received_events_url":"https://api.github.com/users/nyh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-28T00:00:32Z","updated_at":"2016-03-09T15:01:47Z","closed_at":null,"body":"Filesystem APIs involving blocking - both the classic read()/write() calls and the newer file-mapping-via-mmap() - are bad for performance because the fact your thread can block forces you to have multiple threads on the same CPU - and having multiple threads inevitably cause inefficiencies like context switches, need for locks, extra wasteful stacks, etc.\r\n\r\nFor this reason, applications using the Seastar library use AIO (asynchronous I/O), where disk I/O does not block, and one thread per core is enough. Linux's filesystems support for AIO is imperfect: support in ext4 has numerous bugs (i.e., cases which do cause blocking, so are not really asynchronous)  and xfs has much fewer such bugs, but still non-zero. But AIO support in OSv is even worse - it is stubbed out :-(\r\n\r\nI don't think we need OSv support in ZFS - I think most of ZFS's features (especially its sophisticated caching) are not interesting for AIO and O_DIRECT as used by Seastar. It would probably make more sense to write a new simple file system for this purpose, perhaps making some simplifying assumptions on the use case (e.g., a few large files, modifications are rare except append, etc.)  and on the other hand improve parallelism like XFS does (with SSDs with zero seek costs, it is important we can have multiple cores proceed with multiple writes to the same disk in parallel, without getting locked on common data structures in memory or on disk).\r\n\r\nInstead of implementing a new filesystem in OSv, another alternative is to have a raw boot device in OSv, and implement the new filesystem in Seastar. This would mean we will just need to implement in OSv asynchronous I/O to a block device."},"comment":{"url":"https://api.github.com/repos/cloudius-systems/osv/issues/comments/194334544","html_url":"https://github.com/cloudius-systems/osv/issues/656#issuecomment-194334544","issue_url":"https://api.github.com/repos/cloudius-systems/osv/issues/656","id":194334544,"user":{"login":"vinayrmrp","id":16337333,"avatar_url":"https://avatars.githubusercontent.com/u/16337333?v=3","gravatar_id":"","url":"https://api.github.com/users/vinayrmrp","html_url":"https://github.com/vinayrmrp","followers_url":"https://api.github.com/users/vinayrmrp/followers","following_url":"https://api.github.com/users/vinayrmrp/following{/other_user}","gists_url":"https://api.github.com/users/vinayrmrp/gists{/gist_id}","starred_url":"https://api.github.com/users/vinayrmrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinayrmrp/subscriptions","organizations_url":"https://api.github.com/users/vinayrmrp/orgs","repos_url":"https://api.github.com/users/vinayrmrp/repos","events_url":"https://api.github.com/users/vinayrmrp/events{/privacy}","received_events_url":"https://api.github.com/users/vinayrmrp/received_events","type":"User","site_admin":false},"created_at":"2016-03-09T15:01:47Z","updated_at":"2016-03-09T15:01:47Z","body":"+1"}}