€•«Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ(/translations/zh_CN/scheduler/text_files”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/zh_TW/scheduler/text_files”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/it_IT/scheduler/text_files”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/ja_JP/scheduler/text_files”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/ko_KR/scheduler/text_files”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/sp_SP/scheduler/text_files”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒScheduler pelt c program”h]”hŒScheduler pelt c program”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒB/var/lib/git/docbuild/linux/Documentation/scheduler/text_files.rst”h KubhŒ literal_block”“”)”}”(hXÐ/* * The following program is used to generate the constants for * computing sched averages. * * ============================================================== * C program (compile with -lm) * ============================================================== */ #include #include #define HALFLIFE 32 #define SHIFT 32 double y; void calc_runnable_avg_yN_inv(void) { int i; unsigned int x; /* To silence -Wunused-but-set-variable warnings. */ printf("static const u32 runnable_avg_yN_inv[] __maybe_unused = {"); for (i = 0; i < HALFLIFE; i++) { x = ((1UL<<32)-1)*pow(y, i); if (i % 6 == 0) printf("\n\t"); printf("0x%8x, ", x); } printf("\n};\n\n"); } int sum = 1024; void calc_runnable_avg_yN_sum(void) { int i; printf("static const u32 runnable_avg_yN_sum[] = {\n\t 0,"); for (i = 1; i <= HALFLIFE; i++) { if (i == 1) sum *= y; else sum = sum*y + 1024*y; if (i % 11 == 0) printf("\n\t"); printf("%5d,", sum); } printf("\n};\n\n"); } int n = -1; /* first period */ long max = 1024; void calc_converged_max(void) { long last = 0, y_inv = ((1UL<<32)-1)*y; for (; ; n++) { if (n > -1) max = ((max*y_inv)>>SHIFT) + 1024; /* * This is the same as: * max = max*y + 1024; */ if (last == max) break; last = max; } n--; printf("#define LOAD_AVG_PERIOD %d\n", HALFLIFE); printf("#define LOAD_AVG_MAX %ld\n", max); // printf("#define LOAD_AVG_MAX_N %d\n\n", n); } void calc_accumulated_sum_32(void) { int i, x = sum; printf("static const u32 __accumulated_sum_N32[] = {\n\t 0,"); for (i = 1; i <= n/HALFLIFE+1; i++) { if (i > 1) x = x/2 + sum; if (i % 6 == 0) printf("\n\t"); printf("%6d,", x); } printf("\n};\n\n"); } void main(void) { printf("/* Generated by Documentation/scheduler/sched-pelt; do not modify. */\n\n"); y = pow(0.5, 1/(double)HALFLIFE); calc_runnable_avg_yN_inv(); // calc_runnable_avg_yN_sum(); calc_converged_max(); // calc_accumulated_sum_32(); } ”h]”hXÐ/* * The following program is used to generate the constants for * computing sched averages. * * ============================================================== * C program (compile with -lm) * ============================================================== */ #include #include #define HALFLIFE 32 #define SHIFT 32 double y; void calc_runnable_avg_yN_inv(void) { int i; unsigned int x; /* To silence -Wunused-but-set-variable warnings. */ printf("static const u32 runnable_avg_yN_inv[] __maybe_unused = {"); for (i = 0; i < HALFLIFE; i++) { x = ((1UL<<32)-1)*pow(y, i); if (i % 6 == 0) printf("\n\t"); printf("0x%8x, ", x); } printf("\n};\n\n"); } int sum = 1024; void calc_runnable_avg_yN_sum(void) { int i; printf("static const u32 runnable_avg_yN_sum[] = {\n\t 0,"); for (i = 1; i <= HALFLIFE; i++) { if (i == 1) sum *= y; else sum = sum*y + 1024*y; if (i % 11 == 0) printf("\n\t"); printf("%5d,", sum); } printf("\n};\n\n"); } int n = -1; /* first period */ long max = 1024; void calc_converged_max(void) { long last = 0, y_inv = ((1UL<<32)-1)*y; for (; ; n++) { if (n > -1) max = ((max*y_inv)>>SHIFT) + 1024; /* * This is the same as: * max = max*y + 1024; */ if (last == max) break; last = max; } n--; printf("#define LOAD_AVG_PERIOD %d\n", HALFLIFE); printf("#define LOAD_AVG_MAX %ld\n", max); // printf("#define LOAD_AVG_MAX_N %d\n\n", n); } void calc_accumulated_sum_32(void) { int i, x = sum; printf("static const u32 __accumulated_sum_N32[] = {\n\t 0,"); for (i = 1; i <= n/HALFLIFE+1; i++) { if (i > 1) x = x/2 + sum; if (i % 6 == 0) printf("\n\t"); printf("%6d,", x); } printf("\n};\n\n"); } void main(void) { printf("/* Generated by Documentation/scheduler/sched-pelt; do not modify. */\n\n"); y = pow(0.5, 1/(double)HALFLIFE); calc_runnable_avg_yN_inv(); // calc_runnable_avg_yN_sum(); calc_converged_max(); // calc_accumulated_sum_32(); } ”…””}”hh¹sbah}”(h]”h ]”h"]”h$]”h&]”Œsource”Œ@/var/lib/git/docbuild/linux/Documentation/scheduler/sched-pelt.c”Œ xml:space”Œpreserve”Œforce”‰Œlanguage”Œc”Œhighlight_args”}”Œ linenostart”Ksuh1h·hŸh¶h Khh£hžhubeh}”(h]”Œscheduler-pelt-c-program”ah ]”h"]”Œscheduler pelt c program”ah$]”h&]”uh1h¡hhhžhhŸh¶h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h¶uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¦NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”hüŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h¶Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”hÖhÓsŒ nametypes”}”hÖ‰sh}”hÓh£sŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.