Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp684234rwl; Sat, 25 Mar 2023 09:06:18 -0700 (PDT) X-Google-Smtp-Source: AKy350bZfxcoXw3vmgxhRX24laSmHNCtW3cOVoTHNHeAnNDc3vg9x6AnxnzqoIR/OiLc/y8pq/d0 X-Received: by 2002:a17:902:d4c7:b0:19e:6760:305b with SMTP id o7-20020a170902d4c700b0019e6760305bmr6773116plg.47.1679760377870; Sat, 25 Mar 2023 09:06:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679760377; cv=none; d=google.com; s=arc-20160816; b=hN4/wIHic9XMxaj2Sm+/LpT54deWVsqk0Snr4w/lsVFZcqjf1B+PW6di6hq1SXpIpI HRs2mK2xC1X2tR870YEtIY1SwzJeC6UFyFZmTR21Zlt5oW6tg8KK9KBTL5HFqfLooXd0 PBoKABzJ6EMrlyMT8KRXoVzoV52ibUQ+esN02/H/9/ErKcJI9l9FpdV832ewDzkDUO3a 4/FNhISPD4/xZQl/MmmWDuM4IwdRcTxV0r91Upi6+uybD6vUupkMvnIeUIQoyFLg+60K Z2tKIFof+GB4ZlHYVVmHkQ+KgJ5HxsEO2lvpALTFIIsv6hjLTwLll33fxYkKXuU+DtnU HyzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=4IDz7yIG9Izbiq1h274zfmiMuoeRbSnme+oAuz3O2pM=; b=GPJ5NdNlpUid92ScVFdLTLuFFfUzGE53HiDQbixGrbem5PGO/dH6M9zLripr0Jnlb4 Gr0z76gqDwGdWK7MIhvVk7lryDRxPDnIVUr27DQIekyAydk098/dqnIFUbjOl0oV9b3g V2uMrK7cFlUJB4IIVy02Zj35r71ZHfzEzfvLXTTeWKgaztqZg8QWXgtup8ANTeYa559L T9QFySJDckN3y4x9bad++0bOnVwzNPWpoViCro8pfCfiv0HDHH9/XUDChTSdgyGSRkVs 1Bth9664nqE2IZFqBsBdcCgJOPYHp+nHYdYjuA7xlEAW6lqSMu9mBK2J+HqsrRlw2qG4 kUsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=cAvgoTA5; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020a63ed03000000b0050bfa82c246si23777514pgi.875.2023.03.25.09.06.05; Sat, 25 Mar 2023 09:06:17 -0700 (PDT) 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=@google.com header.s=20210112 header.b=cAvgoTA5; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231904AbjCYP5N (ORCPT + 99 others); Sat, 25 Mar 2023 11:57:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231404AbjCYP5L (ORCPT ); Sat, 25 Mar 2023 11:57:11 -0400 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44D7CF97B for ; Sat, 25 Mar 2023 08:57:07 -0700 (PDT) Received: by mail-il1-x133.google.com with SMTP id n1so1712034ili.10 for ; Sat, 25 Mar 2023 08:57:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679759826; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4IDz7yIG9Izbiq1h274zfmiMuoeRbSnme+oAuz3O2pM=; b=cAvgoTA51G1covSTXw8lExHt0SHLmjcVrcocTO89CB0Zq+6Q+nZuIqQeYhvYhobnGN p+4XhQAGHrBcJYE7dm1GSTl71bFrTRYcl8M4x26Tw58oIbhN1Zup1QPTfIfzLGBEmCA2 3SpSd9LGG9Kuy/i//nhp3DK7ro8MBNJTRywL1gxDwKfD2fKfgpV1SATOZCFdol/kqOsV QCxPsygQZitVtPkvBX6BbH5EBpFqM6kugW5X1qOraeDThWridvOkJi9N/hf9fYWHxC0k 1L2cuWuR3Ahx3vVN5gQLF3XJGwOP7Y+tKqbor0MtcgW2LgUzLovvbuMFYfm1DNCDVJzT uNjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679759826; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4IDz7yIG9Izbiq1h274zfmiMuoeRbSnme+oAuz3O2pM=; b=Wu2ZLRgFNz/rCYOv9inEyyTuGAce/uOHj9RB+AY6TXdaHl1Km40wwoBfq23VysCVFl 2Fq13L0EoN1KyUcwGKU76+dTV9cWVHVpROpYHp9g6o3Yh9jylRx8qulSAk6B95ix2sJU uLMm2iCG//Nbn06EoU7SewWnbRbJfkfpMmI4G+YnTxUYv9PbkqrpbdU+nYHtL4ZvramY UFarD7fP/I8g/3ukQ0mcIbLwX+07DEwY5W0lXGkM0RGRWr2Xtl5pyylgl1ftdad/KlaQ TEFL6eIgE8Ft48EGypF4hLG7BSDUU4EJFgouWRZ3hC/yenvONOe0lPv4vdl18YSnjhs1 Ps9Q== X-Gm-Message-State: AAQBX9ef9QNf5MrbTW7QsrsTonPYTT1aORJg6cajEySgypSQukyXIB4N MdDtkj6wsHbSSJjqEW5UqRBEtzxxIW8cf3DwS/pukw== X-Received: by 2002:a92:7c07:0:b0:310:fc49:1d9 with SMTP id x7-20020a927c07000000b00310fc4901d9mr3377780ilc.6.1679759826290; Sat, 25 Mar 2023 08:57:06 -0700 (PDT) MIME-Version: 1.0 References: <20230325152417.5403-1-kerneljasonxing@gmail.com> In-Reply-To: <20230325152417.5403-1-kerneljasonxing@gmail.com> From: Eric Dumazet Date: Sat, 25 Mar 2023 08:56:54 -0700 Message-ID: Subject: Re: [PATCH net] net: fix raising a softirq on the current cpu with rps enabled To: Jason Xing Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jason Xing Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-15.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=unavailable 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 Sat, Mar 25, 2023 at 8:26=E2=80=AFAM Jason Xing wrote: > > From: Jason Xing > > Since we decide to put the skb into a backlog queue of another > cpu, we should not raise the softirq for the current cpu. When > to raise a softirq is based on whether we have more data left to > process later. As to the current cpu, there is no indication of > more data enqueued, so we do not need this action. After enqueuing > to another cpu, net_rx_action() function will call ipi and then > another cpu will raise the softirq as expected. > > Also, raising more softirqs which set the corresponding bit field > can make the IRQ mechanism think we probably need to start ksoftirqd > on the current cpu. Actually it shouldn't happen. > > Fixes: 0a9627f2649a ("rps: Receive Packet Steering") > Signed-off-by: Jason Xing > --- > net/core/dev.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/net/core/dev.c b/net/core/dev.c > index 1518a366783b..bfaaa652f50c 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -4594,8 +4594,6 @@ static int napi_schedule_rps(struct softnet_data *s= d) > if (sd !=3D mysd) { > sd->rps_ipi_next =3D mysd->rps_ipi_list; > mysd->rps_ipi_list =3D sd; > - > - __raise_softirq_irqoff(NET_RX_SOFTIRQ); > return 1; > } > #endif /* CONFIG_RPS */ > -- > 2.37.3 > This is not going to work in some cases. Please take a deeper look. I have to run, if you (or others) do not find the reason, I will give more details when I am done traveling.