sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextEnglish}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget/mm/page_fragsmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget!/translations/zh_TW/mm/page_fragsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget!/translations/it_IT/mm/page_fragsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget!/translations/ja_JP/mm/page_fragsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget!/translations/ko_KR/mm/page_fragsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget!/translations/sp_SP/mm/page_fragsmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageChinese (Simplified)uh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h 页面片段h]h 页面片段}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhN/var/lib/git/docbuild/linux/Documentation/translations/zh_CN/mm/page_frags.rsthK ubh paragraph)}(h一个页面片段是一个任意长度的任意偏移的内存区域,它位于一个0或更高阶的复合页面中。 该页中的多个碎片在该页的引用计数器中被单独计算。h]h一个页面片段是一个任意长度的任意偏移的内存区域,它位于一个0或更高阶的复合页面中。 该页中的多个碎片在该页的引用计数器中被单独计算。}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXpage_frag函数,page_frag_alloc和page_frag_free,为页面片段提供了一个简单 的分配框架。这被网络堆栈和网络设备驱动使用,以提供一个内存的支持区域,作为 sk_buff->head使用,或者用于skb_shared_info的 “frags” 部分。h]hXpage_frag函数,page_frag_alloc和page_frag_free,为页面片段提供了一个简单 的分配框架。这被网络堆栈和网络设备驱动使用,以提供一个内存的支持区域,作为 sk_buff->head使用,或者用于skb_shared_info的 “frags” 部分。}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hX为了使用页面片段API,需要一个支持页面片段的缓冲区。这为碎片分配提供了一个中心点, 并允许多个调用使用一个缓存的页面。这样做的好处是可以避免对get_page的多次调用, 这在分配时开销可能会很大。然而,由于这种缓存的性质,要求任何对缓存的调用都要受到每 个CPU的限制,或者每个CPU的限制,并在执行碎片分配时强制禁止中断。h]hX为了使用页面片段API,需要一个支持页面片段的缓冲区。这为碎片分配提供了一个中心点, 并允许多个调用使用一个缓存的页面。这样做的好处是可以避免对get_page的多次调用, 这在分配时开销可能会很大。然而,由于这种缓存的性质,要求任何对缓存的调用都要受到每 个CPU的限制,或者每个CPU的限制,并在执行碎片分配时强制禁止中断。}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hX网络堆栈在每个CPU使用两个独立的缓存来处理碎片分配。netdev_alloc_cache被使用 netdev_alloc_frag和__netdev_alloc_skb调用的调用者使用。napi_alloc_cache 被调用__napi_alloc_frag和napi_alloc_skb的调用者使用。这两个调用的主要区别是 它们可能被调用的环境。“netdev” 前缀的函数可以在任何上下文中使用,因为这些函数 将禁用中断,而 ”napi“ 前缀的函数只可以在softirq上下文中使用。h]hX网络堆栈在每个CPU使用两个独立的缓存来处理碎片分配。netdev_alloc_cache被使用 netdev_alloc_frag和__netdev_alloc_skb调用的调用者使用。napi_alloc_cache 被调用__napi_alloc_frag和napi_alloc_skb的调用者使用。这两个调用的主要区别是 它们可能被调用的环境。“netdev” 前缀的函数可以在任何上下文中使用,因为这些函数 将禁用中断,而 ”napi“ 前缀的函数只可以在softirq上下文中使用。}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hX许多网络设备驱动程序使用类似的方法来分配页面片段,但页面片段是在环或描述符级别上 缓存的。为了实现这些情况,有必要提供一种拆解页面缓存的通用方法。出于这个原因, __page_frag_cache_drain被实现了。它允许通过一次调用从一个页面释放多个引用。 这样做的好处是,它允许清理被添加到一个页面的多个引用,以避免每次分配都调用 get_page。h]hX许多网络设备驱动程序使用类似的方法来分配页面片段,但页面片段是在环或描述符级别上 缓存的。为了实现这些情况,有必要提供一种拆解页面缓存的通用方法。出于这个原因, __page_frag_cache_drain被实现了。它允许通过一次调用从一个页面释放多个引用。 这样做的好处是,它允许清理被添加到一个页面的多个引用,以避免每次分配都调用 get_page。}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(h&Alexander Duyck,2016年11月29日。h]h&Alexander Duyck,2016年11月29日。}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hhhhubeh}(h]id1ah ]h"] 页面片段ah$]h&]uh1hhhhhhhhK ubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj8error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}jjs nametypes}jsh}jhs footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}jFKsRparse_messages]transform_messages] transformerN include_log] decorationNhhub.