Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp3815810rwr; Sun, 7 May 2023 21:00:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ60ALHq2oHZ7HAWxqGJXMup9LW5ygKzD2vNmM+ZVKkMaf05+/MG5xLwyErU2KP1COha68f7 X-Received: by 2002:a05:6a00:2e81:b0:63b:7ae0:fde9 with SMTP id fd1-20020a056a002e8100b0063b7ae0fde9mr12319581pfb.20.1683518459213; Sun, 07 May 2023 21:00:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683518459; cv=none; d=google.com; s=arc-20160816; b=s6vbZP1k+O1rm2cv6gf3DOj17mejMjLJYbTqfeAketzRbsXQy034YNAKkQ3mEPpCNT GuP5lZIa3TVzCsCVGmtJ9+uhKxKVE6A9dsWSSAThGcoQy+4TCMbjiyybxr24e9N3p18V jx/RGhgPL9Mg0VrAdQcM8XP2CE+1SHD5Ucfk08DjCrZBYr+wbBKDSERPtTSslVxs3sNE i98uGHtczC3WVHSjZPUBAjv7DiEUQSVVta/GLDgS8ci04fP+q+pmUDfeGf1PEnf0EeWr ZPAtVNQPPimXK8ZqDIb/rVEMJTgVH7cfMQEDG/8vm4XPBt+W6jIWMLJjnHDCiBQIc+ZC RrQg== 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:subject:user-agent:mime-version:date:message-id; bh=NNe9ZcV0Z4J9WCizGs6WrWGVWcz53e5lNf+l0mnQiMo=; b=ysI9H9yDfkwvItQfHoPEzq6ikLFHD9NP3YxzzwQ5X0niy21f+Ss3Muoq7i2tMXwKMC V0AR3fWb/ve8RyuA9wmjdW3bW7WC3tieEqTaOpH9fd3BOCH+JTKknDqNH92fjbRyeptA CyFZkK9Eu1IQc63ot+lQrrlx8ushgSCoxpG/wMC0GTywUaksdtLaY3N3qAZkq3lar4cg VhWisiRpZgjx9M2EuUr26BCJIYXDwoQ5x/OLWBFfX9dRTMqDCQblAiz0X2n/MyH1xIMU /Du9ZNQ39W0n+nUlaPfNBCJmcH/wFV2Ddazd3HLTaVuH76NdQzjLinsVy4Ve4VO3ykH9 6yEw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y10-20020aa78f2a000000b00625e7f9b859si7629932pfr.339.2023.05.07.21.00.46; Sun, 07 May 2023 21:00:59 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232026AbjEHDvX (ORCPT + 99 others); Sun, 7 May 2023 23:51:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231784AbjEHDvV (ORCPT ); Sun, 7 May 2023 23:51:21 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4577759E0 for ; Sun, 7 May 2023 20:51:10 -0700 (PDT) Received: from canpemm500010.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4QF6fK6Wq7zTk0n; Mon, 8 May 2023 11:46:33 +0800 (CST) Received: from [10.174.176.93] (10.174.176.93) by canpemm500010.china.huawei.com (7.192.105.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Mon, 8 May 2023 11:51:08 +0800 Message-ID: Date: Mon, 8 May 2023 11:51:07 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH 9/9] softirq, timer: Use softirq_needs_break() To: Hillf Danton CC: , , References: <20230505113315.3307723-1-liujian56@huawei.com> <20230505135553.4248-1-hdanton@sina.com> From: "liujian (CE)" In-Reply-To: <20230505135553.4248-1-hdanton@sina.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.176.93] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500010.china.huawei.com (7.192.105.118) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 2023/5/5 21:55, Hillf Danton wrote: > On 5 May 2023 19:33:15 +0800 Liu Jian >> In the while loop of __run_timers(), because there are too many timers or >> improper timer handler functions, if the processing time of the expired >> timers is always greater than the time wheel's next_expiry, the function >> will loop infinitely. >> >> To prevent this, use the timeout/break logic provided by SoftIRQs. If the >> running time exceeds the limit, break the loop and an additional >> TIMER_SOFTIRQ is triggered. > > This can not be a correct fix without getting every timer hog that runs > longer than MAX_SOFTIRQ_TIME identified first and fixed. > Do you mean that the timer that takes too long to execute needs to be fixed first? Let's ignore this problem here. The modification is only used to ensure that the loop exits when the loop execution time in __run_timers() exceeds MAX_SOFTIRQ_TIME. > The same applies to any softirq in general. >