Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4697579rwr; Mon, 8 May 2023 11:14:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6jyLw4u28nbBeiCyFaxYhZfAWsKReCcmVmzFNByFfNfM88VfqNB6HY6m6SeTL9789+gpSr X-Received: by 2002:a05:6a00:2451:b0:646:b944:4e1d with SMTP id d17-20020a056a00245100b00646b9444e1dmr1091663pfj.32.1683569697656; Mon, 08 May 2023 11:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683569697; cv=none; d=google.com; s=arc-20160816; b=KyU8hSpQynv3KKhKrd3nY/NCxuhaLLLW7pbAK4LFuhgRrdC/cmSwpTEFTx2uIMDCnp vLI40e4Hms8/Vy+IYIo6/YDCYn9mv8NmhlK4P2fTDWAEDnvDEdMHvpez8WfD3yFl3eO0 K2t+FkDiREgro+4CY/o9Wly5V6da1yKvLYrVf7qbCkL9mF9ZT4gxWbE8Q4kRE72Gh5H5 AGklC3hFx8JnzLBBluI3ydAJHrjWnpNQbzC8Bg2WoI7bxZgcL8kAkk6MSLp00A+Qm9o5 j0w/e4nnQ/2j83NN68c2oMCxe4s51ZWjHqxlguB24HRJVzBVN1iNws5/+T7XPmPYnU7g 3+BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=xBM5m6wDNW8LeDu3c/o/2yvJ8k64BJF0JoE591jbLbA=; b=L7e3CVGNnBxJhCVhqaytscqV8TFZX2gkpAYdek0Lb/9AFfbN3DJOzSg+3L+BGexFgO H5PN000+CGmx26J1oiqO8+mk6vZvBDw0+a5lyvCXKDr4orp5Pl8OZ0xBThwkMRNhJTUc oFzcWRb+4decuRDcNNKcFCsZ2LxYfnqkfzbRfcGKW4X8J0v7KS2koAYwUcFAz4GAkT2I K9Ni3zDwG03/WXp5nydU97CL8vPsZS5QySRJQ35pN2ll4u0MOHItGNl7vSEl3Asovp9k 6JhCz8HtJQD0S/f2wjVBZOa3dX26BX4MJ2XhdLh3SDZ7EwDXq51xvENRaLexRMCaD6/9 J5Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=sMXXfFh+; dkim=neutral (no key) header.i=@linutronix.de header.b=FKKYbkze; 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=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k14-20020aa7998e000000b00643b2b72c8esi362062pfh.317.2023.05.08.11.14.44; Mon, 08 May 2023 11:14:57 -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=@linutronix.de header.s=2020 header.b=sMXXfFh+; dkim=neutral (no key) header.i=@linutronix.de header.b=FKKYbkze; 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=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234078AbjEHRvr (ORCPT + 99 others); Mon, 8 May 2023 13:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbjEHRvp (ORCPT ); Mon, 8 May 2023 13:51:45 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42ED744A0; Mon, 8 May 2023 10:51:44 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683568301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xBM5m6wDNW8LeDu3c/o/2yvJ8k64BJF0JoE591jbLbA=; b=sMXXfFh+31ZYLnj/Q/317zJ8ZSNPWFhoFiud2U76+34ZcjDHzfH94OqL5J7Cq08AktHEob jScu3BBU+qL6S/lcL3VxvFTcbres7JXXNwc90R7lK1wlwr2ZmAigc0dIvG5AV6JAzorBaq DIpcER3iASDOuzirPArCyeojNdahXrhqv4d/Uweihy+eMCslrpiZjVjkedRt1mJY4raFyK YgUIvPPYtt7wKOkz2+m2PZtlqlM8wnC8SGGOKlzyhUWXe5PLhj9G2a/vKTQIm9Ki6XKPrl ry4fY2g0q5I7fMBhPRATR4Kgl2/343VnWymkfbnsQx7N+fW0pldcN8wNrV6oMw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683568301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xBM5m6wDNW8LeDu3c/o/2yvJ8k64BJF0JoE591jbLbA=; b=FKKYbkze0DTjbg51KVCUWSLfNiUsicv5XAC0hJm2+JvwoRzcsJXs/xUt9yUiE5d6ajXhX2 oLbHvKULh49aPoDw== To: Jason Xing , Liu Jian Cc: corbet@lwn.net, paulmck@kernel.org, frederic@kernel.org, quic_neeraju@quicinc.com, joel@joelfernandes.org, josh@joshtriplett.org, boqun.feng@gmail.com, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, qiang1.zhang@intel.com, jstultz@google.com, sboyd@kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, peterz@infradead.org, frankwoo@google.com, Rhinewuwu@google.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, rcu@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH 2/9] softirq: Use sched_clock() based timeout In-Reply-To: References: <20230505113315.3307723-1-liujian56@huawei.com> <20230505113315.3307723-3-liujian56@huawei.com> Date: Mon, 08 May 2023 19:51:41 +0200 Message-ID: <87cz3a3e4y.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Mon, May 08 2023 at 12:08, Jason Xing wrote: > On Fri, May 5, 2023 at 7:25=E2=80=AFPM Liu Jian wr= ote: >> @@ -489,7 +490,7 @@ asmlinkage __visible void do_softirq(void) >> * we want to handle softirqs as soon as possible, but they >> * should not be able to lock up the box. >> */ >> -#define MAX_SOFTIRQ_TIME msecs_to_jiffies(2) >> +#define MAX_SOFTIRQ_TIME (2 * NSEC_PER_MSEC) > > I wonder if it affects those servers that set HZ to some different > values rather than 1000 as default. The result of msecs_to_jiffies(2) for different HZ values: HZ=3D100 1 HZ=3D250 1 HZ=3D1000 2 So depending on when the softirq processing starts, this gives the following ranges in which the timeout ends: HZ=3D100 0 - 10ms HZ=3D250 0 - 4ms HZ=3D1000 1 - 2ms But as the various softirq handlers have their own notion of timeouts, loop limits etc. and the timeout is only checked after _all_ pending bits of each iteration have been processed, the outcome of this is all lottery. Due to that the sched_clock() change per se won't have too much impact, but if the overall changes to consolidate the break conditions are in place, I think it will have observable effects. Making this consistent is definitely a good thing, but it won't solve the underlying problem of soft interrupt processing at all. We definitely need to spend more thoughts on pulling things out of soft interrupt context so that these functionalities get under proper resource control by the scheduler. Thanks, tglx