Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp494895rdb; Thu, 2 Nov 2023 09:21:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGsgFM9RO3CUpyh3L9upeV4rVst7LRH90mj5L3Xy2hozXhq9/xTNIT7vTmlNAvkxFA14e0e X-Received: by 2002:a05:6a20:e101:b0:181:b23a:b88c with SMTP id kr1-20020a056a20e10100b00181b23ab88cmr1864264pzb.49.1698942083106; Thu, 02 Nov 2023 09:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698942083; cv=none; d=google.com; s=arc-20160816; b=lHiwACb4f1DJD9f8BaSoCNnh7O74jJHgtD5WHv1v7VJ74NYGxS2pDqFAFRWf25JUDp aH/9mRvoLp/EkOB4zL3NZ8rjypw4EkF04vFm+wnxuGfK3NXAKGg8VUTa3sidX3H1t207 uv9S/Wgk6r5+BFvVsmoXUy4gZlO4Frn9gIq7eilgAhozP6JQsz5hiMC4+HpITNx4axxL BOVYfdCUj2n37yNnrIjAvA2LJTCxvSeZUm6EzYrJgtq6mV87zdyOPMiqf4zjSzVr8SXr hdtULUZptphRvpKD1IL8aUHEtmGF1h7ArkVUi1lvL4vddDTH4o4JBCKkxSQDdw5IJiR/ OhKQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:dkim-signature:date; bh=wvFTteVbImxdySo7jFzcYlYpzDRgsvn6yjCySuFzuTA=; fh=AAi1c2n+AQUd20JXMJ/vffB5iHiQo5C4nbcf74peWDc=; b=MKQNXMFmzA96wVTBD1STFKSs1FdpcsAbUJpFhAoNyFm0rV7fwA+4qJj53a0TWA6FLw rrMRjJ7hQL34QE7XqifeZf0qmGEwFe3wRbQupY067aZyC29Ca9Bn/lr3X+TXqdqzR/sj d24WKRmV6csIh2wjY31b2KEeIYQa+yTi0ZCdUM1IrI/wly+f0bLM3W5QaEFk9aldWWp8 4sqxTa0Yq8y+IyzbeBjPgIOJhUSS0q+fBr3F/o6gEsbTQqKdRLRKI0YjKG95PFWT6vXF NlqH2tG5qfFmPStihdaIkDwgfHOP95sGLWhGBVldM+RjCCsnjDLoxyZwxgzKLqEcmlLN kixA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=W4tBgJ39; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id p18-20020aa78612000000b0068e3baee27esi65959pfn.266.2023.11.02.09.21.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 09:21:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=W4tBgJ39; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id E48268183EEC; Thu, 2 Nov 2023 09:20:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347613AbjKBQUA (ORCPT + 99 others); Thu, 2 Nov 2023 12:20:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbjKBQT7 (ORCPT ); Thu, 2 Nov 2023 12:19:59 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4D0513D; Thu, 2 Nov 2023 09:19:52 -0700 (PDT) Date: Thu, 2 Nov 2023 17:19:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1698941991; 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=wvFTteVbImxdySo7jFzcYlYpzDRgsvn6yjCySuFzuTA=; b=W4tBgJ39n+qAv+2rq/lBP9MtwEYtvfMqMMY5ZPBN6Ml1YrfSv8jqA3iBTY3pWUROgl2uk2 gBkcEXmhUy7OUo7QJNzo0GxSIK7vOWuU3oRxEtqZ9MYo62hrMs565r+7ALTpDG6137GXZQ JMz18ogKSAEYdVecdAFXfx6emFN5W6Bzyljt5KYp7UvNsz2caQekcU6SSz/vzg83CkF/3i y7UNTgZoRxExA3AGPXKeofTBUPe6vZolDA3vUkLbwjDhE3QU11FEu5NKeft/Pw0GgX0Qv5 SnaB2jSmF8HzAKHwVrTUfL47Af53eLQ4n1T4HQNwi60Th9C/NqPkgifkv1hGUw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1698941991; 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=wvFTteVbImxdySo7jFzcYlYpzDRgsvn6yjCySuFzuTA=; b=kqzWP+CBNF9w1Lcir2gCG+4QbYWBS0ORPIlD4oJyaKXzYzgn3OtC02M0sNlsF9OsPfN9LL D3AYxz34xQfDWzDA== From: Sebastian Andrzej Siewior To: Peter Zijlstra Cc: Valentin Schneider , linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, Daniel Bristot de Oliveira , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Steven Rostedt , Vincent Guittot , Thomas Gleixner , Tomas Glozar Subject: Re: [PATCH] sched/fair: Make the BW replenish timer expire in hardirq context for PREEMPT_RT Message-ID: <20231102161949.IdSqSK2E@linutronix.de> References: <20231030145104.4107573-1-vschneid@redhat.com> <20231031160120.GE15024@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20231031160120.GE15024@noisy.programming.kicks-ass.net> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 02 Nov 2023 09:20:13 -0700 (PDT) On 2023-10-31 17:01:20 [+0100], Peter Zijlstra wrote: > On Mon, Oct 30, 2023 at 03:51:04PM +0100, Valentin Schneider wrote: > > task would get PI'd to FIFO1 (ktimers' default priority). Unfortunately, > > rwlocks cannot sanely do PI as they allow multiple readers. =E2=80=A6 > I'm thinking working on that is saner than adding this O(n) cgroup loop > to hard-irq context. Hmm? I have plans to get rid of the softirq issue and the argument for "bad" or inefficient rwlocks is usually "get rid of rwlocks then". So=E2=80=A6 Then I looked at the patch and it only swapped the flag nothing else and this hardly works. So I looked at sched_cfs_period_timer(): | static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer) | { =E2=80=A6 | raw_spin_lock_irqsave(&cfs_b->lock, flags); =E2=80=A6 | raw_spin_unlock_irqrestore(&cfs_b->lock, flags); |=20 | return idle ? HRTIMER_NORESTART : HRTIMER_RESTART; |} Judging by this, the whole callback runs already with disabled interrupts. At least now it enabled interrupts if multiple callbacks are invoked=E2=80=A6 Sebastian