{"id":365515,"date":"2024-05-21T02:39:56","date_gmt":"2024-05-21T02:39:56","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=365515"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=365515","title":{"rendered":"<span>\u041c\u0435\u0439\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0431\u043b\u043e\u0447\u043d\u043e\u0439 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u044f\u0434\u0440\u0430 Linux \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b \u0447\u0438\u0441\u043b\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0432\u0432\u043e\u0434\u0430\/\u0432\u044b\u0432\u043e\u0434\u0430 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u043d\u0430 6%, \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0432 5 \u043c\u0438\u043d\u0443\u0442 \u043d\u0430 \u043a\u043e\u0434<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/zd\/v9\/7p\/zdv97p9j5zf55ivht2f3ul4omwu.png\" data-src=\"https:\/\/habrastorage.org\/webt\/zd\/v9\/7p\/zdv97p9j5zf55ivht2f3ul4omwu.png\"\/><\/figure>\n<p>\u041c\u0435\u0439\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0431\u043b\u043e\u0447\u043d\u043e\u0439 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u044f\u0434\u0440\u0435 Linux \u0419\u0435\u043d\u0441 \u0410\u043a\u0441\u0431\u043e (Jens Axboe) <a href=\"https:\/\/twitter.com\/axboe\/status\/1747016366891442220\" rel=\"noopener noreferrer nofollow\">\u0441\u043e\u043e\u0431\u0449\u0438\u043b<\/a>, \u0447\u0442\u043e \u0441\u043c\u043e\u0433 <a href=\"https:\/\/lore.kernel.org\/linux-block\/20240115215840.54432-1-axboe@kernel.dk\/\" rel=\"noopener noreferrer nofollow\">\u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c<\/a> \u0447\u0438\u0441\u043b\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0432\u0432\u043e\u0434\u0430\/\u0432\u044b\u0432\u043e\u0434\u0430 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 (IOPS) \u043d\u0430 6% (\u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0432\u0435\u0441\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u044f\u0434\u0435\u0440 Linux), \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0432 \u0432\u0441\u0435\u0433\u043e 5 \u043c\u0438\u043d\u0443\u0442 \u043d\u0430 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u043e\u043a \u0432 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0415\u0433\u043e \u0438\u0434\u0435\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u0431\u043b\u043e\u0447\u043d\u043e\u0439 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0435\u043c\u044b\u0439 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0432\u043e\u0434\u0430\/\u0432\u044b\u0432\u043e\u0434\u0430, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u0431\u043b\u043e\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u0434\u0430\u043b\u043e\u0441\u044c \u0431\u044b \u0432 \u043d\u0430\u043d\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>\u0410\u043a\u0441\u0431\u043e \u043f\u043e\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e \u044d\u0442\u0430 \u0437\u0430\u0434\u0443\u043c\u043a\u0430 \u043f\u0440\u0438\u0448\u043b\u0430 \u043a \u043d\u0435\u043c\u0443 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 5 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434, \u043d\u043e \u043e\u043d \u0442\u043e\u0433\u0434\u0430 \u043e\u0442\u043b\u043e\u0436\u0438\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u0437-\u0437\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447. \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043e\u043d \u0432\u0435\u0440\u043d\u0443\u043b\u0441\u044f \u043a \u0441\u0432\u043e\u0435\u0439 \u0438\u0434\u0435\u0435. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u0432\u0441\u0435\u0433\u043e  5 \u043c\u0438\u043d\u0443\u0442 \u043d\u0430 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u043e\u043a \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<blockquote>\n<p>Hi, When I run my peak testing to see if we&#8217;ve regressed, my test script always does: <code>echo 1 > \/sys\/block\/$DEV\/queue\/iostats echo 2 > \/sys\/block\/$DEV\/queue\/nomerges <\/code> <\/p>\n<p>for each device being used. It&#8217;s unfortunate that we need to disable<br \/> iostats, but without doing that, I lose about 12% performance. The main<br \/> reason for that is the time querying we need to do, when iostats are<br \/> enabled. As it turns out, lots of other block code is quite trigger<br \/> happy with querying time as well. We do have some nice batching in place<br \/> which helps ammortize that, but it&#8217;s not perfect.<\/p>\n<p>This trivial patchset simply caches the current time in struct blk_plug,<br \/> on the premise that any issue side time querying can get adequate<br \/> granularity through that. Nobody really needs nsec granularity on the<br \/> timestamp.<\/p>\n<p>Results in patch 2, but tldr is a more than 6% improvement (108M -> 115M IOPS) for my test case, which doesn&#8217;t even enable most of the costly block layer items that you&#8217;d typically find in a distro and which would further increase the number of issue side time calls. <\/p>\n<p>Jens Axboe<\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/786944\/\"> https:\/\/habr.com\/ru\/articles\/786944\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"\"><\/figure>\n<p>\u041c\u0435\u0439\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0431\u043b\u043e\u0447\u043d\u043e\u0439 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u044f\u0434\u0440\u0435 Linux \u0419\u0435\u043d\u0441 \u0410\u043a\u0441\u0431\u043e (Jens Axboe) <a href=\"https:\/\/twitter.com\/axboe\/status\/1747016366891442220\" rel=\"noopener noreferrer nofollow\">\u0441\u043e\u043e\u0431\u0449\u0438\u043b<\/a>, \u0447\u0442\u043e \u0441\u043c\u043e\u0433 <a href=\"https:\/\/lore.kernel.org\/linux-block\/20240115215840.54432-1-axboe@kernel.dk\/\" rel=\"noopener noreferrer nofollow\">\u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c<\/a> \u0447\u0438\u0441\u043b\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0432\u0432\u043e\u0434\u0430\/\u0432\u044b\u0432\u043e\u0434\u0430 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 (IOPS) \u043d\u0430 6% (\u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0432\u0435\u0441\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u044f\u0434\u0435\u0440 Linux), \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0432 \u0432\u0441\u0435\u0433\u043e 5 \u043c\u0438\u043d\u0443\u0442 \u043d\u0430 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u043e\u043a \u0432 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0415\u0433\u043e \u0438\u0434\u0435\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u0431\u043b\u043e\u0447\u043d\u043e\u0439 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0435\u043c\u044b\u0439 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0432\u043e\u0434\u0430\/\u0432\u044b\u0432\u043e\u0434\u0430, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u0431\u043b\u043e\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u0434\u0430\u043b\u043e\u0441\u044c \u0431\u044b \u0432 \u043d\u0430\u043d\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>\u0410\u043a\u0441\u0431\u043e \u043f\u043e\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e \u044d\u0442\u0430 \u0437\u0430\u0434\u0443\u043c\u043a\u0430 \u043f\u0440\u0438\u0448\u043b\u0430 \u043a \u043d\u0435\u043c\u0443 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 5 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434, \u043d\u043e \u043e\u043d \u0442\u043e\u0433\u0434\u0430 \u043e\u0442\u043b\u043e\u0436\u0438\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u0437-\u0437\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447. \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043e\u043d \u0432\u0435\u0440\u043d\u0443\u043b\u0441\u044f \u043a \u0441\u0432\u043e\u0435\u0439 \u0438\u0434\u0435\u0435. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u0432\u0441\u0435\u0433\u043e  5 \u043c\u0438\u043d\u0443\u0442 \u043d\u0430 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u043e\u043a \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<blockquote>\n<p>Hi, When I run my peak testing to see if we&#8217;ve regressed, my test script always does: <code>echo 1 > \/sys\/block\/$DEV\/queue\/iostats echo 2 > \/sys\/block\/$DEV\/queue\/nomerges <\/code> <\/p>\n<p>for each device being used. It&#8217;s unfortunate that we need to disable<br \/> iostats, but without doing that, I lose about 12% performance. The main<br \/> reason for that is the time querying we need to do, when iostats are<br \/> enabled. As it turns out, lots of other block code is quite trigger<br \/> happy with querying time as well. We do have some nice batching in place<br \/> which helps ammortize that, but it&#8217;s not perfect.<\/p>\n<p>This trivial patchset simply caches the current time in struct blk_plug,<br \/> on the premise that any issue side time querying can get adequate<br \/> granularity through that. Nobody really needs nsec granularity on the<br \/> timestamp.<\/p>\n<p>Results in patch 2, but tldr is a more than 6% improvement (108M -> 115M IOPS) for my test case, which doesn&#8217;t even enable most of the costly block layer items that you&#8217;d typically find in a distro and which would further increase the number of issue side time calls. <\/p>\n<p>Jens Axboe<\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/786944\/\"> https:\/\/habr.com\/ru\/articles\/786944\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-365515","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/365515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=365515"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/365515\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=365515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=365515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=365515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}