Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3331904rwb; Sun, 20 Nov 2022 11:50:13 -0800 (PST) X-Google-Smtp-Source: AA0mqf6opFKqq9x4n5tYNt7JZ/m6VoX+NAcDZ/bDyeGRj0fAa0oeT3VUGjq5380jc0QmMzjK/x20 X-Received: by 2002:a05:6402:3719:b0:461:4f34:d8f4 with SMTP id ek25-20020a056402371900b004614f34d8f4mr13898575edb.144.1668973813440; Sun, 20 Nov 2022 11:50:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668973813; cv=none; d=google.com; s=arc-20160816; b=Ov/ijaxEi09sYmQIkmnJYX32Q8nPuFihb0WSEjC9lHfOU9Z21I2L/VEnKasYcmCdX8 u0RlZpeNRrEKm0TJITchl9YB6TK16Dh+os7P/Nsta8fiJOa6AiAlXC2o5Wtw3eoDRl1c m1RpiW/t1If5LN7hyzG5OIoFL0jX2OiTR6n0e7yAhaH3l29kns9+OhTuFTqiYYmtHCe5 MhLFQCnWtVuz9VoFO6CAF1AJn9a55LHXAkWCJb2W0VoJuJgsDJLCN+5w/Zyf18gk9oHr +I6WzVrf3SzJSGYinu2Q6lf6v0XA1HKDiio8BSwtwS0QaUu2MA6sW4Ec1PV0Qevzt50/ bS6A== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=LvoIyrhDPuzJvjRmXbphd93rgBp6WUFVlzDyXsVmpg8=; b=PTxHaNoT6RX1TzkPTZf9n0fyRKPTVia49iS3K3LIRMNHZ3kGWCXTGHEPDI7VQHVB4S 2ucmSE84HveoeqiMOEESchIeLImfpaoHAiMesmk42/av1/A2PnnokULRmyjQnAeCexfB QKIX8EoaoHSkeEtsMnmLG2JgN+b0o/Np29rrEgkf1/EG1+dHkE84UM1uHw7XIWhetYmt WRz97bY/+lCKbRE5ZWF/ckH7SQ2KVqSL4rnUgdzp7OLzhkViVGwyKY6AxnRT5pcdwhiC q46Exv+USp2+gh5LtBsph1BX8ACnieWixsBIbqQIR+hveYpWtLES6sljs2cnVg0e6BqI Yy1w== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wu9-20020a170906eec900b007ad821844fcsi8120892ejb.528.2022.11.20.11.49.51; Sun, 20 Nov 2022 11:50:13 -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; 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 S229637AbiKTT1s convert rfc822-to-8bit (ORCPT + 91 others); Sun, 20 Nov 2022 14:27:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbiKTT1q (ORCPT ); Sun, 20 Nov 2022 14:27:46 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EF3717A8D for ; Sun, 20 Nov 2022 11:27:44 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0993460CEB for ; Sun, 20 Nov 2022 19:27:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9362C433C1; Sun, 20 Nov 2022 19:27:41 +0000 (UTC) Date: Sun, 20 Nov 2022 14:27:30 -0500 From: Steven Rostedt To: Xuewen Yan Cc: Xuewen Yan , peterz@infradead.org, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, ke.wang@unisoc.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched/rt: Use cpu_active_mask to prevent rto_push_irq_work's dead loop Message-ID: <20221120142730.4d863176@rorschach.local.home> In-Reply-To: References: <20221114120453.3233-1-xuewen.yan@unisoc.com> <20221117170028.04fd7013@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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 Fri, 18 Nov 2022 20:08:54 +0800 Xuewen Yan wrote: > Let's consider this scenario: > the online_cpu_mask is 0x03(cpu0/1),the active_cpu_mask is > 0x01(cpu0),the rto cpu is cpu0, > the rto_mask is 0x01, and the irq cpu is cpu0, as a result, the first > loop, the rto_cpu would be -1, > but the loop < rto_loop_next, on next loop, because of the rto_cpu is > -1, so the next rto cpu would > be cpu0 still, as a result, the cpu0 would push rt tasks to > cpu1(inactive cpu) while running in the irq_work. > > So we should judge whether the current cpu(the only one active cpu) is > the next loop's cpu. Wait, I'm confused by what you are trying to do here. The rto_next_cpu() only sends an IPI to the next CPU that has more than one RT task queued on it, where the RT tasks can migrate. If we send CPU0 an IPI, let CPU0 figure out to only push to the active mask. Why are trying to prevent sending the IPI to an active CPU? Will the first part of your patch that modifies the cpupri() not keep it from pushing to the non active CPU? -- Steve