{"id":3075,"date":"2026-05-07T15:51:22","date_gmt":"2026-05-07T06:51:22","guid":{"rendered":"https:\/\/bokumin.org\/blog\/?p=3075"},"modified":"2026-05-08T09:20:47","modified_gmt":"2026-05-08T00:20:47","slug":"linux-7-0%e3%81%aezram-writeback%e3%82%92%e5%ae%9f%e9%9a%9b%e3%81%ab%e8%a9%a6%e3%81%99slackware","status":"publish","type":"post","link":"https:\/\/bokumin.org\/blog\/2026\/05\/07\/linux-7-0%e3%81%aezram-writeback%e3%82%92%e5%ae%9f%e9%9a%9b%e3%81%ab%e8%a9%a6%e3%81%99slackware\/","title":{"rendered":"Linux 7.0\u306ezram Writeback\u3092\u8a66\u3059\uff08Slackware\uff09"},"content":{"rendered":"\n<p>Testing zram writeback on Linux 7.0 (Slackware)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u306f\u3058\u3081\u306b<\/strong><\/h2>\n\n\n\n<p>Linux \u30ab\u30fc\u30cd\u30eb7.0\u3067\u306fzram\u306b\u3044\u304f\u3064\u304b\u306e\u6539\u5584\u304c\u52a0\u3048\u3089\u308c\u307e\u3057\u305f\u3002\u4eca\u56de\u306f\u5b9f\u969b\u306b\u5b9f\u6a5f\u3092\u52d5\u304b\u3057\u3066\u78ba\u8a8d\u3057\u3066\u884c\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Kernel 7.0\u3067\u306ezram\u306e\u5909\u66f4\u70b9<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5727\u7e2e\u30c7\u30fc\u30bf\u30e9\u30a4\u30c8\u30d0\u30c3\u30af(Writeback)\u304c\u5b9f\u88c5\u3055\u308c\u305f\n<ul class=\"wp-block-list\">\n<li>\u5909\u66f4\u524d\u306f\u30c7\u30a3\u30b9\u30af\u3078\u66f8\u304d\u51fa\u3059\u969b\u306b\u4e00\u5ea6\u5c55\u958b\u3057\u3066\u304b\u3089\u66f8\u304d\u8fbc\u3093\u3067\u3044\u305f<br>\u3000\u3000\u3000\u3000\u5909\u66f4\u5f8c\u306f<strong>\u5727\u7e2e\u3055\u308c\u305f\u307e\u307e\u76f4\u63a5\u30c7\u30a3\u30b9\u30af\u306b\u66f8\u304d\u8fbc\u3080<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>\u30e9\u30a4\u30c8\u30d0\u30c3\u30af\u306e\u5b9f\u88c5\u3067\u3001CPU\u30b5\u30a4\u30af\u30eb\u306e\u7bc0\u7d04\u3001\u30d0\u30c3\u30c6\u30ea\u30fc\u6d88\u8cbb\u306e\u524a\u6e1b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3068\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305f\u3001\u30ab\u30fc\u30cd\u30eb4.15\uff082018\u5e74\uff09\u3067\u306f\u3001ZRAM\u3084SSD\u306e\u3088\u3046\u306a\u9ad8\u901f\u306aswap\u30c7\u30d0\u30a4\u30b9\u306b\u5bfe\u3057\u3066\u3001swap\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u7d4c\u7531\u305b\u305a\u76f4\u63a5\u51e6\u7406\u3059\u308b\u30d0\u30a4\u30d1\u30b9\u6a5f\u80fd\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002 \u5f53\u6642\u306fswap\u30ad\u30e3\u30c3\u30b7\u30e5\u81ea\u4f53\u304c\u9045\u304b\u3063\u305f\u305f\u3081\u6709\u52b9\u306a\u6700\u9069\u5316\u3060\u3063\u305f\u306e\u3067\u3059\u304c\u3001<strong>\u30b3\u30fc\u30c9\u304c\u8907\u96d1\u306b\u306a\u308a\u30d0\u30b0\u306e\u6e29\u5e8a\u306b\u3082\u306a\u3063\u3066\u3044\u307e\u3057\u305f<\/strong>\u3002<br>\u30ab\u30fc\u30cd\u30eb7.0\u3067\u306fKairui Song\u306b\u3088\u3063\u3066swap\u30ad\u30e3\u30c3\u30b7\u30e5\u81ea\u4f53\u304c\u9ad8\u901f\u5316\u3055\u308c\uff08swap table phase II\uff09\u3001\u30d0\u30a4\u30d1\u30b9\u3092\u7d4c\u7531\u3057\u306a\u304f\u3066\u3082\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u843d\u3061\u306a\u3044\u72b6\u614b\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u305d\u306e\u305f\u3081<strong>\u30d0\u30a4\u30d1\u30b9\u6a5f\u80fd\u3092\u4e38\u3054\u3068\u524a\u9664\u3057\u3001\u30b3\u30fc\u30c9\u3092\u30b7\u30f3\u30d7\u30eb\u306b\u3057\u3066\u3044\u307e\u3059\u3002 Redis\u306e\u6c38\u7d9a\u5316\u3042\u308a\u30d9\u30f3\u30c1\u30de\u30fc\u30af\u3067\u306f\u7d0420%\u306e\u6027\u80fd\u5411\u4e0a\u304c\u78ba\u8a8d\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/strong><br>\u53c2\u8003URL: <a href=\"https:\/\/lkml.org\/lkml\/2025\/12\/20\/15\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/lkml.org\/lkml\/2025\/12\/20\/15<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u5b9f\u884c\u3057\u305f\u74b0\u5883<\/strong><\/h2>\n\n\n\n<p>OS: Slackware 15.0<br>Kernel: 7.0<br>CPU: Intel(R) Celeron(R) N4100 CPU @ 2.400GHz<br>RAM: 4GB+8GB(11.7GB)<br>NVMe swap: 8GB (priority 1)<br>zram:12 GB (priority100)<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>$ cat \/sys\/block\/zram0\/comp_algorithm\nlzo-rle lzo lz4 lz4hc &#91;zstd&#93; deflate 842 <\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">$<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">cat<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">\/sys\/block\/zram0\/comp_algorithm<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">lzo-rle<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">lzo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">lz4<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">lz4hc<\/span><span style=\"color: #D4D4D4\"> &#91;zstd&#93; deflate 842 <\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>zstd\u306e\u3088\u3046\u306b\u62ec\u5f27\u304c\u3064\u3044\u3066\u3044\u308b\u3082\u306e\u304c\u73fe\u5728\u9078\u629e\u4e2d\u306e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u6b21\u306bKernel 7.0\u306e\u65b0\u6a5f\u80fd\u30ce\u30fc\u30c9\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>$ ls \/sys\/block\/zram0\/ | grep writeback\ncompressed_writeback\n...<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">$<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">ls<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">\/sys\/block\/zram0\/<\/span><span style=\"color: #D4D4D4\"> | <\/span><span style=\"color: #DCDCAA\">grep<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">writeback<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">compressed_writeback<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">...<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>compressed_writeback\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u30ab\u30fc\u30cd\u30eb7.0\u306e\u5727\u7e2e\u30e9\u30a4\u30c8\u30d0\u30c3\u30af\u306b\u5bfe\u5fdc\u6e08\u307f\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Writeback\u52d5\u4f5c\u78ba\u8a8d<\/strong><\/h2>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u5b9f\u969b\u306b\u30e1\u30e2\u30ea\u3092\u6d88\u8cbb\u3057\u305f\u969b\u306bzram\u304c\u3069\u306e\u3088\u3046\u306b\u52d5\u4f5c\u3059\u308b\u304b\u30c6\u30b9\u30c8\u3057\u3066\u3044\u304d\u307e\u3059\u3002\u30d0\u30c3\u30ad\u30f3\u30b0\u30c7\u30d0\u30a4\u30b9\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u306a\u3044\u901a\u5e38\u306ezram\u904b\u7528\u3067\u306f\u4eca\u56de\u306e\u65b0\u6a5f\u80fd\u306e\u6069\u6075\u306f\u306a\u3044\u305f\u3081\u3001\u30c6\u30b9\u30c8\u7528\u306b4GB\u306e\u30d0\u30c3\u30ad\u30f3\u30b0\u30c7\u30d0\u30a4\u30b9\u3092\u4f5c\u6210\u3057\u3066\u691c\u8a3c\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>sudo dd if=\/dev\/zero of=\/backing_test bs=1M count=4096 status=progress<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">sudo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">dd<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">if=\/dev\/zero<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">of=\/backing_test<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">bs=<\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #CE9178\">M<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">count=<\/span><span style=\"color: #B5CEA8\">4096<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">status=progress<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>$ sudo swapoff -a<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">$<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">sudo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">swapoff<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-a<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>swapoff\u304c\u7121\u4e8b\u306b\u6210\u529f\u3057\u305f\u3089\u3001\u4ee5\u4e0b\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3057root\u6a29\u9650\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002<br>ZRAM_SIZE\u30922GB\u306b\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u304a\u4f7f\u3044\u306e\u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\u3059\u308b\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002<br>\u5727\u7e2e\u7387\u3088\u308a\u3082\u901f\u5ea6\u91cd\u8996\u3067lzo-rle\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u304c\u3001zstd\u3067\u3082\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>#!\/bin\/bash\n\n&#91; \"$EUID\" -ne 0 &#93; &amp;&amp; exit 1\n\nBACKING_FILE=\"\/backing_test\"\nZRAM_SIZE=\"2G\"\nZRAM_COMP=\"lzo-rle\"\nZRAM_PRIORITY=\"100\"\n\n&#91; ! -f \"$BACKING_FILE\" &#93; &amp;&amp; exit 1\n\nmodprobe zram 2>\/dev\/null\n\nZRAM_DEVICE=$(zramctl -f)\n&#91; -z \"$ZRAM_DEVICE\" &#93; &amp;&amp; exit 1\n\nZRAM_NAME=\"${ZRAM_DEVICE##*\/}\"\n\nLOOP_DEV=$(losetup -f --show \"$BACKING_FILE\")\n&#91; -z \"$LOOP_DEV\" &#93; &amp;&amp; exit 1\n\necho \"$LOOP_DEV\" > \/sys\/block\/${ZRAM_NAME}\/backing_dev\necho \"yes\" > \/sys\/block\/${ZRAM_NAME}\/compressed_writeback\necho \"$ZRAM_COMP\" > \/sys\/block\/${ZRAM_NAME}\/comp_algorithm\necho \"$ZRAM_SIZE\" > \/sys\/block\/${ZRAM_NAME}\/disksize\n\nmkswap \"$ZRAM_DEVICE\" 1>\/dev\/null 2>\/dev\/null\nswapon --priority \"$ZRAM_PRIORITY\" \"$ZRAM_DEVICE\"\necho \"$ZRAM_DEVICE\"<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6A9955\">#!\/bin\/bash<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">&#91; <\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #9CDCFE\">$EUID<\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #D4D4D4\"> -ne <\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\"> &#93; &amp;&amp; <\/span><span style=\"color: #DCDCAA\">exit<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">1<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">BACKING_FILE<\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #CE9178\">&quot;\/backing_test&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">ZRAM_SIZE<\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #CE9178\">&quot;2G&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">ZRAM_COMP<\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #CE9178\">&quot;lzo-rle&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">ZRAM_PRIORITY<\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #CE9178\">&quot;100&quot;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">&#91; ! -f <\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #9CDCFE\">$BACKING_FILE<\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #D4D4D4\"> &#93; &amp;&amp; <\/span><span style=\"color: #DCDCAA\">exit<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">1<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">modprobe<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">zram<\/span><span style=\"color: #D4D4D4\"> 2&gt;<\/span><span style=\"color: #CE9178\">\/dev\/null<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">ZRAM_DEVICE<\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #CE9178\">$(<\/span><span style=\"color: #DCDCAA\">zramctl<\/span><span style=\"color: #CE9178\"> <\/span><span style=\"color: #569CD6\">-f<\/span><span style=\"color: #CE9178\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">&#91; -z <\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #9CDCFE\">$ZRAM_DEVICE<\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #D4D4D4\"> &#93; &amp;&amp; <\/span><span style=\"color: #DCDCAA\">exit<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">1<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">ZRAM_NAME<\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #CE9178\">&quot;${<\/span><span style=\"color: #9CDCFE\">ZRAM_DEVICE<\/span><span style=\"color: #D4D4D4\">##*\/<\/span><span style=\"color: #CE9178\">}&quot;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">LOOP_DEV<\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #CE9178\">$(<\/span><span style=\"color: #DCDCAA\">losetup<\/span><span style=\"color: #CE9178\"> <\/span><span style=\"color: #569CD6\">-f<\/span><span style=\"color: #CE9178\"> <\/span><span style=\"color: #569CD6\">--show<\/span><span style=\"color: #CE9178\"> &quot;<\/span><span style=\"color: #9CDCFE\">$BACKING_FILE<\/span><span style=\"color: #CE9178\">&quot;)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">&#91; -z <\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #9CDCFE\">$LOOP_DEV<\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #D4D4D4\"> &#93; &amp;&amp; <\/span><span style=\"color: #DCDCAA\">exit<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">1<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">echo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #9CDCFE\">$LOOP_DEV<\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #D4D4D4\"> &gt; <\/span><span style=\"color: #CE9178\">\/sys\/block\/<\/span><span style=\"color: #D4D4D4\">${<\/span><span style=\"color: #9CDCFE\">ZRAM_NAME<\/span><span style=\"color: #D4D4D4\">}<\/span><span style=\"color: #CE9178\">\/backing_dev<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">echo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">&quot;yes&quot;<\/span><span style=\"color: #D4D4D4\"> &gt; <\/span><span style=\"color: #CE9178\">\/sys\/block\/<\/span><span style=\"color: #D4D4D4\">${<\/span><span style=\"color: #9CDCFE\">ZRAM_NAME<\/span><span style=\"color: #D4D4D4\">}<\/span><span style=\"color: #CE9178\">\/compressed_writeback<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">echo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #9CDCFE\">$ZRAM_COMP<\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #D4D4D4\"> &gt; <\/span><span style=\"color: #CE9178\">\/sys\/block\/<\/span><span style=\"color: #D4D4D4\">${<\/span><span style=\"color: #9CDCFE\">ZRAM_NAME<\/span><span style=\"color: #D4D4D4\">}<\/span><span style=\"color: #CE9178\">\/comp_algorithm<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">echo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #9CDCFE\">$ZRAM_SIZE<\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #D4D4D4\"> &gt; <\/span><span style=\"color: #CE9178\">\/sys\/block\/<\/span><span style=\"color: #D4D4D4\">${<\/span><span style=\"color: #9CDCFE\">ZRAM_NAME<\/span><span style=\"color: #D4D4D4\">}<\/span><span style=\"color: #CE9178\">\/disksize<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">mkswap<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #9CDCFE\">$ZRAM_DEVICE<\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #D4D4D4\"> 1&gt;<\/span><span style=\"color: #CE9178\">\/dev\/null<\/span><span style=\"color: #D4D4D4\"> 2&gt;<\/span><span style=\"color: #CE9178\">\/dev\/null<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">swapon<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">--priority<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #9CDCFE\">$ZRAM_PRIORITY<\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #9CDCFE\">$ZRAM_DEVICE<\/span><span style=\"color: #CE9178\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">echo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #9CDCFE\">$ZRAM_DEVICE<\/span><span style=\"color: #CE9178\">&quot;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><code>compressed_writeback<\/code> \u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067 <code>no<\/code>\uff08\u7121\u52b9\uff09\u3067\u3059\u3002\u6709\u52b9\u306b\u3059\u308b\u306b\u306f <code>backing_dev<\/code> \u306e\u8a2d\u5b9a\u5f8c\u3001<code>disksize<\/code>\uff08\u30c7\u30d0\u30a4\u30b9\u521d\u671f\u5316\uff09\u306e<strong>\u524d<\/strong>\u306b\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br>\u203b\u4e0a\u8a18\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u306f\u3059\u3067\u306b\u6709\u52b9\u5316\u6e08\u307f\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u5f8c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6709\u52b9\u5316\u3055\u308c\u3066\u3044\u308c\u3070\u6210\u529f\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>$ sudo swapon --show\nNAME       TYPE      SIZE USED PRIO\n\/dev\/zram1 partition   2G   0G  100<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">$<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">sudo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">swapon<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">--show<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">NAME<\/span><span style=\"color: #D4D4D4\">       <\/span><span style=\"color: #CE9178\">TYPE<\/span><span style=\"color: #D4D4D4\">      <\/span><span style=\"color: #CE9178\">SIZE<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">USED<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">PRIO<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">\/dev\/zram1<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">partition<\/span><span style=\"color: #D4D4D4\">   <\/span><span style=\"color: #B5CEA8\">2<\/span><span style=\"color: #CE9178\">G<\/span><span style=\"color: #D4D4D4\">   <\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #CE9178\">G<\/span><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #B5CEA8\">100<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>compressed_writeback=no \u3068 yes \u306e\u6bd4\u8f03<\/strong><\/h2>\n\n\n\n<p>compressed_writeback \u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067 no \u306e\u305f\u3081\u3001\u5b9f\u969b\u306b no \u3068 yes \u3067\u3069\u3046\u9055\u3046\u304b\u3092\u540c\u4e00\u6761\u4ef6\uff08\u540c\u7a0b\u5ea6\u306ezram\u4f7f\u7528\u91cf\uff09\u3067\u305d\u308c\u305e\u308c\u8907\u6570\u56dewriteback\u3092\u5b9f\u884c\u3057\u3066\u6bd4\u8f03\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u8a2d\u5b9a<\/th><th>same_pages\uff08\u5e73\u5747\uff09<\/th><th>zram\u5727\u7e2e\u7387\uff08\u5e73\u5747\uff09<\/th><\/tr><\/thead><tbody><tr><td>no<\/td><td>276<\/td><td>3.3x<\/td><\/tr><tr><td>yes<\/td><td><strong>1309\uff08\u7d044.7\u500d\uff09<\/strong><\/td><td><strong>4.9x\uff08\u6700\u59277.5x\uff09<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>same_pages \u304c yes \u3067\u5927\u5e45\u306b\u5897\u52a0\u3057\u3066\u3044\u308b<\/strong>\u7406\u7531\u306f\u3001yes \u3067\u306f\u5727\u7e2e\u3057\u306b\u304f\u3044\u30da\u30fc\u30b8\uff08incompressible pages\uff09\u3092\u512a\u5148\u7684\u306b\u30d0\u30c3\u30ad\u30f3\u30b0\u30c7\u30d0\u30a4\u30b9\u3078\u8ffd\u3044\u51fa\u3059\u305f\u3081\u3067\u3059\u3002\u305d\u306e\u7d50\u679c\u3001zram\u4e0a\u306b\u6b8b\u308b\u30da\u30fc\u30b8\u304c\u3088\u308a\u5747\u4e00\u30fb\u91cd\u8907\u3057\u305f\u30c7\u30fc\u30bf\u306b\u306a\u308a\u3001\u5727\u7e2e\u7387\u3082\u5411\u4e0a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u306a\u304a\u3001\u4eca\u56de\u306e\u30c6\u30b9\u30c8\u3067\u306f\u30d0\u30c3\u30ad\u30f3\u30b0\u30c7\u30d0\u30a4\u30b9\u306b\u30eb\u30fc\u30d7\u30c7\u30d0\u30a4\u30b9\uff08\/dev\/loop0\uff09\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u30eb\u30fc\u30d7\u30c7\u30d0\u30a4\u30b9\u306f\u5185\u90e8\u3067<strong>4KB\u30bb\u30af\u30bf\u5883\u754c\u3078\u306e\u30a2\u30e9\u30a4\u30e1\u30f3\u30c8\u3092\u5f37\u5236<\/strong>\u3059\u308b\u305f\u3081\u3001\u5727\u7e2e\u5f8c\u30c7\u30fc\u30bf\u304c\u5c0f\u3055\u304f\u3066\u3082\u5e38\u306b4KB\u5358\u4f4d\u3067\u66f8\u304d\u8fbc\u307e\u308c\u307e\u3059\u3002\u305d\u306e\u305f\u3081 no \u3068 yes \u3067I\/O\u66f8\u8fbc\u307f\u30d0\u30a4\u30c8\u6570\u306b\u5dee\u306f\u73fe\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u5b9f\u969b\u306eNVMe\u3084eMMC\u3092\u30d0\u30c3\u30ad\u30f3\u30b0\u30c7\u30d0\u30a4\u30b9\u3068\u3057\u3066\u4f7f\u7528\u3057\u305f\u5834\u5408\u306f\u3001\u5727\u7e2e\u7387\u306b\u5fdc\u3058\u305f\u66f8\u304d\u8fbc\u307f\u30d0\u30a4\u30c8\u6570\u306e\u524a\u6e1b\u3082\u671f\u5f85\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u30e1\u30e2\u30ea\u6d88\u8cbb\u30c6\u30b9\u30c8<\/strong><\/h2>\n\n\n\n<p>\u6b21\u306b\u3001\u30e1\u30e2\u30ea\u3092\u624b\u52d5\u3067\u6d88\u8cbb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br>\u30e1\u30e2\u30ea\u6d88\u8cbb\u30d7\u30ed\u30b0\u30e9\u30e0\u306fPython\u3067\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002\u5225\u7a93\u3067\u5b9f\u884c\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br>\u203b\u73fe\u5728\u306f\u6700\u59279GB\u3092\u6d88\u8cbb\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u6301\u3061\u524d\u306e\u74b0\u5883\u306b\u3088\u3063\u3066SWAP\u304c\u767a\u751f\u3059\u308b\u5024\u306b\u5909\u66f4\u3057\u3066\u3044\u305f\u3060\u3051\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>import time\ndata = []\nlimit_mb = 9000\ntry:\n    while True:\n        data.append(bytearray(100 * 1024 * 1024))\n        used = len(data) * 100\n        print(f'{used} MB', flush=True)\n        if used >= limit_mb:\n            print(f'Reached limit: {used} MB')\n            break\nexcept MemoryError:\n    print(f'MemoryError at {len(data) * 100} MB')\nprint('Ctrl+C to release')\nwhile True:\n    time.sleep(1)<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C586C0\">import<\/span><span style=\"color: #D4D4D4\"> time<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">data = []<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">limit_mb = <\/span><span style=\"color: #B5CEA8\">9000<\/span><\/span>\n<span class=\"line\"><span style=\"color: #C586C0\">try<\/span><span style=\"color: #D4D4D4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #C586C0\">while<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">True<\/span><span style=\"color: #D4D4D4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        data.append(<\/span><span style=\"color: #4EC9B0\">bytearray<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #B5CEA8\">100<\/span><span style=\"color: #D4D4D4\"> * <\/span><span style=\"color: #B5CEA8\">1024<\/span><span style=\"color: #D4D4D4\"> * <\/span><span style=\"color: #B5CEA8\">1024<\/span><span style=\"color: #D4D4D4\">))<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        used = <\/span><span style=\"color: #DCDCAA\">len<\/span><span style=\"color: #D4D4D4\">(data) * <\/span><span style=\"color: #B5CEA8\">100<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #DCDCAA\">print<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #569CD6\">f<\/span><span style=\"color: #CE9178\">&#39;<\/span><span style=\"color: #569CD6\">{<\/span><span style=\"color: #D4D4D4\">used<\/span><span style=\"color: #569CD6\">}<\/span><span style=\"color: #CE9178\"> MB&#39;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #9CDCFE\">flush<\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #569CD6\">True<\/span><span style=\"color: #D4D4D4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #C586C0\">if<\/span><span style=\"color: #D4D4D4\"> used &gt;= limit_mb:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            <\/span><span style=\"color: #DCDCAA\">print<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #569CD6\">f<\/span><span style=\"color: #CE9178\">&#39;Reached limit: <\/span><span style=\"color: #569CD6\">{<\/span><span style=\"color: #D4D4D4\">used<\/span><span style=\"color: #569CD6\">}<\/span><span style=\"color: #CE9178\"> MB&#39;<\/span><span style=\"color: #D4D4D4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            <\/span><span style=\"color: #C586C0\">break<\/span><\/span>\n<span class=\"line\"><span style=\"color: #C586C0\">except<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4EC9B0\">MemoryError<\/span><span style=\"color: #D4D4D4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #DCDCAA\">print<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #569CD6\">f<\/span><span style=\"color: #CE9178\">&#39;MemoryError at <\/span><span style=\"color: #569CD6\">{<\/span><span style=\"color: #DCDCAA\">len<\/span><span style=\"color: #D4D4D4\">(data) * <\/span><span style=\"color: #B5CEA8\">100<\/span><span style=\"color: #569CD6\">}<\/span><span style=\"color: #CE9178\"> MB&#39;<\/span><span style=\"color: #D4D4D4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">print<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&#39;Ctrl+C to release&#39;<\/span><span style=\"color: #D4D4D4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #C586C0\">while<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">True<\/span><span style=\"color: #D4D4D4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    time.sleep(<\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u308c\u3092\u52d5\u304b\u3059\u3068\u3001Python\u304c\u30e1\u30e2\u30ea\u3092\u6d88\u8cbb\u3057\u3066\u884c\u304f\u69d8\u5b50\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u5b9f\u884c\u4e2d\u306etop\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>top - 00:31:31 up 5 min,  1 user,  load average: 1.53, 1.41, 0.65\nTasks: 261 total, 1 running, 260 sleep, 0 d-sleep, 0 stopped, 0 zombie\n%Cpu(s):  8.2 us,  7.1 sy,  0.0 ni, 82.7 id,  2.0 wa,  0.0 hi,  0.0 si,  0.0 st \nMiB Mem :  11775.9 total,    369.4 free,  11428.7 used,    707.5 buff\/cache     \nMiB Swap:   2048.0 total,   1637.8 free,    410.2 used.    347.2 avail Mem <\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">top<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">-<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">00<\/span><span style=\"color: #CE9178\">:31:31<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">up<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">5<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">min,<\/span><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">user,<\/span><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #CE9178\">load<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">average:<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">1.53<\/span><span style=\"color: #CE9178\">,<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">1.41<\/span><span style=\"color: #CE9178\">,<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">0.65<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">Tasks:<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">261<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">total,<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">running,<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">260<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">sleep,<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">d-sleep,<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">stopped,<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">zombie<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">%Cpu(s<\/span><span style=\"color: #D4D4D4\">):  8.2 us,  7.1 sy,  0.0 ni, 82.7 id,  2.0 wa,  0.0 hi,  0.0 si,  0.0 st <\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">MiB<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">Mem<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">:<\/span><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #B5CEA8\">11775.9<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">total,<\/span><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #B5CEA8\">369.4<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">free,<\/span><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #B5CEA8\">11428.7<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">used,<\/span><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #B5CEA8\">707.5<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">buff\/cache<\/span><span style=\"color: #D4D4D4\">     <\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">MiB<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">Swap:<\/span><span style=\"color: #D4D4D4\">   <\/span><span style=\"color: #B5CEA8\">2048.0<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">total,<\/span><span style=\"color: #D4D4D4\">   <\/span><span style=\"color: #B5CEA8\">1637.8<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">free,<\/span><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #B5CEA8\">410.2<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">used.<\/span><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #B5CEA8\">347.2<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">avail<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">Mem<\/span><span style=\"color: #D4D4D4\"> <\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u304a\u5f85\u3061\u304b\u306d\u306e\u30e9\u30a4\u30c8\u30d0\u30c3\u30af\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002zram\u306e\u30c7\u30d0\u30a4\u30b9\u540d\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u5b9f\u884c\u6642\u306b\u8868\u793a\u3055\u308c\u305f\u3082\u306e\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4eca\u56de\u306e\u74b0\u5883\u3067\u306fzram1\u3067\u3057\u305f\u306e\u3067\u3001\u305d\u308c\u3092\u6307\u5b9a\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>3\u7a2e\u985e\u306e\u30e9\u30a4\u30c8\u30d0\u30c3\u30af\u5bfe\u8c61\u3092\u9078\u629e\u3067\u304d\u307e\u3059\u3002\u901a\u5e38\u306f type=huge_idle\uff08\u5727\u7e2e\u3067\u304d\u305a\u3001\u304b\u3064\u9577\u6642\u9593\u30a2\u30af\u30bb\u30b9\u3055\u308c\u3066\u3044\u306a\u3044\u30da\u30fc\u30b8\uff09\u3092\u5bfe\u8c61\u306b\u3059\u308b\u306e\u304c\u6700\u3082RAM\u3092\u52b9\u7387\u3088\u304f\u89e3\u653e\u3067\u304d\u307e\u3059\u3002type=idle \u3084 type=huge \u306f\u5358\u4f53\u3067\u3082\u4f7f\u3048\u307e\u3059\u304c\u3001\u30d5\u30e9\u30c3\u30b7\u30e5\u30c7\u30d0\u30a4\u30b9\u3078\u306e\u66f8\u304d\u8fbc\u307f\u56de\u6570\u304c\u5897\u3048\u308b\u70b9\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly># \u3059\u3079\u3066\u306e\u30da\u30fc\u30b8\u3092 idle \u3068\u3057\u3066\u30de\u30fc\u30af\necho all | sudo tee \/sys\/block\/zram1\/idle\n\n# idle \u30da\u30fc\u30b8\u3092\u30e9\u30a4\u30c8\u30d0\u30c3\u30af\necho \"type=idle\" | sudo tee \/sys\/block\/zram1\/writeback\n\n# huge \u30da\u30fc\u30b8\u3092\u30e9\u30a4\u30c8\u30d0\u30c3\u30af\necho \"type=huge\" | sudo tee \/sys\/block\/zram1\/writeback\n\n# huge \u304b\u3064 idle \u30da\u30fc\u30b8\u3092\u30e9\u30a4\u30c8\u30d0\u30c3\u30af\necho \"type=huge_idle\" | sudo tee \/sys\/block\/zram1\/writeback<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6A9955\"># \u3059\u3079\u3066\u306e\u30da\u30fc\u30b8\u3092 idle \u3068\u3057\u3066\u30de\u30fc\u30af<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">echo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">all<\/span><span style=\"color: #D4D4D4\"> | <\/span><span style=\"color: #DCDCAA\">sudo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">tee<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">\/sys\/block\/zram1\/idle<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\"># idle \u30da\u30fc\u30b8\u3092\u30e9\u30a4\u30c8\u30d0\u30c3\u30af<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">echo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">&quot;type=idle&quot;<\/span><span style=\"color: #D4D4D4\"> | <\/span><span style=\"color: #DCDCAA\">sudo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">tee<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">\/sys\/block\/zram1\/writeback<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\"># huge \u30da\u30fc\u30b8\u3092\u30e9\u30a4\u30c8\u30d0\u30c3\u30af<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">echo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">&quot;type=huge&quot;<\/span><span style=\"color: #D4D4D4\"> | <\/span><span style=\"color: #DCDCAA\">sudo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">tee<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">\/sys\/block\/zram1\/writeback<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\"># huge \u304b\u3064 idle \u30da\u30fc\u30b8\u3092\u30e9\u30a4\u30c8\u30d0\u30c3\u30af<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">echo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">&quot;type=huge_idle&quot;<\/span><span style=\"color: #D4D4D4\"> | <\/span><span style=\"color: #DCDCAA\">sudo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">tee<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">\/sys\/block\/zram1\/writeback<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>bd_stat\u3001mm_stat\u3092\u78ba\u8a8d\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>$ cat \/sys\/block\/zram1\/bd_stat\n  292244     1801   294048\n$ cat \/sys\/block\/zram1\/mm_stat\n1204899840        0        0        0 433520640     3463     2287        0    10090<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">$<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">cat<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">\/sys\/block\/zram1\/bd_stat<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #DCDCAA\">292244<\/span><span style=\"color: #D4D4D4\">     <\/span><span style=\"color: #B5CEA8\">1801<\/span><span style=\"color: #D4D4D4\">   <\/span><span style=\"color: #B5CEA8\">294048<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">$<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">cat<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">\/sys\/block\/zram1\/mm_stat<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">1204899840<\/span><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">433520640<\/span><span style=\"color: #D4D4D4\">     <\/span><span style=\"color: #B5CEA8\">3463<\/span><span style=\"color: #D4D4D4\">     <\/span><span style=\"color: #B5CEA8\">2287<\/span><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #B5CEA8\">10090<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>bd_stat \u306e3\u3064\u306e\u6570\u5024\u306f\u305d\u308c\u305e\u308c\u3001\u73fe\u5728\u30d0\u30c3\u30ad\u30f3\u30b0\u30c7\u30d0\u30a4\u30b9\u306b\u9000\u907f\u4e2d\u306e\u30da\u30fc\u30b8\u6570\u30fb\u8aad\u307f\u623b\u3057\u56de\u6570\u30fb\u66f8\u304d\u8fbc\u307f\u56de\u6570\u3092\u8868\u3057\u3066\u3044\u307e\u3059\u3002\u4eca\u56de\u306e\u7d50\u679c\u3067\u306f\u8ad6\u7406\u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\u3067<strong>\u7d041142MB\u5206<\/strong>\u306e\u30da\u30fc\u30b8\u304c\u30e9\u30a4\u30c8\u30d0\u30c3\u30af\u6e08\u307f\u3067\u3001\u8aad\u307f\u623b\u3057\u304c\u5c11\u306a\u3044\u3053\u3068\u304b\u3089\u52b9\u7387\u3088\u304f\u52d5\u4f5c\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002mm_stat \u3092\u898b\u308b\u3068\u30e1\u30e2\u30ea\u4e0a\u306e\u5727\u7e2e\u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\u304c0MB\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u308c\u306fzram\u5185\u306e\u30c7\u30fc\u30bf\u304c<strong>\u5c55\u958b\uff08\u89e3\u51cd\uff09\u51e6\u7406\u3055\u308c\u308b\u3053\u3068\u306a\u304f\u3001\u5727\u7e2e\u3055\u308c\u305f\u72b6\u614b\u306e\u307e\u307e<\/strong>\u30d0\u30c3\u30ad\u30f3\u30b0\u30c7\u30d0\u30a4\u30b9\u3078\u9001\u3089\u308c\u305f\u305f\u3081\u3067\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u3059\u3079\u3066\u306e\u30c7\u30fc\u30bf\u304c\u7121\u99c4\u306a\u51e6\u7406\u306a\u304f\u30eb\u30fc\u30d7\u30c7\u30d0\u30a4\u30b9\u7b49\u306b\u9003\u304c\u3055\u308c\u3066zram\u306e\u30e1\u30e2\u30ea\u6d88\u8cbb\u304c\u5b9f\u8cea\u30bc\u30ed\u3068\u306a\u308a\u3001\u30b7\u30b9\u30c6\u30e0\u3067\u4f7f\u3048\u308b\u7269\u7406\u30e1\u30e2\u30ea\u91cf\u304c\u5927\u5e45\u306b\u5897\u52a0\u3057\u307e\u3057\u305f\u3002<\/p>\n<\/blockquote>\n<\/blockquote>\n\n\n\n<p>CPU\u8ca0\u8377\u3082\u540c\u6642\u306b\u691c\u8a3c\u3059\u308c\u3070\u3088\u304b\u3063\u305f\u3067\u3059\u306d\u30fb\u30fb<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u307e\u3068\u3081<\/strong><\/h2>\n\n\n\n<p>Writeback\u81ea\u4f53\u306f\u30ab\u30fc\u30cd\u30eb4.14\u304b\u3089\u5b58\u5728\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u30ab\u30fc\u30cd\u30eb7.0\u3067\u306f<strong>\u5727\u7e2e\u30c7\u30fc\u30bf\u3092\u305d\u306e\u307e\u307e\u30e9\u30a4\u30c8\u30d0\u30c3\u30af\u3067\u304d\u308b<\/strong>\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u4ee5\u524d\u306f\u30d0\u30c3\u30ad\u30f3\u30b0\u30c7\u30d0\u30a4\u30b9\u3078\u306e\u66f8\u304d\u51fa\u3057\u6642\u306b\u5c55\u958b\u51e6\u7406\u304c\u8d70\u3063\u3066\u3044\u305f\u305f\u3081\u3001\u4f59\u5206\u306aCPU\u8ca0\u8377\u3068\u6d88\u8cbb\u96fb\u529b\u304c\u767a\u751f\u3057\u3066\u3044\u307e\u3057\u305f\u3002\u4eca\u56de\u306e\u6539\u5584\u306b\u3088\u308a\u3001zram\u3067\u5727\u7e2e\u3055\u308c\u305f\u30da\u30fc\u30b8\u3092\u305d\u306e\u307e\u307e\u66f8\u304d\u51fa\u305b\u308b\u3088\u3046\u306b\u306a\u308a\u3001\u30e1\u30e2\u30ea\u52b9\u7387\u304c\u3055\u3089\u306b\u5411\u4e0a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u306a\u304a\u3001<strong>compressed_writeback \u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067 no<\/strong> \u306e\u305f\u3081\u3001\u6069\u6075\u3092\u53d7\u3051\u308b\u306b\u306f\u660e\u793a\u7684\u306b\u6709\u52b9\u5316\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u307e\u305f\u3001\u30d0\u30c3\u30ad\u30f3\u30b0\u30c7\u30d0\u30a4\u30b9\u306b\u30eb\u30fc\u30d7\u30c7\u30d0\u30a4\u30b9\u3092\u4f7f\u3046\u5834\u5408\u306fI\/O\u524a\u6e1b\u52b9\u679c\u304c\u6570\u5024\u306b\u73fe\u308c\u306b\u304f\u3044\u70b9\u3082\u3042\u308f\u305b\u3066\u899a\u3048\u3066\u304a\u304f\u3068\u826f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30e1\u30e2\u30ea\u304c\u5c11\u306a\u3044\u74b0\u5883\u3084\u3001\u7701\u96fb\u529b\u3092\u91cd\u8996\u3059\u308b\u74b0\u5883\u3067\u306f\u52b9\u679c\u304c\u5927\u304d\u304f\u3001\u30d0\u30c3\u30ad\u30f3\u30b0\u30c7\u30d0\u30a4\u30b9\u3068\u3057\u3066NVMe\u306a\u3069\u306e\u9ad8\u901f\u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u7528\u610f\u3067\u304d\u308b\u5834\u5408\u306f\u8a66\u3057\u3066\u307f\u308b\u4fa1\u5024\u304c\u3042\u308b\u304b\u306a\u3068\u611f\u3058\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u304a\u308f\u308a<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Testing zram writeback on Linux 7.0 (Slackware) \u306f\u3058\u3081\u306b Linux \u30ab\u30fc\u30cd\u30eb7.0\u3067\u306fzram\u306b\u3044\u304f\u3064\u304b\u306e\u6539\u5584\u304c\u52a0\u3048\u3089\u308c\u307e\u3057\u305f\u3002\u4eca\u56de\u306f\u5b9f\u969b\u306b\u5b9f\u6a5f\u3092\u52d5\u304b\u3057\u3066\u78ba\u8a8d\u3057\u3066\u884c\u3053\u3046\u3068 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cybocfi_hide_featured_image":"","footnotes":""},"categories":[153,233,78],"tags":[235,234],"class_list":["post-3075","post","type-post","status-publish","format-standard","hentry","category-linux","category-slackware","category-updates","tag-kernel-7-0","tag-zram"],"_links":{"self":[{"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/posts\/3075","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/comments?post=3075"}],"version-history":[{"count":27,"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/posts\/3075\/revisions"}],"predecessor-version":[{"id":3106,"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/posts\/3075\/revisions\/3106"}],"wp:attachment":[{"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/media?parent=3075"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/categories?post=3075"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/tags?post=3075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}