Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3185305pxb; Sun, 20 Feb 2022 11:51:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzC8pbRM6jazwJL3MOZnz1q1xizf5GjDVTNi/KKAtkEP5A7scFUVAl4q47efmWzBqeobTr6 X-Received: by 2002:a17:906:2a1b:b0:6ce:a15b:a561 with SMTP id j27-20020a1709062a1b00b006cea15ba561mr13783738eje.403.1645386698985; Sun, 20 Feb 2022 11:51:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645386698; cv=none; d=google.com; s=arc-20160816; b=QaOfcGFRF/65at0JYXqPNWdDZ/25bn/Bfx5nAo4maMdjzv1VD9N82Q7D7ImzIwylAQ gfyKWKd/HVeLa32ue/GRv5k3Qfe2Na8rBxGvYlmQaJGkl8s2KmtqTkXasp4/6rO3Bc1i UpkgCcoCWQG3lauDrlpjFAW7422woFgJ8TO+TANAoGQoSNbbb/tyZiIJ4DvVjAQSSuPF JZf1Tjzu8x5aTsy5fIUwc4DL9+bVIH4VWh6n7cs47i3dVRJ/jwUTqaIqGt9YzsSs7Urc h0EwJNrQPExWeGIK2ouW1YLCa7FaDkKcM223FLwI7HBuOzjr5hbWzriATvOxd0KM6Ius YMCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=VhvKjJherFft0gV1QcNLzSP7VXoiwHsr5iY7gxVXAMk=; b=HSn9jNE6Jzjz8Hy9mplcVZ15GhSn3QAHzCnp6Rpj0Iv3Ho9Gfa35o1HuTObJj1xctq Yicf3j4kFLnqAb7JiPFVO5hmSe77mb9r0ciCxBIQT9h0cU2rk0t/yP0MrQYdj7glbRJq OVSHLfTeDiPpfwM0GfIPIjN5H8HVl2AbNI4xO63qtx84rqXaIYtzQ2Ag7+m7gWNK2Sc4 tG0lINa5JfdeQvBwqch03tl9nlqwkU7vDApkYDtr7XQR+j5ValO52UDzN1GjZYSvheKH uSyel5299iBaamAm9uwl6wFERDbjAeKODO1WmCFG/aKisHqqNRJBh4/xx8SW3Bhj6SRB Xn2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b="LTM/DZUo"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q27si9594264edw.658.2022.02.20.11.51.16; Sun, 20 Feb 2022 11:51:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b="LTM/DZUo"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232461AbiBTAWi (ORCPT + 99 others); Sat, 19 Feb 2022 19:22:38 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230284AbiBTAWh (ORCPT ); Sat, 19 Feb 2022 19:22:37 -0500 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3460A38182 for ; Sat, 19 Feb 2022 16:22:16 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id qe15so11697839pjb.3 for ; Sat, 19 Feb 2022 16:22:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=VhvKjJherFft0gV1QcNLzSP7VXoiwHsr5iY7gxVXAMk=; b=LTM/DZUoJQFs1QHm0h9N7/6U71dr/BkAX+uf0Yqt/KWb4X+GiI2z7PPX3yXTHx00r5 46AzwI5eG8rmwiYB/LftgfedSbS79Uh8b9W0iZjhM8g5qS65RsVN5zAnfllv3+CKhtBr TZlUiRfGKI9wCStl7IVUqsZw8EAsdQF5XRVMXkFJkAHI4cVfZDVPr4WcdRC58/lewDrM ztmeECXM+Mh6YdU/SCWqqonStnxab+AGSOJ/uq0xbQB2ZvLNegkQXG48eK0ufWiymflZ 9CpKbfS7Xf/bqJaOoScAgh0J7sC+bNrj5IoKWHsRIR09eCaXfvDsb+t//sdu58i1sKP6 UIhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=VhvKjJherFft0gV1QcNLzSP7VXoiwHsr5iY7gxVXAMk=; b=VVfXaISqqIiPyL0btxzPfiiNdp2xU8P68I83Ja2mzEL4NpO6rZKKhudEEOhUz1BlX5 raKWxRM5c67Q8tkLR+DAJ9plDa1rR1ftDwhG+oldtvSFDzeFf5B4Js++G66OgAcWB9n/ DWMxRoOss1N4rkvL7CW4YkgJatMCPws1WeYpZkX63QHep0LObJ3KBeWb+vbMqj3o0dPQ h3IdTo32WG1A4LJB9o2tWKE0t3G0c2BdIHYZgp0/Uq6MuJ9O4vKFElcX9D6OWppMwgnJ 6hjwhIBvkodNWOQHNgy9GYRrJinRitGjD6Ktm4eEnUf4liSzzI++z2/lf4JePXR9xkuI +gEg== X-Gm-Message-State: AOAM531g9oHJ5ISzC5u+/3PeN9wK84Px60FIUROahGR3J9x0SglwqCuQ RrFoFtwgLb4Txbw/fCVo9hJ/yD0478k4Fw== X-Received: by 2002:a17:90b:368c:b0:1b8:57c5:3fde with SMTP id mj12-20020a17090b368c00b001b857c53fdemr14862453pjb.244.1645316535534; Sat, 19 Feb 2022 16:22:15 -0800 (PST) Received: from [192.168.1.100] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id b14sm103316pjl.21.2022.02.19.16.22.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 16:22:15 -0800 (PST) Message-ID: Date: Sat, 19 Feb 2022 17:22:13 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH v1] io_uring: Add support for napi_busy_poll Content-Language: en-US To: Olivier Langlois Cc: Pavel Begunkov , Hao Xu , io-uring , linux-kernel References: From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/19/22 2:42 PM, Olivier Langlois wrote: > One side effect that I have discovered from testing the napi_busy_poll > patch, despite improving the network timing of the threads performing > the busy poll, it is the networking performance degradation that it has > on the rest of the system. > > I dedicate isolated CPUS to specific threads of my program. My kernel > is compiled with CONFIG_NO_HZ_FULL. One thing that I have never really > understood is why there were still kernel threads assigned to the > isolated CPUs. > > $ CORENUM=2; ps -L -e -o pid,psr,cpu,cmd | grep -E > "^[[:space:]]+[[:digit:]]+[[:space:]]+${CORENUM}" > 24 2 - [cpuhp/2] > 25 2 - [idle_inject/2] > 26 2 - [migration/2] > 27 2 - [ksoftirqd/2] > 28 2 - [kworker/2:0-events] > 29 2 - [kworker/2:0H] > 83 2 - [kworker/2:1-mm_percpu_wq] > > It is very hard to keep the CPU 100% tickless if there are still tasks > assigned to isolated CPUs by the kernel. > > This question isn't really answered anywhere AFAIK: > https://www.kernel.org/doc/html/latest/timers/no_hz.html > https://jeremyeder.com/2013/11/15/nohz_fullgodmode/ > > Those threads running on their dedicated CPUS are the ones doing the > NAPI busy polling. Because of that, those CPUs usage ramp up to 100% > and running ping on the side is now having horrible numbers: > > [2022-02-19 07:27:54] INFO SOCKPP/ping ping results for 10 loops: > 0. 104.16.211.191 rtt min/avg/max/mdev = 9.926/34.987/80.048/17.016 ms > 1. 104.16.212.191 rtt min/avg/max/mdev = 9.861/34.934/79.986/17.019 ms > 2. 104.16.213.191 rtt min/avg/max/mdev = 9.876/34.949/79.965/16.997 ms > 3. 104.16.214.191 rtt min/avg/max/mdev = 9.852/34.927/79.977/17.019 ms > 4. 104.16.215.191 rtt min/avg/max/mdev = 9.869/34.943/79.958/16.997 ms > > Doing this: > echo 990000 > /proc/sys/kernel/sched_rt_runtime_us > > as instructed here: > https://www.kernel.org/doc/html/latest/scheduler/sched-rt-group.html > > fix the problem: > > $ ping 104.16.211.191 > PING 104.16.211.191 (104.16.211.191) 56(84) bytes of data. > 64 bytes from 104.16.211.191: icmp_seq=1 ttl=62 time=1.05 ms > 64 bytes from 104.16.211.191: icmp_seq=2 ttl=62 time=0.812 ms > 64 bytes from 104.16.211.191: icmp_seq=3 ttl=62 time=0.864 ms > 64 bytes from 104.16.211.191: icmp_seq=4 ttl=62 time=0.846 ms > 64 bytes from 104.16.211.191: icmp_seq=5 ttl=62 time=1.23 ms > 64 bytes from 104.16.211.191: icmp_seq=6 ttl=62 time=0.957 ms > 64 bytes from 104.16.211.191: icmp_seq=7 ttl=62 time=1.10 ms > ^C > --- 104.16.211.191 ping statistics --- > 7 packets transmitted, 7 received, 0% packet loss, time 6230ms > rtt min/avg/max/mdev = 0.812/0.979/1.231/0.142 ms > > If I was to guess, I would say that it is ksoftirqd on those CPUs that > is starving and is not servicing the network packets but I wish that I > had a better understanding of what is really happening and know if it > would be possible to keep 100% those processors dedicated to my tasks > and have the network softirqs handled somewhere else to not have to > tweak /proc/sys/kernel/sched_rt_runtime_us to fix the issue... Outside of this, I was hoping to see some performance numbers in the main patch. Sounds like you have them, can you share? -- Jens Axboe