{"id":3231,"date":"2017-03-02T23:50:12","date_gmt":"2017-03-02T15:50:12","guid":{"rendered":"https:\/\/ixyzero.com\/blog\/?p=3231"},"modified":"2017-03-02T23:50:12","modified_gmt":"2017-03-02T15:50:12","slug":"%e4%b8%80%e6%ac%a1find%e5%91%bd%e4%bb%a4%e5%af%bc%e8%87%b4%e7%9a%84%e5%86%85%e5%ad%98%e9%97%ae%e9%a2%98%e6%8e%92%e6%9f%a5","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/3231.html","title":{"rendered":"\u4e00\u6b21find\u547d\u4ee4\u5bfc\u81f4\u7684\u5185\u5b58\u95ee\u9898\u6392\u67e5"},"content":{"rendered":"<p>=Start=<\/p>\n<h4 id=\"id-\u4e00\u6b21find\u547d\u4ee4\u5bfc\u81f4\u7684\u5185\u5b58\u95ee\u9898\u6392\u67e5-\u7f18\u7531\uff1a\">\u7f18\u7531\uff1a<\/h4>\n<p>\u7ebf\u4e0a\u626b\u63cf\u52a0\u4e86\u4e2afind\u547d\u4ee4\uff0c\u7136\u540e\u5f88\u591a\u673a\u5668\u7684\u78c1\u76d8IO\u5c31\u5f00\u59cb\u544a\u8b66\u4e86\uff0c\u8fd9\u4e2a\u662f\u610f\u6599\u4e4b\u4e2d\u7684\u4e8b\u60c5\uff0c\u6bd5\u7adf\u8be5\u547d\u4ee4\u4f1a\u589e\u52a0\u8bfb\u76d8\u64cd\u4f5c\u4e48\uff1b\u6bd4\u8f83\u8be1\u5f02\u7684\u95ee\u9898\u5728\u4e8e\uff0c\u90e8\u5206\u673a\u5668\u7684\u5185\u5b58\u5347\u9ad8\u7684\u6bd4\u8f83\u5389\u5bb3\u3002\u3002\u3002\u6211\u7684\u5929\u5450\uff0c\u8981\u662f\u628a\u91cd\u8981\u4e1a\u52a1\u641e\u6302\u4e86\u6211\u53ef\u600e\u4e48\u529e\u3002\u3002\u3002\u7ec6\u601d\u6781\u6050<\/p>\n<p>\u51fa\u4e86\u95ee\u9898\u4e0d\u53ef\u6015\uff0c\u300c\u5e38\u5728\u6cb3\u8fb9\u8d70\uff0c\u54ea\u6709\u4e0d\u6e7f\u978b\u300d\uff0c\u901a\u8fc7\u5b9a\u4f4d\u539f\u56e0\uff0c\u5b66\u4e60\u7ecf\u9a8c\uff0c\u4ee5\u540e\u907f\u514d\u5c31\u662f\u4e86\u3002<\/p>\n<h4 id=\"id-\u4e00\u6b21find\u547d\u4ee4\u5bfc\u81f4\u7684\u5185\u5b58\u95ee\u9898\u6392\u67e5-\u6b63\u6587\uff1a\">\u6b63\u6587\uff1a<\/h4>\n<h5 id=\"id-\u4e00\u6b21find\u547d\u4ee4\u5bfc\u81f4\u7684\u5185\u5b58\u95ee\u9898\u6392\u67e5-\u53c2\u8003\u89e3\u7b54\uff1a\">\u53c2\u8003\u89e3\u7b54\uff1a<\/h5>\n<pre class=\"content\">\u300c\u5185\u5b58\u7684\u53bb\u5411\u4e3b\u8981\u67093\u4e2a\uff1a1.\u8fdb\u7a0b\u6d88\u8017\uff1b2.slab\u6d88\u8017\uff1b3.pagetable\u6d88\u8017\u3002\u300d<\/pre>\n<hr \/>\n<p>find\u53ef\u80fd\u5f15\u53d1\u7684\u5185\u5b58\u589e\u957f\u4e3b\u8981\u662f\u56e0\u4e3aslab\u6d88\u8017\uff0c\u4e14\u4e3b\u8981\u662finode\u548cdentry\u7684\u7f13\u5b58\uff1a<\/p>\n<div class=\"code panel pdl conf-macro output-block\" data-hasbody=\"true\" data-macro-name=\"code\">\n<div class=\"codeContent panelContent pdl\">\n<div id=\"highlighter_589278\" class=\"syntaxhighlighter sh-confluence nogutter java\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\" title=\"Hint: double-click to select code\">\n<div class=\"line number1 index0 alt2\"><code class=\"java plain\">$ cat \/proc\/slabinfo | grep --color -iE\u00a0<\/code><code class=\"java string\">\"inode|dentry\"<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"java plain\">$<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"java plain\">$ cat \/proc\/slabinfo |awk\u00a0<\/code><code class=\"java string\">'{print $1,$3*$4\/1024,\"KB\"}'<\/code>\u00a0<code class=\"java plain\">| sort -k2 -n<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"java plain\">$ cat \/proc\/slabinfo |awk\u00a0<\/code><code class=\"java string\">'{print $1,$3*$4\/1024,\"KB\"}'<\/code>\u00a0<code class=\"java plain\">| sort -k2 -n | tail<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<hr \/>\n<p>\u4ec0\u4e48\u662fpagecache\/inodes\/dentries\uff1f\u4ee5\u53caLinux\u5185\u5b58\u7684\u7ba1\u7406\u65b9\u6cd5\uff1a<\/p>\n<ul>\n<li><a class=\"external-link\" href=\"http:\/\/stackoverflow.com\/a\/29871962\" target=\"_blank\" rel=\"nofollow\">http:\/\/stackoverflow.com\/a\/29871962<\/a><\/li>\n<li><a class=\"external-link\" href=\"http:\/\/stackoverflow.com\/a\/37007479\" target=\"_blank\" rel=\"nofollow\">http:\/\/stackoverflow.com\/a\/37007479<\/a><\/li>\n<\/ul>\n<hr \/>\n<p>Linux\u7cfb\u7edf\u5bf9\u5185\u5b58\u548cswap\u7684\u4f7f\u7528\u65b9\u5f0f\u662f\u4ec0\u4e48\u6837\u7684\uff1f<\/p>\n<ol>\n<li>\u6709\u5185\u5b58\u65f6\u5148\u7528\u5185\u5b58\uff1b<\/li>\n<li>\u5185\u5b58\u4e0d\u591f\u4e86\u7528swap\uff1b<\/li>\n<li>\u5185\u5b58\u5145\u8db3\u4e86\u518d\u628aswap\u91cc\u7684\u70ed\u70b9\u6570\u636e\u7f6e\u6362\u51fa\u6765\uff1b<\/li>\n<\/ol>\n<h5 id=\"id-\u4e00\u6b21find\u547d\u4ee4\u5bfc\u81f4\u7684\u5185\u5b58\u95ee\u9898\u6392\u67e5-\u53c2\u8003\u94fe\u63a5\uff1a\">\u53c2\u8003\u94fe\u63a5\uff1a<\/h5>\n<ul>\n<li>Linux Used\u5185\u5b58\u5230\u5e95\u54ea\u91cc\u53bb\u4e86\uff1f<br \/>\n<a class=\"external-link\" href=\"http:\/\/blog.yufeng.info\/archives\/2456\" target=\"_blank\" rel=\"nofollow\">http:\/\/blog.yufeng.info\/archives\/2456<\/a><\/li>\n<li>\u4e00\u6b21linux\u5185\u5b58\u95ee\u9898\u6392\u67e5-slab<br \/>\n<a class=\"external-link\" href=\"https:\/\/bhsc881114.github.io\/2015\/04\/19\/%E4%B8%80%E6%AC%A1linux%E5%86%85%E5%AD%98%E9%97%AE%E9%A2%98%E6%8E%92%E6%9F%A5-slab\/\" target=\"_blank\" rel=\"nofollow\">https:\/\/bhsc881114.github.io\/2015\/04\/19\/%E4%B8%80%E6%AC%A1linux%E5%86%85%E5%AD%98%E9%97%AE%E9%A2%98%E6%8E%92%E6%9F%A5-slab\/<\/a><\/li>\n<li>slab\u5185\u5b58\u95ee\u9898\u518d\u8c08<br \/>\n<a class=\"external-link\" href=\"https:\/\/timo.piqiu.me\/2015\/08\/02\/slab%E5%86%85%E5%AD%98%E9%97%AE%E9%A2%98%E5%86%8D%E8%B0%88\/\" target=\"_blank\" rel=\"nofollow\">https:\/\/timo.piqiu.me\/2015\/08\/02\/slab%E5%86%85%E5%AD%98%E9%97%AE%E9%A2%98%E5%86%8D%E8%B0%88\/<\/a><\/li>\n<\/ul>\n<p>=END=<\/p>\n","protected":false},"excerpt":{"rendered":"<p>=Start= \u7f18\u7531\uff1a \u7ebf\u4e0a\u626b\u63cf\u52a0\u4e86\u4e2afind\u547d\u4ee4\uff0c\u7136\u540e\u5f88\u591a\u673a\u5668\u7684\u78c1\u76d8IO\u5c31\u5f00\u59cb\u544a\u8b66\u4e86\uff0c\u8fd9\u4e2a\u662f\u610f\u6599\u4e4b\u4e2d\u7684\u4e8b\u60c5\uff0c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,11],"tags":[760,295,758,30,759],"class_list":["post-3231","post","type-post","status-publish","format-standard","hentry","category-knowledgebase-2","category-linux","tag-dentry","tag-free","tag-inode","tag-linux","tag-slab"],"views":6446,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/3231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/comments?post=3231"}],"version-history":[{"count":1,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/3231\/revisions"}],"predecessor-version":[{"id":3232,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/3231\/revisions\/3232"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=3231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=3231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=3231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}