€•þˆŒ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/networking/kcm”Œ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/networking/kcm”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/it_IT/networking/kcm”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/ja_JP/networking/kcm”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/ko_KR/networking/kcm”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/pt_BR/networking/kcm”Œ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/networking/kcm”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³Œh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kßhj-h²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒConfigurations”h]”hŒConfigurations”…””}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjLh²hh³hÇh´KéubhÞ)”}”(hX¢In an Nx1 configuration, KCM logically provides multiple socket handles to the same TCP connection. This allows parallelism between in I/O operations on the TCP socket (for instance copyin and copyout of data is parallelized). In an application, a KCM socket can be opened for each processing thread and inserted into the epoll (similar to how SO_REUSEPORT is used to allow multiple listener sockets on the same port).”h]”hX¢In an Nx1 configuration, KCM logically provides multiple socket handles to the same TCP connection. This allows parallelism between in I/O operations on the TCP socket (for instance copyin and copyout of data is parallelized). In an application, a KCM socket can be opened for each processing thread and inserted into the epoll (similar to how SO_REUSEPORT is used to allow multiple listener sockets on the same port).”…””}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KëhjLh²hubhÞ)”}”(hŒIn a MxN configuration, multiple connections are established to the same destination. These are used for simple load balancing.”h]”hŒIn a MxN configuration, multiple connections are established to the same destination. These are used for simple load balancing.”…””}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KòhjLh²hubeh}”(h]”Œconfigurations”ah ]”h"]”Œconfigurations”ah$]”h&]”uh1hÈhj-h²hh³hÇh´KéubhÉ)”}”(hhh]”(hÎ)”}”(hŒMessage batching”h]”hŒMessage batching”…””}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´KöubhÞ)”}”(hX®The primary purpose of KCM is load balancing between KCM sockets and hence threads in a nominal use case. Perfect load balancing, that is steering each received message to a different KCM socket or steering each sent message to a different TCP socket, can negatively impact performance since this doesn't allow for affinities to be established. Balancing based on groups, or batches of messages, can be beneficial for performance.”h]”hX°The primary purpose of KCM is load balancing between KCM sockets and hence threads in a nominal use case. Perfect load balancing, that is steering each received message to a different KCM socket or steering each sent message to a different TCP socket, can negatively impact performance since this doesn’t allow for affinities to be established. Balancing based on groups, or batches of messages, can be beneficial for performance.”…””}”(hj’h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Køhjh²hubhÞ)”}”(hŒ_On transmit, there are three ways an application can batch (pipeline) messages on a KCM socket.”h]”hŒ_On transmit, there are three ways an application can batch (pipeline) messages on a KCM socket.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kÿhjh²hubj;)”}”(hX1) Send multiple messages in a single sendmmsg. 2) Send a group of messages each with a sendmsg call, where all messages except the last have MSG_BATCH in the flags of sendmsg call. 3) Create "super message" composed of multiple messages and send this with a single sendmsg. ”h]”hŒenumerated_list”“”)”}”(hhh]”(jŠ)”}”(hŒ,Send multiple messages in a single sendmmsg.”h]”hÞ)”}”(hj¹h]”hŒ,Send multiple messages in a single sendmmsg.”…””}”(hj»h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhj·ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‰hj´ubjŠ)”}”(hŒ‚Send a group of messages each with a sendmsg call, where all messages except the last have MSG_BATCH in the flags of sendmsg call.”h]”hÞ)”}”(hŒ‚Send a group of messages each with a sendmsg call, where all messages except the last have MSG_BATCH in the flags of sendmsg call.”h]”hŒ‚Send a group of messages each with a sendmsg call, where all messages except the last have MSG_BATCH in the flags of sendmsg call.”…””}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MhjÎubah}”(h]”h ]”h"]”h$]”h&]”uh1j‰hj´ubjŠ)”}”(hŒZCreate "super message" composed of multiple messages and send this with a single sendmsg. ”h]”hÞ)”}”(hŒYCreate "super message" composed of multiple messages and send this with a single sendmsg.”h]”hŒ]Create “super message†composed of multiple messages and send this with a single sendmsg.”…””}”(hjêh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhjæubah}”(h]”h ]”h"]”h$]”h&]”uh1j‰hj´ubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”hŒsuffix”Œ)”uh1j²hj®ubah}”(h]”h ]”h"]”h$]”h&]”uh1j:h³hÇh´Mhjh²hubhÞ)”}”(hŒøOn receive, the KCM module attempts to queue messages received on the same KCM socket during each TCP ready callback. The targeted KCM socket changes at each receive ready callback on the KCM socket. The application does not need to configure this.”h]”hŒøOn receive, the KCM module attempts to queue messages received on the same KCM socket during each TCP ready callback. The targeted KCM socket changes at each receive ready callback on the KCM socket. The application does not need to configure this.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhjh²hubeh}”(h]”Œmessage-batching”ah ]”h"]”Œmessage batching”ah$]”h&]”uh1hÈhj-h²hh³hÇh´KöubhÉ)”}”(hhh]”(hÎ)”}”(hŒError handling”h]”hŒError handling”…””}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj%h²hh³hÇh´MubhÞ)”}”(hXeAn application should include a thread to monitor errors raised on the TCP connection. Normally, this will be done by placing each TCP socket attached to a KCM multiplexor in epoll set for POLLERR event. If an error occurs on an attached TCP socket, KCM sets an EPIPE on the socket thus waking up the application thread. When the application sees the error (which may just be a disconnect) it should unattach the socket from KCM and then close it. It is assumed that once an error is posted on the TCP socket the data stream is unrecoverable (i.e. an error may have occurred in the middle of receiving a message).”h]”hXeAn application should include a thread to monitor errors raised on the TCP connection. Normally, this will be done by placing each TCP socket attached to a KCM multiplexor in epoll set for POLLERR event. If an error occurs on an attached TCP socket, KCM sets an EPIPE on the socket thus waking up the application thread. When the application sees the error (which may just be a disconnect) it should unattach the socket from KCM and then close it. It is assumed that once an error is posted on the TCP socket the data stream is unrecoverable (i.e. an error may have occurred in the middle of receiving a message).”…””}”(hj6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhj%h²hubeh}”(h]”Œerror-handling”ah ]”h"]”Œerror handling”ah$]”h&]”uh1hÈhj-h²hh³hÇh´MubhÉ)”}”(hhh]”(hÎ)”}”(hŒTCP connection monitoring”h]”hŒTCP connection monitoring”…””}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjLh²hh³hÇh´MubhÞ)”}”(hX~In KCM there is no means to correlate a message to the TCP socket that was used to send or receive the message (except in the case there is only one attached TCP socket). However, the application does retain an open file descriptor to the socket so it will be able to get statistics from the socket which can be used in detecting issues (such as high retransmissions on the socket).”h]”hX~In KCM there is no means to correlate a message to the TCP socket that was used to send or receive the message (except in the case there is only one attached TCP socket). However, the application does retain an open file descriptor to the socket so it will be able to get statistics from the socket which can be used in detecting issues (such as high retransmissions on the socket).”…””}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MhjLh²hubeh}”(h]”Œtcp-connection-monitoring”ah ]”h"]”Œtcp connection monitoring”ah$]”h&]”uh1hÈhj-h²hh³hÇh´Mubeh}”(h]”Œuse-in-applications”ah ]”h"]”Œuse in applications”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KÝubeh}”(h]”Œkernel-connection-multiplexor”ah ]”h"]”Œkernel connection multiplexor”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”j¦Œ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”}”(j€j}j/j,jVjSj}jzj¤j¡jCj@jøjõj;j8j*j'jÇjÄjüjùjƒj€j¸jµjíjêj"jjxjuj~j{j"jjIjFjpjmuŒ nametypes”}”(j€‰j/‰jV‰j}‰j¤‰jC‰jø‰j;‰j*‰jljjü‰jƒ‰j¸‰jí‰j"‰jx‰j~‰j"‰jI‰jp‰uh}”(j}hÊj,j jSj2jzjYj¡j€j@j§jõjÆj8jûj'jFjÄjWjùjÊj€jÿjµj†jêj»jjðjuj-j{jLjjjFj%jmjLuŒ 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.