{"id":1041,"date":"2019-11-28T15:05:38","date_gmt":"2019-11-28T07:05:38","guid":{"rendered":"http:\/\/149.129.74.185\/?p=1041"},"modified":"2019-11-28T15:05:38","modified_gmt":"2019-11-28T07:05:38","slug":"%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f-%e8%87%aa%e4%b9%a0%e7%ac%ac%e5%85%ab%e7%ab%a0%e3%80%81%e7%ac%ac%e4%b9%9d%e7%ab%a0","status":"publish","type":"post","link":"http:\/\/www.magicmipamipa.com\/?p=1041","title":{"rendered":"[\u64cd\u4f5c\u7cfb\u7edf] \u81ea\u4e60\u7b2c\u516b\u7ae0\u3001\u7b2c\u4e5d\u7ae0"},"content":{"rendered":"<table>\n<tbody>\n<tr>\n<td><\/td>\n<td>\u4f18\u70b9<\/td>\n<td>\u7f3a\u70b9<\/td>\n<\/tr>\n<tr>\n<td>\u5206\u9875\u7ba1\u7406<\/td>\n<td>\u5185\u5b58\u5229\u7528\u7387\u9ad8\uff0c\u4e0d\u4f1a\u4ea7\u751f\u5916\u90e8\u788e\u7247\uff0c\u53ea\u4f1a\u6709<span style=\"color: #ff99cc;\">\u5c11\u91cf\u7684\u9875\u5185\u788e\u7247<\/span>\u3002<\/td>\n<td>\u4e0d\u65b9\u4fbf\u6309\u7167\u903b\u8f91\u6a21\u5757\u5b9e\u73b0\u4fe1\u606f\u7684\u5171\u4eab\u548c\u4fdd\u62a4\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u5206\u6bb5\u7ba1\u7406<\/td>\n<td>\u5f88\u65b9\u4fbf\u6309\u7167\u903b\u8f91\u6a21\u5757\u5b9e\u73b0\u4fe1\u606f\u7684\u5171\u4eab\u548c\u4fdd\u62a4\u3002<\/td>\n<td>\u5982\u679c\u6bb5\u957f\u8fc7\u5927\uff0c\u4e3a\u5176\u5206\u914d\u5f88\u5927\u7684\u8fde\u7eed\u7a7a\u95f4\u4f1a\u5f88\u4e0d\u65b9\u4fbf\uff0c\u53e6\u5916\uff0c\u6bb5\u5f0f\u7ba1\u7406\u4f1a<span style=\"color: #ff99cc;\">\u4ea7\u751f\u5916\u90e8\u788e\u7247\u3002<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>\u6bb5\u5f0f\u5730\u5740\uff1a\u6bb5\u53f7+\u6bb5\u5185\u5730\u5740<\/p>\n<p>\u9875\u5f0f\u5730\u5740\uff1a\u9875\u53f7+\u9875\u5185\u504f\u79fb\u91cf<\/p>\n<ul>\n<li><span style=\"color: #ff99cc;\">\u6bb5\u53f7\u4f4d\u6570\u51b3\u5b9a\u4e86\u6bcf\u4e2a\u8fdb\u7a0b\u6700\u591a\u53ef\u4ee5\u5206\u51e0\u4e2a\u6bb5<\/span><\/li>\n<li><span style=\"color: #ff99cc;\">\u9875\u53f7\u4f4d\u6570\u51b3\u5b9a\u4e86\u6bcf\u4e2a\u6bb5\u6700\u591a\u6709\u591a\u5c11\u9875<\/span><\/li>\n<li><span style=\"color: #ff99cc;\">\u9875\u5185\u504f\u79fb\u91cf\u51b3\u5b9a\u4e86\u9875\u9762\u5927\u5c0f\u3001\u5185\u5b58\u5757\u5927\u5c0f\u662f\u591a\u5c11<\/span><\/li>\n<\/ul>\n<p>\u6bb5\u8868\uff1a\u5b58\u50a8\u754c\u9650\u3001\u57fa\u5730\u5740<\/p>\n<p><span style=\"font-size: 20px;\"><strong>\u4f20\u7edf\u5b58\u50a8\u7ba1\u7406\u65b9\u5f0f\uff1a<\/strong><\/span><\/p>\n<p><strong><span style=\"color: #ff99cc;\">\u4e00\u6b21\u6027<\/span><\/strong>\uff1a\u4f5c\u4e1a\u5fc5\u987b\u4e00\u6b21\u6027\u5168\u90e8\u88c5\u5165\u5185\u5b58\u540e\u624d\u80fd\u5f00\u59cb\u8fd0\u884c\u3002\u8fd9\u4f1a\u9020\u6210\u4e24\u4e2a\u95ee\u9898\uff081\uff09\u4f5c\u4e1a\u5f88\u5927\u4e0d\u80fd\u5168\u90e8\u88c5\u5165\u5185\u5b58\uff0c\u5bfc\u81f4<span style=\"color: #ff99cc;\">\u5927\u4f5c\u4e1a\u65e0\u6cd5\u8fd0\u884c<\/span>\u3002\uff082\uff09\u5f53\u5927\u91cf\u4f5c\u4e1a\u8981\u6c42\u8fd0\u884c\u65f6\uff0c\u7531\u4e8e\u5185\u5b58\u65e0\u6cd5\u5bb9\u7eb3\u6240\u6709\u4f5c\u4e1a\uff0c\u56e0\u6b64\u53ea\u6709\u5c11\u91cf\u4f5c\u4e1a\u80fd\u8fd0\u884c\uff0c\u5bfc\u81f4<span style=\"color: #ff99cc;\">\u591a\u9053\u7a0b\u5e8f\u5e76\u53d1\u5ea6\u4e0b\u964d<\/span>\u3002<\/p>\n<p><strong><span style=\"color: #ff99cc;\">\u9a7b\u7559\u6027<\/span><\/strong>\uff1a\u4e00\u65e6\u4f5c\u4e1a\u88ab\u88c5\u5165\u5185\u5b58\uff0c\u5c31\u4f1a<span style=\"color: #ff99cc;\">\u4e00\u76f4\u9a7b\u7559\u5728\u5185\u5b58\u4e2d<\/span>\uff0c\u76f4\u5230\u4f5c\u4e1a\u8fd0\u884c\u7ed3\u675f\u3002\u6d6a\u8d39\u4e86\u5185\u5b58\u7684\u8d44\u6e90\u3002<\/p>\n<p><span style=\"font-size: 20px;\"><strong>\u5c40\u90e8\u6027\u539f\u7406(principle of locality)<\/strong><\/span><\/p>\n<p>\u6307\u7a0b\u5e8f\u5728\u6267\u884c\u8fc7\u7a0b\u4e2d\u7684\u4e00\u4e2a\u8f83\u77ed\u65f6\u671f\uff0c\u6240\u6267\u884c\u7684\u6307\u4ee4\u5730\u5740\u548c\u6307\u4ee4\u7684\u64cd\u4f5c\u6570\u5730\u5740\uff0c\u5206\u522b\u5c40\u9650\u4e8e\u4e00\u5b9a\u533a\u57df\u3002\u8868\u73b0\u4e3a\uff1a<\/p>\n<ul style=\"list-style-type: circle;\">\n<li><span style=\"color: #ff99cc;\">\u65f6\u95f4\u5c40\u90e8\u6027<\/span>\uff1a\u4e00\u6761\u6307\u4ee4\u7684\u4e00\u6b21\u6267\u884c\u548c\u4e0b\u6b21\u6267\u884c\uff0c\u4e00\u4e2a\u6570\u636e\u7684\u4e00\u6b21\u8bbf\u95ee\u548c\u4e0b\u6b21\u8bbf\u95ee\u90fd\u96c6\u4e2d\u5728\u4e00\u4e2a\u8f83\u77ed\u65f6\u671f\u5185\uff1b<\/li>\n<li><span style=\"color: #ff99cc;\">\u7a7a\u95f4\u5c40\u90e8\u6027<\/span>\uff1a\u5f53\u524d\u6307\u4ee4\u548c\u90bb\u8fd1\u7684\u51e0\u6761\u6307\u4ee4\uff0c\u5f53\u524d\u8bbf\u95ee\u7684\u6570\u636e\u548c\u90bb\u8fd1\u7684\u6570\u636e\u90fd\u96c6\u4e2d\u5728\u4e00\u4e2a\u8f83\u5c0f\u533a\u57df\u5185\u3002<\/li>\n<\/ul>\n<p><span style=\"color: #ff99cc;\">\u865a\u62df\u5b58\u50a8\u5668<\/span>\u662f\u5177\u6709\u8bf7\u6c42\u8c03\u5165\u529f\u80fd\u548c\u7f6e\u6362\u529f\u80fd\uff0c\u80fd\u4ec5\u628a\u8fdb\u7a0b\u7684\u4e00\u90e8\u5206\u88c5\u5165\u5185\u5b58\u4fbf \u53ef\u8fd0\u884c\u8fdb\u7a0b\u7684\u5b58\u50a8\u7ba1\u7406\u7cfb\u7edf\uff0c\u5b83\u80fd\u4ece\u903b\u8f91\u4e0a\u5bf9\u5185\u5b58\u5bb9\u91cf\u8fdb\u884c\u6269\u5145\u7684\u4e00\u79cd\u865a\u62df\u7684\u5b58\u50a8\u5668\u7cfb\u7edf\u3002<\/p>\n<p>Demand Paging \u8bf7\u6c42\u8c03\u9875\uff1a<\/p>\n<p>\u9875\u8868\u9879\uff1a<\/p>\n<table>\n<tbody>\n<tr>\n<td>\u7269\u7406\u5757\u53f7<\/td>\n<td>\u72b6\u6001\u4f4dP<\/td>\n<td>\u8bbf\u95ee\u5b57\u6bb5A<\/td>\n<td>\u4fee\u6539\u4f4dM<\/td>\n<td>\u5916\u5b58\u5730\u5740<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>\u8868\u793a\u8be5\u9875\u662f\u5426\u5df2\u88ab\u8c03\u5165\u5185\u5b58\uff0c\u4f9b\u7a0b\u5e8f\u8bbf\u95ee\u65f6\u53c2\u8003\u3002<\/td>\n<td>\u53ef\u8bb0\u5f55\u6700\u8fd1\u88ab\u8bbf\u95ee\u7684\u6b21\u6570\u3001\u4e0a\u6b21\u8bbf\u95ee\u7684\u65f6\u95f4\uff0c\u4f9b\u7f6e\u6362\u7b97\u6cd5\u9009\u62e9\u6362\u51fa\u9875\u9762\u65f6\u53c2\u8003\u3002<\/td>\n<td>\u9875\u9762\u5728\u8c03\u5165\u5185\u5b58\u540e\u662f\u5426\u4fee\u6539\u8fc7<\/td>\n<td>\u9875\u9762\u5728\u5916\u5b58\u4e2d\u5b58\u653e\u7684\u4f4d\u7f6e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>Page fault \u7f3a\u9875\u4e2d\u65ad<\/p>\n<p>\u9875\u9762\u4e0d\u5728\u5185\u5b58\u65f6\uff0c\u4ea7\u751f\u7f3a\u9875\u4e2d\u65ad\uff0c\u7f3a\u9875\u8fdb\u7a0b\u963b\u585e\uff0c\u8fdb\u5165<span style=\"color: #ff99cc;\">\u963b\u585e\u961f\u5217<\/span>\uff0c\u8c03\u9875\u5b8c\u6210\u540e\u518d\u5c06\u5176\u5524\u9192\uff0c\u653e\u56de<span style=\"color: #ff99cc;\">\u5c31\u7eea\u961f\u5217<\/span>\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<td>\u5185\u5b58\u6709\u7a7a\u95f2\u5757<\/td>\n<td>\u5185\u5b58\u6ca1\u6709\u7a7a\u95f2\u5757<\/td>\n<\/tr>\n<tr>\n<td>\u4e3a\u8fdb\u7a0b\u5206\u914d\u4e00\u4e2a\u7a7a\u95f2\u5757\uff0c\u5c06\u6240\u7f3a\u9875\u9762\u88c5\u5165\u8be5\u5757\uff0c\u5e76\u4fee\u6539\u9875\u8868\u4e2d\u76f8\u5e94\u7684\u9875\u8868\u9879\u3002<\/td>\n<td>\u7531\u9875\u9762\u7f6e\u6362\u7b97\u6cd5\u9009\u62e9\u4e00\u4e2a\u9875\u9762\u6dd8\u6c70\uff0c\u82e5\u8be5\u9875\u9762\u5728\u5185\u5b58\u671f\u95f4\u88ab\u4fee\u6539\u8fc7\uff0c\u5219\u8981\u5c06\u5176<span style=\"color: #ff99cc;\">\u5199\u56de\u5916\u5b58<\/span>\u3002\u672a\u4fee\u6539\u8fc7\u7684\u4e0d\u7528\u5199\u56de\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6362\u5165\u6362\u51fa\u5916\u5b58\u9700\u8981\u8fdb\u884c\u6162\u901fI\/O\u64cd\u4f5c\uff0c\u6362\u5165\u5185\u5b58\u7684\u9875\u9762\u8868\u9879\u4f1a\u76f4\u63a5\u52a0\u5165\u5feb\u8868\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u7f3a\u9875\u7387 page fault rate = p ~[0,1]<\/p>\n<p>\u6709\u6548\u8bbf\u5b58\u65f6\u95f4 <span style=\"color: #ff99cc;\">effective memory-access time<\/span> = (1 \u2013 p) x physical-memory-access + p x ( page-fault-overhead + swap-page-out + swap-page-in + restart-overhead )<\/p>\n<p>Three major components of the page-fault service time<\/p>\n<ul>\n<li>Service the page-fault interrupt(\u7f3a\u9875\u4e2d\u65ad\u670d\u52a1\u65f6\u95f4)<\/li>\n<li>Read in the page(\u5c06\u7f3a\u9875\u8bfb\u5165\u65f6\u95f4)<\/li>\n<li>Restart the process(\u91cd\u65b0\u542f\u52a8\u8fdb\u7a0b\u65f6\u95f4)<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>\u5199\u65f6\u62f7\u8d1d\u00a0Copy-on-Write<\/p>\n<p>\u7236\u8fdb\u7a0b\u548c\u5b50\u8fdb\u7a0b\u5171\u4eab\u4e00\u4e2a\u9875\u9762\uff0c\u5728\u9700\u8981\u8fdb\u884c\u5199\u64cd\u4f5c\u65f6\u590d\u5236\u8fd9\u4e2a\u5171\u4eab\u9875\uff0c\u800c\u4e0d\u662f\u76f4\u63a5\u5728\u7236\u8fdb\u7a0b\u7684\u9875\u9762\u4e0a\u8fdb\u884c\u4fee\u6539\u3002eg\uff1a Windows\u3001Linux\u3001Solaris<\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"font-size: 20px;\">\u9875\u9762\u7f6e\u6362\u7b97\u6cd5<\/span><\/strong><\/p>\n<p><strong>\u6700\u4f73\u7f6e\u6362\u7b97\u6cd5 OPT\u00a0<\/strong><\/p>\n<p>\u6bcf\u6b21\u9009\u62e9\u6dd8\u6c70\u7684\u9875\u9762\u5c06\u662f<span style=\"color: #ff99cc;\">\u4ee5\u540e\u6c38\u4e0d\u4f7f\u7528<\/span>\uff0c\u6216\u662f<span style=\"color: #ff99cc;\">\u5728\u6700\u957f\u65f6\u95f4\u5185\u4e0d\u518d\u88ab\u8bbf\u95ee\u7684\u9875\u9762<\/span>\uff0c\u8fd9\u6837\u53ef\u4ee5\u4fdd\u8bc1\u6700\u4f4e\u7684\u7f3a\u9875\u7387\u3002<\/p>\n<p>\u9700\u8981\u77e5\u9053\u4e4b\u540e\u8981\u4f9d\u6b21\u8bbf\u95ee\u7684\u9875\u9762\u5e8f\u5217\uff0c\u56e0\u6b64\uff0c\u6700\u4f73\u7f6e\u6362\u7b97\u6cd5\u662f\u65e0\u6cd5\u5b9e\u73b0\u7684\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u5148\u8fdb\u5148\u51fa\u7f6e\u6362\u7b97\u6cd5 FIFO<\/strong><\/p>\n<p>\u6bcf\u6b21\u9009\u62e9\u6dd8\u6c70\u7684\u9875\u9762\u662f<span style=\"color: #ff99cc;\">\u6700\u65e9\u8fdb\u5165\u5185\u5b58\u7684\u9875\u9762<\/span>\u3002<\/p>\n<p>Belady\u5f02\u5e38\uff1a\u5f53\u4e3a\u8fdb\u7a0b\u5206\u914d\u7269\u7406\u5757\u6570\u589e\u5927\u65f6\uff0c\u7f3a\u9875\u6b21\u6570\u4e0d\u51cf\u53cd\u589e\u7684\u5f02\u5e38\u73b0\u8c61\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u6700\u8fd1\u6700\u5c11\u4f7f\u7528\u7b97\u6cd5 LRU<\/strong><\/p>\n<p>\u6bcf\u6b21\u6dd8\u6c70\u7684\u9875\u9762\u662f<span style=\"color: #ff99cc;\">\u6700\u8fd1\u6700\u4e45\u672a\u4f7f\u7528\u7684\u9875\u9762<\/span>\u3002<\/p>\n<p>\u5b9e\u73b0\u65b9\u6cd5\uff1a<\/p>\n<ul>\n<li>Conter \u5728\u9875\u9762\u6761\u76ee\u4e0a\uff0c\u6bcf\u6b21\u5f15\u7528\u65f6\u66f4\u65b0\/\u590d\u5236\u65f6\u949f\u65f6\u95f4\u3002<\/li>\n<li>Stack \u6309\u8bbf\u95ee\u987a\u5e8f\u5165\u6808\uff0c\u957f\u65f6\u95f4\u672a\u8bbf\u95ee\u7684\u5728\u6808\u4f4e\uff0c\u5c06\u6808\u4f4e\u7684\u7f6e\u6362\u51fa\u53bb\u3002<\/li>\n<\/ul>\n<p>\u7531\u4e8e\u9700\u8981\u8bb0\u5f55\u9875\u9762\u4f7f\u7528\u65f6\u95f4\uff0c<span style=\"color: #ff99cc;\">\u786c\u4ef6\u5f00\u9500\u592a\u5927<\/span>\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u8fd1\u4f3cLRU\u7b97\u6cd5 LRUA<\/strong><\/p>\n<p>reference bit \u5f15\u7528\u4f4d\u521d\u59cb\u4e3a0\uff0c\u5f53\u88ab\u8bbf\u95ee\u65f6\uff0c\u7f6e1\u3002<\/p>\n<p>1.\u9644\u52a0\u5f15\u7528\u4f4d\u7b97\u6cd5<\/p>\n<p>\u88ab\u8bbf\u95ee\u65f6\u5de6\u8fb9\u6700\u9ad8\u4f4d\u7f6e1\uff0c\u5b9a\u671f\u53f3\u79fb\u5e76\u4e14\u6700\u9ad8\u4f4d\u88650\uff0c\u4e8e\u662f\u5bc4\u5b58\u5668\u6570\u503c\u6700\u5c0f\u7684\u662f\u6700\u4e45\u672a\u4f7f\u7528\u9875\u9762\u3002<\/p>\n<p>2.\u7b2c\u4e8c\u6b21\u673a\u4f1a\u7b97\u6cd5\/Clock\u7b97\u6cd5<\/p>\n<p>\u5982\u679c\u8bbf\u95ee\u4f4d\u4e3a0\uff0c\u8868\u793a\u5f88\u957f\u65f6\u95f4\u672a\u88ab\u4f7f\u7528\uff0c\u8bbf\u95ee\u4f4d\u4e3a1\uff0c\u8868\u793a\u6700\u8fd1\u8bbf\u95ee\u8fc7\u3002<\/p>\n<p>\u9700\u8981\u9009\u62e9\u66f4\u6362\u65f6\uff0c\u5982\u679c\u4e3a0\uff0c\u5219\u6362\u51fa\uff1b\u82e5\u4e0d\u4e3a0\uff0c\u5219\u7f6e0\uff0c\u5f80\u540e\u68c0\u67e5\u3002<\/p>\n<p>\u5f53\u5168\u90e8\u4e3a1\u65f6\uff0c\u5219\u4f9d\u6b21\u7f6e0\uff0c\u518d\u8fdb\u884c\u7b2c\u4e8c\u8f6e\u626b\u63cf\u3002<\/p>\n<p>3.\u589e\u5f3a\u4e8c\u6b21\u673a\u4f1a\u7b97\u6cd5 Enhanced Second-Chance<\/p>\n<p>\u4f7f\u7528\u5f15\u7528\u4f4d\u548c\u4fee\u6539\u4f4d\uff1a\u5f15\u7528\u8fc7\u6216\u4fee\u6539\u8fc7\u7f6e\u62101<\/p>\n<ul>\n<li>(Reference bit, modified bit) \uff1a<\/li>\n<li>(0,0): best page to replace<\/li>\n<li>(0,1): not quite good for replacement<\/li>\n<li>(1,0): will be used soon<\/li>\n<li>(1,1): worst page to replace.<\/li>\n<li>\u6dd8\u6c70\u6b21\u5e8f\uff1a(0,0)-&gt;(0,1)-&gt;(1,0)-&gt;(1,1)<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: 16px;\"><strong>\u57fa\u4e8e\u8ba1\u6570\u7684\u9875\u7f6e\u6362 Counting Algorithm<\/strong><\/span><\/p>\n<p><strong>\u6700\u4e0d\u7ecf\u5e38\u4f7f\u7528\u7b97\u6cd5 LFU<\/strong><\/p>\n<p><strong>\u7ecf\u5e38\u4f7f\u7528\u7b97\u6cd5 MFU<\/strong>\u00a0\u57fa\u4e8e\u8fd9\u6837\u4e00\u79cd\u89c2\u70b9\uff0c\u5373\u8ba1\u6570\u6700\u5c0f\u7684\u9875\u9762\u53ef\u80fd\u662f\u521a\u521a\u5f15\u5165\u7684\uff0c\u5c1a\u672a\u4f7f\u7528\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u9875\u9762\u7f13\u51b2\u7b97\u6cd5<\/strong><\/p>\n<p>\u901a\u8fc7\u88ab\u7f6e\u6362\u9875\u9762\u7684\u7f13\u51b2\uff0c\u6709\u673a\u4f1a\u627e\u56de\u521a\u88ab\u7f6e\u6362\u7684\u9875\u9762<\/p>\n<ul>\n<li>\u88ab\u7f6e\u6362\u9875\u9762\u7684\u9009\u62e9\u548c\u5904\u7406\uff1a\u7528FIFO\u7b97\u6cd5\u9009\u62e9\u88ab\u7f6e\u6362\u9875\uff0c\u628a\u88ab\u7f6e\u6362\u7684\u9875\u9762\u653e\u5165\u4e24\u4e2a\u94fe\u8868\u4e4b\u4e00 \u3002\u5373\uff1a\u5982\u679c\u9875\u9762\u672a\u88ab\u4fee\u6539\uff0c\u5c31\u5c06\u5176\u5f52\u5165\u5230<span style=\"color: #ff99cc;\">\u7a7a\u95f2\u9875\u9762\u94fe\u8868<\/span>\u7684\u672b\u5c3e\uff0c\u5426\u5219\u5c06\u5176\u5f52\u5165\u5230<span style=\"color: #ff99cc;\">\u5df2\u4fee\u6539\u9875\u9762\u94fe\u8868<\/span>\u3002<\/li>\n<li>\u9700\u8981\u8c03\u5165\u65b0\u7684\u9875\u9762\u65f6\uff0c\u5c06\u65b0\u9875\u9762\u5185\u5bb9\u8bfb\u5165\u5230\u7a7a\u95f2\u9875\u9762\u94fe\u8868\u7684\u7b2c\u4e00\u9879\u6240\u6307\u7684\u9875\u9762\uff0c\u7136\u540e\u5c06\u7b2c \u4e00\u9879\u5220\u9664\u3002<\/li>\n<li>\u7a7a\u95f2\u9875\u9762\u548c\u5df2\u4fee\u6539\u9875\u9762\uff0c\u4ecd\u505c\u7559\u5728\u5185\u5b58\u4e2d\u4e00\u6bb5\u65f6\u95f4\uff0c\u5982\u679c\u8fd9\u4e9b\u9875\u9762\u88ab\u518d\u6b21\u8bbf\u95ee\uff0c\u8fd9\u4e9b\u9875\u9762 \u8fd8\u5728\u5185\u5b58\u4e2d\u3002<\/li>\n<li>\u5f53\u5df2\u4fee\u6539\u9875\u9762\u8fbe\u5230\u4e00\u5b9a\u6570\u76ee\u540e\uff0c\u518d\u5c06\u5b83\u4eec\u4e00\u8d77\u8c03\u51fa\u5230\u5916\u5b58\uff0c\u7136\u540e\u5c06\u5b83\u4eec\u5f52\u5165\u7a7a\u95f2\u9875\u9762\u94fe\u8868 \u3002<\/li>\n<li>VAX\/VMS\u7cfb\u7edf\u4f7f\u7528 \uff0c Windows\u3001Linux\u9875\u9762\u7f6e\u6362\u7b97\u6cd5\u662f\u57fa\u4e8e\u9875\u9762\u7f13\u51b2\u7b97\u6cd5\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"font-size: 24px;\">\u5e27\u5206\u914d Allocation of Frames<\/span><\/strong><\/p>\n<p><span style=\"font-size: 20px;\"><strong>Fixed Allocation \u56fa\u5b9a\u5206\u914d<\/strong><\/span><\/p>\n<p>Equal allocation \u5e73\u5747\u5206\u914d\u7b97\u6cd5 \uff1a\u628a\u5e27\u5e73\u5747\u5206\u914d\u7ed9\u6bcf\u4e2a\u8fdb\u7a0b<\/p>\n<p>Proportional allocation \u6309\u6bd4\u4f8b\u5206\u914d\u7b97\u6cd5 \uff1aAllocate according to the size of process<\/p>\n<p><span style=\"font-size: 20px;\"><strong>Priority Allocation \u4f18\u5148\u7ea7\u5206\u914d<\/strong><\/span><\/p>\n<p>\u7f6e\u6362\u7b56\u7565\uff1a<\/p>\n<ul>\n<li>Global replacement\uff08\u5168\u5c40\u7f6e\u6362\uff09 \u2013 process selects a replacement frame from the set of all frames; one process can take a frame from another<\/li>\n<li>Local replacement \uff08\u5c40\u90e8\u7f6e\u6362\uff09\u2013 each process selects from only its own set of allocated frames<\/li>\n<\/ul>\n<p>\u5206\u914d\u7b56\u7565\uff1a<\/p>\n<ul>\n<li>\u56fa\u5b9a\u5206\u914d<\/li>\n<li>\u53ef\u53d8\u5206\u914d<\/li>\n<\/ul>\n<p>\u7ec4\u5408\u6210\u4e09\u79cd\u7b56\u7565\uff1a<\/p>\n<ul>\n<li>\u56fa\u5b9a\u5206\u914d\u5c40\u90e8\u7f6e\u6362\u7b56\u7565<\/li>\n<li>\u53ef\u53d8\u5206\u914d\u5168\u5c40\u7f6e\u6362\u7b56\u7565<\/li>\n<li>\u53ef\u53d8\u5206\u914d\u5c40\u90e8\u7f6e\u6362<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"font-size: 24px;\">\u7cfb\u7edf\u98a0\u7c38\/\u6296\u52a8<\/span><\/strong><\/p>\n<p>a process is busy swapping pages in and out \u7cfb\u7edf\u5fd9\u4e8e\u6362\u9875<\/p>\n<p>\u539f\u56e0\uff1a\u8fdb\u7a0b\u9891\u7e41\u8bbf\u95ee\u7684\u9875\u9762\u6570\u76ee\u9ad8\u4e8e\u53ef\u7528\u7684\u7269\u7406\u5757\u6570\u3002<\/p>\n<p>Working-set Model \u5de5\u4f5c\u96c6\u6a21\u578b\uff1a<\/p>\n<ul>\n<li>working set (WS)\u5de5\u4f5c\u96c6\uff1aThe set of pages in the most recent \u0394 page references<\/li>\n<li>\u0394 = working-set window(\u5de5\u4f5c\u96c6\u7a97\u53e3) = a fixed number of page references Example: 10,000 instruction<\/li>\n<li>WSSi (working set size of Process Pi \u5de5\u4f5c\u96c6\u5927\u5c0f) = total number of pages referenced in the most recent\u0394 (varies in time)\n<ul>\n<li>if \u0394 too small will not encompass entire locality.<\/li>\n<li>if \u0394 too large will encompass several localities.<\/li>\n<li>if\u00a0\u0394 = \u221e -&gt;will encompass entire program.<\/li>\n<\/ul>\n<\/li>\n<li>D =\u00a0\u03a3 WSSi = total demand frames; m = total available frames<\/li>\n<li>if D &gt; m -&gt; Thrashing<\/li>\n<li>Policy if D &gt; m, then suspend one of the processes<\/li>\n<\/ul>\n<p>\u7edf\u8ba1\u7f3a\u9875\u9891\u7387 Page-fault frequency PFF<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f18\u70b9 \u7f3a\u70b9 \u5206\u9875\u7ba1\u7406 \u5185\u5b58\u5229\u7528\u7387\u9ad8\uff0c\u4e0d\u4f1a\u4ea7\u751f\u5916\u90e8\u788e\u7247\uff0c\u53ea\u4f1a\u6709\u5c11\u91cf\u7684\u9875\u5185\u788e\u7247\u3002 \u4e0d\u65b9\u4fbf\u6309\u7167\u903b\u8f91\u6a21\u5757\u5b9e\u73b0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,20],"tags":[],"_links":{"self":[{"href":"http:\/\/www.magicmipamipa.com\/index.php?rest_route=\/wp\/v2\/posts\/1041"}],"collection":[{"href":"http:\/\/www.magicmipamipa.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.magicmipamipa.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.magicmipamipa.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.magicmipamipa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1041"}],"version-history":[{"count":1,"href":"http:\/\/www.magicmipamipa.com\/index.php?rest_route=\/wp\/v2\/posts\/1041\/revisions"}],"predecessor-version":[{"id":1042,"href":"http:\/\/www.magicmipamipa.com\/index.php?rest_route=\/wp\/v2\/posts\/1041\/revisions\/1042"}],"wp:attachment":[{"href":"http:\/\/www.magicmipamipa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.magicmipamipa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1041"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.magicmipamipa.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}