{"id":1384,"date":"2023-10-19T09:12:05","date_gmt":"2023-10-19T01:12:05","guid":{"rendered":"https:\/\/airy.cn\/WordPress\/?p=1384"},"modified":"2023-10-19T09:12:05","modified_gmt":"2023-10-19T01:12:05","slug":"linux%e4%b8%8ewindows%e7%9a%84%e8%bf%9b%e7%a8%8b%e8%b0%83%e5%ba%a6%e6%9c%89%e4%bd%95%e5%8c%ba%e5%88%ab%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/airy.cn\/WordPress\/?p=1384","title":{"rendered":"Linux\u4e0eWindows\u7684\u8fdb\u7a0b\u8c03\u5ea6\u6709\u4f55\u533a\u522b\uff1f"},"content":{"rendered":"\n<p>Windows\u4f3c\u4e4e\u662f\u4ee5\u7ebf\u7a0b\u4e3a\u5355\u4f4d\u8fdb\u884c\u8c03\u5ea6\u7684\uff0cLinux\u4ee5\u8fdb\u7a0b\u4e3a\u5355\u4f4d\u3002\u4e24\u8005\u6709\u4f55\u533a\u522b\uff1f\u5728\u666e\u901a\u7528\u6237\u624b\u4e2d\uff0c\u54ea\u79cd\u53ef\u80fd\u66f4\u6709\u4f18\u52bf\uff1f\u6307\u5305\u62ec\u6d41\u7545\uff0c\u7a33\u5b9a\u6027\uff0c\u590d\u6742\u5ea6\u7b49+<\/p>\n\n\n\n<p><strong>\u8bf4\u660e\uff1a<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Kernel\u7248\u672c\uff1a4.14<\/li>\n\n\n\n<li>ARM64\u5904\u7406\u5668\uff0cContex-A53\uff0c\u53cc\u6838<\/li>\n\n\n\n<li>\u4f7f\u7528\u5de5\u5177\uff1aSource Insight 3.5\uff0c Visio<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">1. \u6982\u5ff5<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">1.1 \u8fdb\u7a0b<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"345\" src=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-1.webp\" alt=\"\" class=\"wp-image-1387\" srcset=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-1.webp 720w, https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-1-300x144.webp 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4ece<a href=\"https:\/\/www.zhihu.com\/search?q=%E6%95%99%E7%A7%91%E4%B9%A6&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u6559\u79d1\u4e66<\/a>\u4e0a\uff0c\u6211\u4eec\u90fd\u80fd\u77e5\u9053\uff1a\u8fdb\u7a0b\u662f\u8d44\u6e90\u5206\u914d\u7684\u6700\u5c0f\u5355\u4f4d\uff0c\u800c\u7ebf\u7a0b\u662fCPU\u8c03\u5ea6\u7684\u7684\u6700\u5c0f\u5355\u4f4d\u3002<\/li>\n\n\n\n<li>\u8fdb\u7a0b\u4e0d\u4ec5\u5305\u62ec\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4ee3\u7801\u6bb5\uff0c\u8fd8\u5305\u62ec\u4e00\u7cfb\u5217\u7684\u8d44\u6e90\uff0c\u6bd4\u5982\uff1a\u6253\u5f00\u7684\u6587\u4ef6\u3001\u5185\u5b58\u3001CPU\u65f6\u95f4\u3001\u4fe1\u53f7\u91cf\u3001\u591a\u4e2a<a href=\"https:\/\/www.zhihu.com\/search?q=%E6%89%A7%E8%A1%8C%E7%BA%BF%E7%A8%8B%E6%B5%81&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u6267\u884c\u7ebf\u7a0b\u6d41<\/a>\u7b49\u7b49\u3002\u800c\u7ebf\u7a0b\u53ef\u4ee5\u5171\u4eab\u8fdb\u7a0b\u5185\u7684\u8d44\u6e90\u7a7a\u95f4\u3002<\/li>\n\n\n\n<li>\u5728Linux\u5185\u6838\u4e2d\uff0c\u8fdb\u7a0b\u548c\u7ebf\u7a0b\u90fd\u4f7f\u7528struct task_struct\u7ed3\u6784\u6765\u8fdb\u884c\u62bd\u8c61\u63cf\u8ff0\u3002<\/li>\n\n\n\n<li>\u8fdb\u7a0b\u7684<a href=\"https:\/\/www.zhihu.com\/search?q=%E8%99%9A%E6%8B%9F%E5%9C%B0%E5%9D%80&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u865a\u62df\u5730\u5740<\/a>\u7a7a\u95f4\u5206\u4e3a<a href=\"https:\/\/www.zhihu.com\/search?q=%E7%94%A8%E6%88%B7%E8%99%9A%E6%8B%9F%E5%9C%B0%E5%9D%80%E7%A9%BA%E9%97%B4&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u7528\u6237\u865a\u62df\u5730\u5740\u7a7a\u95f4<\/a>\u548c\u5185\u6838\u865a\u62df\u5730\u5740\u7a7a\u95f4\uff0c\u6240\u6709\u8fdb\u7a0b\u5171\u4eab\u5185\u6838\u865a\u62df\u5730\u5740\u7a7a\u95f4\uff0c\u6ca1\u6709\u7528\u6237\u865a\u62df\u5730\u5740\u7a7a\u95f4\u7684\u8fdb\u7a0b\u79f0\u4e3a<a href=\"https:\/\/www.zhihu.com\/search?q=%E5%86%85%E6%A0%B8%E7%BA%BF%E7%A8%8B&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u5185\u6838\u7ebf\u7a0b<\/a>\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u597d\u6587\u63a8\u8350\uff1a<\/strong><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/zhuanlan.zhihu.com\/p\/522038503\">\u5b57\u8282\u7ec8\u9762\uff1aCPU \u662f\u5982\u4f55\u8bfb\u5199\u5185\u5b58\u7684\uff1f<\/a><\/strong><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/zhuanlan.zhihu.com\/p\/472840233\">\u5168\u7f51\u6700\u725bLinux\u5185\u6838\u5206\u6790&#8211;Intel CPU\u4f53\u7cfb\u7ed3\u6784<\/a><\/strong><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/zhuanlan.zhihu.com\/p\/474337723\">\u4e00\u6587\u8ba9\u4f60\u8bfb\u61c2Linux\u4e94\u5927\u6a21\u5757\u5185\u6838\u6e90\u7801\uff0c\u5185\u6838\u6574\u4f53\u67b6\u6784\u8bbe\u8ba1\uff08\u8d85\u8be6\u7ec6\uff09<\/a><\/strong><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/zhuanlan.zhihu.com\/p\/481425267\">\u5d4c\u5165\u5f0f\u524d\u666f\u771f\u7684\u597d\u5417\uff1f\u90a3\u6709\u70b9\u60ac\uff01<\/a><\/strong><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/zhuanlan.zhihu.com\/p\/478762354\">\u4e00\u6587\u6559\u4f60\u5982\u4f55\u4f7f\u7528GDB+Qemu\u8c03\u8bd5Linux\u5185\u6838<\/a><\/strong><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/zhuanlan.zhihu.com\/p\/472962137\">Linux\u5185\u6838\u5fc5\u8bfb\u4e94\u672c\u4e66\u7c4d(\u5f3a\u70c8\u63a8\u8350)<\/a><\/strong><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/zhuanlan.zhihu.com\/p\/490198354\">\u5168\u7f51\u72ec\u4e00\u65e0\u4e8cLinux\u5185\u6838Makefle\u7cfb\u7edf\u6587\u4ef6\u8be6\u89e3\uff08\u4e00\uff09(\u7eaf\u6587\u5b57\u4ee3\u7801)<\/a><\/strong><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/zhuanlan.zhihu.com\/p\/489733923\">\u5e26\u4f60\u6df1\u5ea6\u4e86\u89e3Linux\u5185\u6838\u67b6\u6784\u548c\u5de5\u4f5c\u539f\u7406\uff01<\/a><\/strong><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/zhuanlan.zhihu.com\/p\/492380529\">\u5982\u4f55\u8bfb\u61c2GDB\u5e95\u5c42\u5b9e\u73b0\u539f\u7406\uff08\u4ece\u8fd9\u51e0\u70b9\u5165\u624b~\uff09<\/a><\/strong><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/zhuanlan.zhihu.com\/p\/491567798\">\u4e00\u6587\u5f7b\u5e95\u7406\u89e3Memory barrier\uff08\u5185\u5b58\u5c4f\u969c\uff09<\/a><\/strong><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/zhuanlan.zhihu.com\/p\/491457649\">\u4e00\u7bc7\u6587\u5e26\u4f60\u641e\u61c2\uff0c\u865a\u62df\u5185\u5b58\u3001\u5185\u5b58\u5206\u9875\u3001\u5206\u6bb5\u3001\u6bb5\u9875\u5f0f\u5185\u5b58\u7ba1\u7406\uff08\u8d85\u8be6\u7ec6\uff09<\/a><\/strong><\/p>\n\n\n\n<p>Linux\u5185\u6838\u4f7f\u7528task_struct\u7ed3\u6784\u6765\u62bd\u8c61\uff0c\u8be5\u7ed3\u6784\u5305\u542b\u4e86\u8fdb\u7a0b\u7684\u5404\u7c7b\u4fe1\u606f\u53ca\u6240\u62e5\u6709\u7684\u8d44\u6e90\uff0c\u6bd4\u5982\u8fdb\u7a0b\u7684\u72b6\u6001\u3001\u6253\u5f00\u7684\u6587\u4ef6\u3001\u5730\u5740\u7a7a\u95f4\u4fe1\u606f\u3001\u4fe1\u53f7\u8d44\u6e90\u7b49\u7b49\u3002<a href=\"https:\/\/www.zhihu.com\/search?q=task_struct&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">task_struct<\/a>\u7ed3\u6784\u5f88\u590d\u6742\uff0c\u4e0b\u8fb9\u53ea\u9488\u5bf9\u4e0e\u8c03\u5ea6\u76f8\u5173\u7684\u67d0\u4e9b\u5b57\u6bb5\u8fdb\u884c\u4ecb\u7ecd\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>struct task_struct {\n    \/* ... *\/\n  \n    \/* <a href=\"https:\/\/www.zhihu.com\/search?q=%E8%BF%9B%E7%A8%8B%E7%8A%B6%E6%80%81&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u8fdb\u7a0b\u72b6\u6001<\/a> *\/\n    volatile long\t\t\tstate;\n\n\n    \/* \u8c03\u5ea6\u4f18\u5148\u7ea7\u76f8\u5173\uff0c\u7b56\u7565\u76f8\u5173 *\/\n\tint\t\t\t\tprio;\n\tint\t\t\t\tstatic_prio;\n\tint\t\t\t\tnormal_prio;\n\tunsigned int\t\t\trt_priority;\n    unsigned int\t\t\tpolicy;\n  \n    \/* \u8c03\u5ea6\u7c7b\uff0c\u8c03\u5ea6\u5b9e\u4f53\u76f8\u5173\uff0c\u4efb\u52a1\u7ec4\u76f8\u5173\u7b49 *\/\n    const struct sched_class\t*sched_class;\n\tstruct sched_entity\t\tse;\n\tstruct sched_rt_entity\t\trt;\n#ifdef CONFIG_CGROUP_SCHED\n\tstruct task_group\t\t*sched_task_group;\n#endif\n\tstruct sched_dl_entity\t\tdl;\n  \n    \/* \u8fdb\u7a0b\u4e4b\u95f4\u7684\u5173\u7cfb\u76f8\u5173 *\/\n    \t\/* Real parent process: *\/\n\tstruct task_struct __rcu\t*real_parent;\n\n\n\t\/* Recipient of SIGCHLD, wait4() reports: *\/\n\tstruct task_struct __rcu\t*parent;\n\n\n\t\/*\n\t * Children\/sibling form the list of natural children:\n\t *\/\n\tstruct list_head\t\tchildren;\n\tstruct list_head\t\tsibling;\n\tstruct task_struct\t\t*<a href=\"https:\/\/www.zhihu.com\/search?q=group_leader&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">group_leader<\/a>;\n  \n    \/* ... *\/\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">1.2 \u8fdb\u7a0b\u72b6\u6001<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"316\" src=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-2.webp\" alt=\"\" class=\"wp-image-1385\" srcset=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-2.webp 720w, https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-2-300x132.webp 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e0a\u56fe\u4e2d\u5de6\u4fa7\u4e3a\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u901a\u4fd7\u7684<a href=\"https:\/\/www.zhihu.com\/search?q=%E8%BF%9B%E7%A8%8B%E4%B8%89%E7%8A%B6%E6%80%81%E6%A8%A1%E5%9E%8B&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u8fdb\u7a0b\u4e09\u72b6\u6001\u6a21\u578b<\/a>\uff0c\u53f3\u4fa7\u4e3aLinux\u5bf9\u5e94\u7684\u8fdb\u7a0b\u72b6\u6001\u5207\u6362\u3002\u6bcf\u4e00\u4e2a\u6807\u5fd7\u63cf\u8ff0\u4e86\u8fdb\u7a0b\u7684\u5f53\u524d\u72b6\u6001\uff0c\u8fd9\u4e9b\u72b6\u6001\u90fd\u662f\u4e92\u65a5\u7684\uff1b<\/li>\n\n\n\n<li>Linux\u4e2d\u7684\u5c31\u7eea\u6001\u548c\u8fd0\u884c\u6001\u5bf9\u5e94\u7684\u90fd\u662fTASK_RUNNING\u6807\u5fd7\u4f4d\uff0c\u5c31\u7eea\u6001\u8868\u793a\u8fdb\u7a0b\u6b63\u5904\u5728\u961f\u5217\u4e2d\uff0c\u5c1a\u672a\u88ab\u8c03\u5ea6\uff1b\u8fd0\u884c\u6001\u5219\u8868\u793a\u8fdb\u7a0b\u6b63\u5728CPU\u4e0a\u8fd0\u884c\uff1b<\/li>\n<\/ul>\n\n\n\n<p>\u5185\u6838\u4e2d\u4e3b\u8981\u7684\u72b6\u6001\u5b57\u6bb5\u5b9a\u4e49\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/* Used in tsk-&gt;state: *\/\n#define TASK_RUNNING\t\t\t0x0000\n#define TASK_INTERRUPTIBLE\t\t0x0001\n#define TASK_UNINTERRUPTIBLE\t\t0x0002\n\n\n\/* Used in tsk-&gt;exit_state: *\/\n#define EXIT_DEAD\t\t\t0x0010\n#define EXIT_ZOMBIE\t\t\t0x0020\n#define EXIT_TRACE\t\t\t(EXIT_ZOMBIE | EXIT_DEAD)\n\n\n\/* Used in tsk-&gt;state again: *\/\n#define TASK_PARKED\t\t\t0x0040\n#define TASK_DEAD\t\t\t0x0080\n#define TASK_WAKEKILL\t\t\t0x0100\n#define TASK_WAKING\t\t\t0x0200\n#define TASK_NOLOAD\t\t\t0x0400\n#define TASK_NEW\t\t\t0x0800\n#define TASK_STATE_MAX\t\t\t0x1000\n\n\n\/* Convenience macros for the sake of set_<a href=\"https:\/\/www.zhihu.com\/search?q=current_state&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">current_state<\/a>: *\/\n#define TASK_KILLABLE\t\t\t(TASK_WAKEKILL | TASK_UNINTERRUPTIBLE)\n#define TASK_STOPPED\t\t\t(TASK_WAKEKILL | __TASK_STOPPED)\n#<a href=\"https:\/\/www.zhihu.com\/search?q=define&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">define<\/a> TASK_TRACED\t\t\t(TASK_WAKEKILL | __TASK_TRACED)\n\n\n#define TASK_IDLE\t\t\t(TASK_UNINTERRUPTIBLE | TASK_NOLOAD)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">1.3 scheduler \u8c03\u5ea6\u5668<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"389\" src=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-4.webp\" alt=\"\" class=\"wp-image-1388\" srcset=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-4.webp 720w, https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-4-300x162.webp 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6240\u8c13\u8c03\u5ea6\uff0c\u5c31\u662f\u6309\u7167\u67d0\u79cd\u8c03\u5ea6\u7684\u7b97\u6cd5\uff0c\u4ece\u8fdb\u7a0b\u7684\u5c31\u7eea\u961f\u5217\u4e2d\u9009\u53d6\u8fdb\u7a0b\u5206\u914dCPU\uff0c\u4e3b\u8981\u662f\u534f\u8c03\u5bf9CPU\u7b49\u7684\u8d44\u6e90\u4f7f\u7528\u3002\u8fdb\u7a0b\u8c03\u5ea6\u7684\u76ee\u6807\u662f\u6700\u5927\u9650\u5ea6\u5229\u7528CPU\u65f6\u95f4\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u5185\u6838\u9ed8\u8ba4\u63d0\u4f9b\u4e865\u4e2a\u8c03\u5ea6\u5668\uff0cLinux\u5185\u6838\u4f7f\u7528struct sched_class\u6765\u5bf9\u8c03\u5ea6\u5668\u8fdb\u884c\u62bd\u8c61\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Stop\u8c03\u5ea6\u5668\uff0c stop_sched_class\uff1a\u4f18\u5148\u7ea7\u6700\u9ad8\u7684\u8c03\u5ea6\u7c7b\uff0c\u53ef\u4ee5\u62a2\u5360\u5176\u4ed6\u6240\u6709\u8fdb\u7a0b\uff0c\u4e0d\u80fd\u88ab\u5176\u4ed6\u8fdb\u7a0b\u62a2\u5360\uff1b<\/li>\n\n\n\n<li>Deadline\u8c03\u5ea6\u5668\uff0c dl_sched_class\uff1a\u4f7f\u7528<a href=\"https:\/\/www.zhihu.com\/search?q=%E7%BA%A2%E9%BB%91%E6%A0%91&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u7ea2\u9ed1\u6811<\/a>\uff0c\u628a\u8fdb\u7a0b\u6309\u7167\u7edd\u5bf9\u622a\u6b62\u671f\u9650\u8fdb\u884c\u6392\u5e8f\uff0c\u9009\u62e9\u6700\u5c0f\u8fdb\u7a0b\u8fdb\u884c\u8c03\u5ea6\u8fd0\u884c\uff1b<\/li>\n\n\n\n<li>RT\u8c03\u5ea6\u5668\uff0c&nbsp;<a href=\"https:\/\/www.zhihu.com\/search?q=rt_sched_class&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">rt_sched_class<\/a>\uff1a\u5b9e\u65f6\u8c03\u5ea6\u5668\uff0c\u4e3a\u6bcf\u4e2a\u4f18\u5148\u7ea7\u7ef4\u62a4\u4e00\u4e2a\u961f\u5217\uff1b<\/li>\n\n\n\n<li>CFS\u8c03\u5ea6\u5668\uff0c cfs_sched_class\uff1a<a href=\"https:\/\/www.zhihu.com\/search?q=%E5%AE%8C%E5%85%A8%E5%85%AC%E5%B9%B3%E8%B0%83%E5%BA%A6%E5%99%A8&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u5b8c\u5168\u516c\u5e73\u8c03\u5ea6\u5668<\/a>\uff0c\u91c7\u7528<a href=\"https:\/\/www.zhihu.com\/search?q=%E5%AE%8C%E5%85%A8%E5%85%AC%E5%B9%B3%E8%B0%83%E5%BA%A6%E7%AE%97%E6%B3%95&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u5b8c\u5168\u516c\u5e73\u8c03\u5ea6\u7b97\u6cd5<\/a>\uff0c\u5f15\u5165\u865a\u62df\u8fd0\u884c\u65f6\u95f4\u6982\u5ff5\uff1b<\/li>\n\n\n\n<li>IDLE-Task\u8c03\u5ea6\u5668\uff0c idle_sched_class\uff1a\u7a7a\u95f2\u8c03\u5ea6\u5668\uff0c\u6bcf\u4e2aCPU\u90fd\u4f1a\u6709\u4e00\u4e2a<a href=\"https:\/\/www.zhihu.com\/search?q=idle%E7%BA%BF%E7%A8%8B&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">idle\u7ebf\u7a0b<\/a>\uff0c\u5f53\u6ca1\u6709\u5176\u4ed6\u8fdb\u7a0b\u53ef\u4ee5\u8c03\u5ea6\u65f6\uff0c\u8c03\u5ea6\u8fd0\u884cidle\u7ebf\u7a0b\uff1b<\/li>\n<\/ol>\n\n\n\n<p>Linux\u5185\u6838\u63d0\u4f9b\u4e86\u4e00\u4e9b\u8c03\u5ea6\u7b56\u7565\u4f9b<a href=\"https:\/\/www.zhihu.com\/search?q=%E7%94%A8%E6%88%B7%E7%A8%8B%E5%BA%8F&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u7528\u6237\u7a0b\u5e8f<\/a>\u6765\u9009\u62e9\u8c03\u5ea6\u5668\uff0c\u5176\u4e2dStop\u8c03\u5ea6\u5668\u548cIDLE-Task\u8c03\u5ea6\u5668\uff0c\u4ec5\u7531\u5185\u6838\u4f7f\u7528\uff0c\u7528\u6237\u65e0\u6cd5\u8fdb\u884c\u9009\u62e9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SCHED_DEADLINE\uff1a<a href=\"https:\/\/www.zhihu.com\/search?q=%E9%99%90%E6%9C%9F%E8%BF%9B%E7%A8%8B%E8%B0%83%E5%BA%A6%E7%AD%96%E7%95%A5&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u9650\u671f\u8fdb\u7a0b\u8c03\u5ea6\u7b56\u7565<\/a>\uff0c\u4f7ftask\u9009\u62e9Deadline\u8c03\u5ea6\u5668\u6765\u8c03\u5ea6\u8fd0\u884c\uff1b<\/li>\n\n\n\n<li>SCHED_RR\uff1a\u5b9e\u65f6\u8fdb\u7a0b\u8c03\u5ea6\u7b56\u7565\uff0c<a href=\"https:\/\/www.zhihu.com\/search?q=%E6%97%B6%E9%97%B4%E7%89%87%E8%BD%AE%E8%BD%AC&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u65f6\u95f4\u7247\u8f6e\u8f6c<\/a>\uff0c\u8fdb\u7a0b\u7528\u5b8c\u65f6\u95f4\u7247\u540e\u52a0\u5165\u4f18\u5148\u7ea7\u5bf9\u5e94\u8fd0\u884c\u961f\u5217\u7684\u5c3e\u90e8\uff0c\u628aCPU\u8ba9\u7ed9\u540c\u4f18\u5148\u7ea7\u7684\u5176\u4ed6\u8fdb\u7a0b\uff1b<\/li>\n\n\n\n<li>SCHED_FIFO\uff1a\u5b9e\u65f6\u8fdb\u7a0b\u8c03\u5ea6\u7b56\u7565\uff0c\u5148\u8fdb\u5148\u51fa\u8c03\u5ea6\u6ca1\u6709\u65f6\u95f4\u7247\uff0c\u6ca1\u6709\u66f4\u9ad8\u4f18\u5148\u7ea7\u7684\u60c5\u51b5\u4e0b\uff0c\u53ea\u80fd\u7b49\u5f85\u4e3b\u52a8\u8ba9\u51faCPU\uff1b<\/li>\n\n\n\n<li>SCHED_NORMAL\uff1a\u666e\u901a\u8fdb\u7a0b\u8c03\u5ea6\u7b56\u7565\uff0c\u4f7ftask\u9009\u62e9CFS\u8c03\u5ea6\u5668\u6765\u8c03\u5ea6\u8fd0\u884c\uff1b<\/li>\n\n\n\n<li>SCHED_BATCH\uff1a\u666e\u901a\u8fdb\u7a0b\u8c03\u5ea6\u7b56\u7565\uff0c\u6279\u91cf\u5904\u7406\uff0c\u4f7ftask\u9009\u62e9CFS\u8c03\u5ea6\u5668\u6765\u8c03\u5ea6\u8fd0\u884c\uff1b<\/li>\n\n\n\n<li>SCHED_IDLE\uff1a\u666e\u901a\u8fdb\u7a0b\u8c03\u5ea6\u7b56\u7565\uff0c\u4f7ftask\u4ee5\u6700\u4f4e\u4f18\u5148\u7ea7\u9009\u62e9CFS\u8c03\u5ea6\u5668\u6765\u8c03\u5ea6\u8fd0\u884c\uff1b<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">1.4 runqueue \u8fd0\u884c\u961f\u5217<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"651\" src=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-3.webp\" alt=\"\" class=\"wp-image-1386\" srcset=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-3.webp 720w, https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-3-300x271.webp 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6bcf\u4e2aCPU\u90fd\u6709\u4e00\u4e2a\u8fd0\u884c\u961f\u5217\uff0c\u6bcf\u4e2a\u8c03\u5ea6\u5668\u90fd\u4f5c\u7528\u4e8e\u8fd0\u884c\u961f\u5217\uff1b<\/li>\n\n\n\n<li>\u5206\u914d\u7ed9CPU\u7684task\uff0c\u4f5c\u4e3a\u8c03\u5ea6\u5b9e\u4f53\u52a0\u5165\u5230\u8fd0\u884c\u961f\u5217\u4e2d\uff1b<\/li>\n\n\n\n<li>task\u9996\u6b21\u8fd0\u884c\u65f6\uff0c\u5982\u679c\u53ef\u80fd\uff0c\u5c3d\u91cf\u5c06\u5b83\u52a0\u5165\u5230\u7236task\u6240\u5728\u7684\u8fd0\u884c\u961f\u5217\u4e2d\uff08\u5206\u914d\u7ed9\u76f8\u540c\u7684CPU\uff0c\u7f13\u5b58<a href=\"https:\/\/www.zhihu.com\/search?q=affinity&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">affinity<\/a>\u4f1a\u66f4\u9ad8\uff0c\u6027\u80fd\u4f1a\u6709\u6539\u5584\uff09\uff1b<\/li>\n<\/ul>\n\n\n\n<p>Linux\u5185\u6838\u4f7f\u7528<a href=\"https:\/\/www.zhihu.com\/search?q=struct%20rq&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">struct rq<\/a>\u7ed3\u6784\u6765\u63cf\u8ff0\u8fd0\u884c\u961f\u5217\uff0c\u5173\u952e\u5b57\u6bb5\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/*\n * This is the main, per-CPU runqueue data structure.\n *\n * Locking rule: those places that want to lock multiple <a href=\"https:\/\/www.zhihu.com\/search?q=runqueues&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">runqueues<\/a>\n * (such as the load balancing or the thread migration code), lock\n * acquire operations must be ordered by ascending &amp;runqueue.\n *\/\nstruct rq {\n\t\/* runqueue lock: *\/\n\traw_spinlock_t lock;\n\n\n\t\/*\n\t * nr_running and cpu_load should be in the same cacheline because\n\t * remote CPUs use both these fields when doing load calculation.\n\t *\/\n\tunsigned int nr_running;\n  \n    \/* \u4e09\u4e2a\u8c03\u5ea6\u961f\u5217\uff1aCFS\u8c03\u5ea6\uff0cRT\u8c03\u5ea6\uff0cDL\u8c03\u5ea6 *\/\n\tstruct <a href=\"https:\/\/www.zhihu.com\/search?q=cfs_rq%20cfs&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">cfs_rq cfs<\/a>;\n\tstruct rt_rq rt;\n\tstruct dl_rq dl;\n\n\n    \/* stop\u6307\u5411\u8fc1\u79fb\u5185\u6838\u7ebf\u7a0b\uff0c idle\u6307\u5411<a href=\"https:\/\/www.zhihu.com\/search?q=%E7%A9%BA%E9%97%B2%E5%86%85%E6%A0%B8%E7%BA%BF%E7%A8%8B&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u7a7a\u95f2\u5185\u6838\u7ebf\u7a0b<\/a> *\/\n    struct task_struct *curr, *idle, *stop;\n  \n    \/* ... *\/\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">1.5 task_group \u4efb\u52a1\u5206\u7ec4<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"811\" height=\"273\" src=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-6.webp\" alt=\"\" class=\"wp-image-1390\" srcset=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-6.webp 811w, https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-6-300x101.webp 300w, https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-6-768x259.webp 768w\" sizes=\"auto, (max-width: 811px) 100vw, 811px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5229\u7528\u4efb\u52a1\u5206\u7ec4\u7684\u673a\u5236\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u6216\u9650\u5236\u4efb\u52a1\u7ec4\u5bf9CPU\u7684\u5229\u7528\u7387\uff0c\u6bd4\u5982\u5c06\u67d0\u4e9b\u4efb\u52a1\u9650\u5236\u5728\u67d0\u4e2a\u533a\u95f4\u5185\uff0c\u4ece\u800c\u4e0d\u53bb\u5f71\u54cd\u5176\u4ed6\u4efb\u52a1\u7684\u6267\u884c\u6548\u7387\uff1b<\/li>\n\n\n\n<li>\u5f15\u5165task_group\u540e\uff0c\u8c03\u5ea6\u5668\u7684\u8c03\u5ea6\u5bf9\u8c61\u4e0d\u4ec5\u4ec5\u662f\u8fdb\u7a0b\u4e86\uff0cLinux\u5185\u6838\u62bd\u8c61\u51fa\u4e86sched_entity\/<a href=\"https:\/\/www.zhihu.com\/search?q=sched_rt_entity&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">sched_rt_entity<\/a>\/sched_dl_entity\u63cf\u8ff0\u8c03\u5ea6\u5b9e\u4f53\uff0c\u8c03\u5ea6\u5b9e\u4f53\u53ef\u4ee5\u662f\u8fdb\u7a0b\u6216task_group\uff1b<\/li>\n\n\n\n<li>\u4f7f\u7528<a href=\"https:\/\/www.zhihu.com\/search?q=%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u6570\u636e\u7ed3\u6784<\/a>struct task_group\u6765\u63cf\u8ff0\u4efb\u52a1\u7ec4\uff0c\u4efb\u52a1\u7ec4\u5728\u6bcf\u4e2aCPU\u4e0a\u90fd\u4f1a\u7ef4\u62a4\u4e00\u4e2aCFS\u8c03\u5ea6\u5b9e\u4f53\u3001CFS\u8fd0\u884c\u961f\u5217\uff0cRT\u8c03\u5ea6\u5b9e\u4f53\uff0cRT\u8fd0\u884c\u961f\u5217\uff1b<\/li>\n<\/ul>\n\n\n\n<p>Linux\u5185\u6838\u4f7f\u7528<a href=\"https:\/\/www.zhihu.com\/search?q=struct%20task_group&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">struct task_group<\/a>\u6765\u63cf\u8ff0\u4efb\u52a1\u7ec4\uff0c\u5173\u952e\u7684\u5b57\u6bb5\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/* task group related information *\/\nstruct task_group {\n    \/* ... *\/\n\n\n    \/* \u4e3a\u6bcf\u4e2aCPU\u90fd\u5206\u914d\u4e00\u4e2aCFS\u8c03\u5ea6\u5b9e\u4f53\u548cCFS\u8fd0\u884c\u961f\u5217 *\/\n#ifdef CONFIG_FAIR_GROUP_SCHED\n  \/* schedulable entities of this group on each cpu *\/\n  struct sched_<a href=\"https:\/\/www.zhihu.com\/search?q=entity&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">entity<\/a> **se;\n  \/* runqueue \"owned\" by this group on each cpu *\/\n  struct cfs_rq **cfs_rq;\n  unsigned long shares;\n#endif\n\n\n    \/* \u4e3a\u6bcf\u4e2aCPU\u90fd\u5206\u914d\u4e00\u4e2aRT\u8c03\u5ea6\u5b9e\u4f53\u548cRT\u8fd0\u884c\u961f\u5217 *\/\n#ifdef CONFIG_RT_GROUP_SCHED\n  struct sched_rt_entity **rt_se;\n  struct rt_rq **rt_rq;\n\n\n  struct rt_bandwidth rt_bandwidth;\n#endif\n\n\n    \/* task_group\u4e4b\u95f4\u7684\u7ec4\u7ec7\u5173\u7cfb *\/\n  struct rcu_head rcu;\n  struct list_head list;\n\n\n  struct task_group *parent;\n  struct list_head siblings;\n  struct list_head children;\n\n\n    \/* ... *\/\n};<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">2.&nbsp;<a href=\"https:\/\/www.zhihu.com\/search?q=%E8%B0%83%E5%BA%A6%E7%A8%8B%E5%BA%8F&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u8c03\u5ea6\u7a0b\u5e8f<\/a><\/h2>\n\n\n\n<p>\u8c03\u5ea6\u7a0b\u5e8f\u4f9d\u9760\u51e0\u4e2a\u51fd\u6570\u6765\u5b8c\u6210\u8c03\u5ea6\u5de5\u4f5c\u7684\uff0c\u4e0b\u8fb9\u5c06\u4ecb\u7ecd\u51e0\u4e2a\u5173\u952e\u7684\u51fd\u6570\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.zhihu.com\/search?q=%E4%B8%BB%E5%8A%A8%E8%B0%83%E5%BA%A6&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u4e3b\u52a8\u8c03\u5ea6<\/a>&nbsp;&#8211; schedule()<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"330\" src=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-5.webp\" alt=\"\" class=\"wp-image-1389\" srcset=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-5.webp 720w, https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-5-300x138.webp 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>schedule()\u51fd\u6570\uff0c\u662f\u8fdb\u7a0b\u8c03\u5ea6\u7684\u6838\u5fc3\u51fd\u6570\uff0c\u5927\u4f53\u7684\u6d41\u7a0b\u5982\u4e0a\u56fe\u6240\u793a\u3002<\/li>\n\n\n\n<li>\u6838\u5fc3\u7684\u903b\u8f91\uff1a\u9009\u62e9\u53e6\u5916\u4e00\u4e2a\u8fdb\u7a0b\u6765\u66ff\u6362\u6389\u5f53\u524d\u8fd0\u884c\u7684\u8fdb\u7a0b\u3002\u8fdb\u7a0b\u7684\u9009\u62e9\u662f\u901a\u8fc7\u8fdb\u7a0b\u6240\u4f7f\u7528\u7684\u8c03\u5ea6\u5668\u4e2d\u7684<a href=\"https:\/\/www.zhihu.com\/search?q=pick_next_task%E5%87%BD%E6%95%B0&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">pick_next_task\u51fd\u6570<\/a>\u6765\u5b9e\u73b0\u7684\uff0c\u4e0d\u540c\u7684\u8c03\u5ea6\u5668\u5b9e\u73b0\u7684\u65b9\u6cd5\u4e0d\u4e00\u6837\uff1b\u8fdb\u7a0b\u7684\u66ff\u6362\u662f\u901a\u8fc7<a href=\"https:\/\/www.zhihu.com\/search?q=context_switch&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">context_switch<\/a>()\u6765\u5b8c\u6210\u5207\u6362\u7684\uff0c\u5177\u4f53\u7684\u7ec6\u8282\u540e\u7eed\u7684\u6587\u7ae0\u518d\u6df1\u5165\u5206\u6790\u3002<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.zhihu.com\/search?q=%E5%91%A8%E6%9C%9F%E8%B0%83%E5%BA%A6&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u5468\u671f\u8c03\u5ea6<\/a>&nbsp;&#8211; schedule_tick()<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"403\" src=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-7.webp\" alt=\"\" class=\"wp-image-1391\" srcset=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-7.webp 720w, https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-7-300x168.webp 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u65f6\u949f\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u4e2d\uff0c\u8c03\u7528schedule_tick()\u51fd\u6570\uff1b<\/li>\n\n\n\n<li>\u65f6\u949f\u4e2d\u65ad\u662f\u8c03\u5ea6\u5668\u7684\u8109\u640f\uff0c\u5185\u6838\u4f9d\u9760\u5468\u671f\u6027\u7684\u65f6\u949f\u6765\u5904\u7406\u5668CPU\u7684\u63a7\u5236\u6743\uff1b<\/li>\n\n\n\n<li><a href=\"https:\/\/www.zhihu.com\/search?q=%E6%97%B6%E9%92%9F%E4%B8%AD%E6%96%AD%E5%A4%84%E7%90%86%E7%A8%8B%E5%BA%8F&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u65f6\u949f\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f<\/a>\uff0c\u68c0\u67e5\u5f53\u524d\u8fdb\u7a0b\u7684\u6267\u884c\u65f6\u95f4\u662f\u5426\u8d85\u989d\uff0c\u5982\u679c\u8d85\u989d\u5219\u8bbe\u7f6e\u91cd\u65b0\u8c03\u5ea6\u6807\u5fd7(_TIF_NEED_RESCHED)\uff1b<\/li>\n\n\n\n<li>\u65f6\u949f\u4e2d\u65ad\u5904\u7406\u51fd\u6570\u8fd4\u56de\u65f6\uff0c\u88ab\u4e2d\u65ad\u7684\u8fdb\u7a0b\u5982\u679c\u5728\u7528\u6237\u6a21\u5f0f\u4e0b\u8fd0\u884c\uff0c\u9700\u8981\u68c0\u67e5\u662f\u5426\u6709\u91cd\u65b0\u8c03\u5ea6\u6807\u5fd7\uff0c\u8bbe\u7f6e\u4e86\u5219\u8c03\u7528schedule()\u8c03\u5ea6\uff1b<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.zhihu.com\/search?q=%E9%AB%98%E7%B2%BE%E5%BA%A6%E6%97%B6%E9%92%9F%E8%B0%83%E5%BA%A6&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u9ad8\u7cbe\u5ea6\u65f6\u949f\u8c03\u5ea6<\/a>&nbsp;&#8211; hrtick()<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"397\" src=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-8.webp\" alt=\"\" class=\"wp-image-1393\" srcset=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-8.webp 720w, https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-8-300x165.webp 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9ad8\u7cbe\u5ea6\u65f6\u949f\u8c03\u5ea6\uff0c\u4e0e<a href=\"https:\/\/www.zhihu.com\/search?q=%E5%91%A8%E6%9C%9F%E6%80%A7%E8%B0%83%E5%BA%A6&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u5468\u671f\u6027\u8c03\u5ea6<\/a>\u7c7b\u4f3c\uff0c\u4e0d\u540c\u70b9\u5728\u4e8e\u5468\u671f\u8c03\u5ea6\u7684\u7cbe\u5ea6\u4e3ams\u7ea7\u522b\uff0c\u800c<a href=\"https:\/\/www.zhihu.com\/search?q=%E9%AB%98%E7%B2%BE%E5%BA%A6%E8%B0%83%E5%BA%A6&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u9ad8\u7cbe\u5ea6\u8c03\u5ea6<\/a>\u7684\u7cbe\u5ea6\u4e3ans\u7ea7\u522b\uff1b<\/li>\n\n\n\n<li>\u9ad8\u7cbe\u5ea6\u65f6\u949f\u8c03\u5ea6\uff0c\u9700\u8981\u6709\u5bf9\u5e94\u7684\u786c\u4ef6\u652f\u6301\uff1b<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u8fdb\u7a0b\u5524\u9192\u65f6\u8c03\u5ea6 &#8211; wake_up_process()<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"482\" src=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-9.webp\" alt=\"\" class=\"wp-image-1392\" srcset=\"https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-9.webp 720w, https:\/\/airy.cn\/WordPress\/wp-content\/uploads\/2023\/10\/image-9-300x201.webp 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5524\u9192\u8fdb\u7a0b\u65f6\u8c03\u7528wake_up_process()\u51fd\u6570\uff0c\u88ab\u5524\u9192\u7684\u8fdb\u7a0b\u53ef\u80fd\u62a2\u5360\u5f53\u524d\u7684\u8fdb\u7a0b\uff1b<\/li>\n<\/ul>\n\n\n\n<p>\u4e0a\u8ff0\u8bb2\u5230\u7684\u51e0\u4e2a\u51fd\u6570\u90fd\u662f\u5e38\u7528\u4e8e\u8c03\u5ea6\u65f6\u8c03\u7528\u3002\u6b64\u5916\uff0c\u5728\u521b\u5efa\u65b0\u8fdb\u7a0b\u65f6\uff0c\u6216\u662f\u5728\u5185\u6838\u62a2\u5360\u65f6\uff0c\u4e5f\u4f1a\u51fa\u73b0\u4e00\u4e9b<a href=\"https:\/\/www.zhihu.com\/search?q=%E8%B0%83%E5%BA%A6%E7%82%B9&amp;search_source=Entity&amp;hybrid_search_source=Entity&amp;hybrid_search_extra=%7B%22sourceType%22%3A%22answer%22%2C%22sourceId%22%3A2800084453%7D\" target=\"_blank\" rel=\"noreferrer noopener\">\u8c03\u5ea6\u70b9<\/a>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows\u4f3c\u4e4e\u662f\u4ee5\u7ebf\u7a0b\u4e3a\u5355\u4f4d\u8fdb\u884c\u8c03\u5ea6\u7684\uff0cLinux\u4ee5\u8fdb\u7a0b\u4e3a\u5355\u4f4d\u3002\u4e24\u8005\u6709\u4f55\u533a\u522b\uff1f\u5728\u666e\u901a\u7528\u6237\u624b\u4e2d\uff0c\u54ea\u79cd\u53ef\u80fd\u66f4\u6709 &#8230; <a title=\"Linux\u4e0eWindows\u7684\u8fdb\u7a0b\u8c03\u5ea6\u6709\u4f55\u533a\u522b\uff1f\" class=\"read-more\" href=\"https:\/\/airy.cn\/WordPress\/?p=1384\" aria-label=\"\u9605\u8bfb Linux\u4e0eWindows\u7684\u8fdb\u7a0b\u8c03\u5ea6\u6709\u4f55\u533a\u522b\uff1f\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kadence_starter_templates_imported_post":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-1384","post","type-post","status-publish","format-standard","hentry","category-airy-tech"],"_links":{"self":[{"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=\/wp\/v2\/posts\/1384","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1384"}],"version-history":[{"count":1,"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=\/wp\/v2\/posts\/1384\/revisions"}],"predecessor-version":[{"id":1394,"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=\/wp\/v2\/posts\/1384\/revisions\/1394"}],"wp:attachment":[{"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1384"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}