Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp816030rwl; Thu, 10 Aug 2023 01:55:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFHDSkYg390sDGapVGY5ytFjY6sieupvGsOfRWEPu1j1p9IQmqXBUm0ZT9lICakTGGFOH1U X-Received: by 2002:a05:6a20:3214:b0:13b:cc09:a547 with SMTP id hl20-20020a056a20321400b0013bcc09a547mr2038841pzc.36.1691657754690; Thu, 10 Aug 2023 01:55:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691657754; cv=none; d=google.com; s=arc-20160816; b=x6A0hnQ9yaHLChgb6nrbt5bruUC9zuQeFh6ZvFgFNiCdyu8nprDxrfXUAQg2DmvR4u U3K4cONypLFHg0EUpI0fsgEs8NnIX6hzRh7gBDQqCyWHuQQ5gITtpY80HrZTFpPOKb38 L3X5wFdbOxFBVaxORcmwkuP3S1lJ7wYQM7zp12S7tHkp7ubZmJaPPInXlXC+rD8DrQaz BBFbiQBsSC+HBoE0V8EUFa6nh9F4CSToIM5dB7rwzHUiSSbCIvPDKrOu69V5BaYW0GKZ WBpPBiOSsi3msEK3aBJnFzgp7CEtJrORhWIewvxZ7SammrosFGMEGOdZaBl2PYa9ai9x Fqzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature :dkim-signature:date; bh=byhvTeVftWnA3njnzkG9bxMKWEmXEW6/8WQvkjYEvpQ=; fh=/HcB+RLGzPnS+vrTBwdsuUnvCSEQmtuFMXjgxtc/sak=; b=URHPvm4l6ckp/tAZt66xj9t81D0zn8i3tbYN5vXQMlHpDX4UVacUIxjHhfvkd7Bkhv Pi4Shn8EXlV7rbhusmWqmlEY+Az6Tb17IAKK4n83p2LBe0X4jSUApVw7iWFvw5UHjvSy 82w/641zCljOd7TT4Akpbx2+hcIQaU2iMKl/1AySaWGmrwC176pzwGuDyYtHTZqUBgYd 7tIHCgeuTzgvjdp5c0eRhzkfvEFuC1kxZs7OpYQ0PdRcZfNBQyHeTQAh3S9bVYJVG9ot ScYF07BYM5SjtPXHp5vEs970mE/LgxHervkmO+pvwu2eLd2TuHNcmBaAqH7ZkM7g4zlQ fpqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Hs4zWaIl; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 l14-20020a170903120e00b001bb2d95f2a7si1107124plh.267.2023.08.10.01.55.42; Thu, 10 Aug 2023 01:55:54 -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=Hs4zWaIl; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 S231330AbjHJIHN (ORCPT + 99 others); Thu, 10 Aug 2023 04:07:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229834AbjHJIHM (ORCPT ); Thu, 10 Aug 2023 04:07:12 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23598F7 for ; Thu, 10 Aug 2023 01:07:12 -0700 (PDT) Date: Thu, 10 Aug 2023 10:07:08 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1691654830; 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: in-reply-to:in-reply-to:references:references; bh=byhvTeVftWnA3njnzkG9bxMKWEmXEW6/8WQvkjYEvpQ=; b=Hs4zWaIlwuYV6liu4Tx97x8Hgt404JQEDd/hyGf1UNcke47l7xNdxJN48WC80bd5aNIvY7 Ww8RxI4TBPxzhSU89xsRkY9uFaMJ0SqXZgMm5YZUsbM1fGta/w9ymtxjR0+yDcwC5Mums6 N7OsvHRC9Hsy6ewoZJO2f+AmODNfYwDCcSn1Y7KezVFxxp53CDzhwNyx1R1AYxT1c44sGj vKBLz9lQskFH+jVHR7MVYZMkfmfwB4jTONP7XSacJUDGJvFa5XaUL2eI8jTTu4Fpyba8L9 HY/Wc5QBItR4BLRMy3qKzCMgKQTYXvvVTjq4t2uHyi0iLaGqSPq5xXw7WrN9dA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1691654830; 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: in-reply-to:in-reply-to:references:references; bh=byhvTeVftWnA3njnzkG9bxMKWEmXEW6/8WQvkjYEvpQ=; b=AkdV8/JRBnt/3WHW6KVtAODScCsMgy+2Mhm2KLXeI7IIhQXpGKO5yNvWAQqO6xm1+IlKgt zlt+g6eaRUszzMBg== From: Sebastian Andrzej Siewior To: Valentin Schneider Cc: linux-kernel@vger.kernel.org, Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Steven Rostedt , Vincent Guittot , Thomas Gleixner Subject: Re: [PATCH] sched/rt: Don't try push tasks if there are none. Message-ID: <20230810080708.L4nV_aKI@linutronix.de> References: <20230801152648._y603AS_@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 2023-08-09 18:02:32 [+0100], Valentin Schneider wrote: > On 01/08/23 17:26, Sebastian Andrzej Siewior wrote: > > I have a RT task X at a high priority and cyclictest on each CPU with > > lower priority than X's. If X is active and each CPU wakes their own > > cylictest thread then it ends in a longer rto_push storm. > > A random CPU determines via balance_rt() that the CPU on which X is > > running needs to push tasks. X has the highest priority, cyclictest is > > next in line so there is nothing that can be done since the task with > > the higher priority is not touched. > > > > tell_cpu_to_push() increments rto_loop_next and schedules > > rto_push_irq_work_func() on X's CPU. The other CPUs also increment the > > loop counter and do the same. Once rto_push_irq_work_func() is active it > > does nothing because it has _no_ pushable tasks on its runqueue. Then > > checks rto_next_cpu() and decides to queue irq_work on the local CPU > > because another CPU requested a push by incrementing the counter. > > > > For a CPU to be in the rto_mask, it needs: > > rt_rq->rt_nr_migratory && rt_rq->rt_nr_total > 1 > > But if that CPU has no pushable tasks, then that means only the current > task has p->nr_cpus_allowed > 1. > > Should we change it so a CPU is only in the rto_mask iff it has pushable > tasks? AFAICT that should not break the case where we push the current task > away due to migration_disabled, as that still relies on the > migration_disabled task to be in the pushable list. Sounds good. The task with the highest priority becomes pushable if it gets preempted (by a task with higher priority). This gets considered, right? Sebastian