Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp854898rdb; Thu, 30 Nov 2023 23:33:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHrmXX5Y8fxP37h+EUrVS05pRoeVR5Lqx+Yr9Kwsws+olXLIS9CV15tqRkOwLB8AOTOKIiB X-Received: by 2002:a05:6a20:daa6:b0:18c:a8ee:b569 with SMTP id iy38-20020a056a20daa600b0018ca8eeb569mr17364778pzb.43.1701415984947; Thu, 30 Nov 2023 23:33:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701415984; cv=none; d=google.com; s=arc-20160816; b=sErP6DTmVCZfMQggz4U9gq+IW4OXR36xnwL22JMBNeWlz+lZF9JW2+L49FMKqN6fks w9MSMxA+d9Ytv/1rx/F0WQX913JKwf4flP5lChWxt4v8ahKUtMHH3MaQHMWVNJ318woS vML2ZIhfoL4x1rvpqvtvoesN9lTRUAO9yHPAIiduJsUMs3d/sTOQ4l/aU1CjWxq+3WNu kPrcdkWI5UuRPcN1IR3VndzURi3mcudcTku5MUJd2NZI2RYFq3Hxk6PhrFrcDQDEBqNc Tfiw9yrvgWRo23n957f26Xr4X3YHeon56CqMaIRweRUnCABNKJ5RTbsOUM16A3WUS389 g0NA== 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=7JGQhu3NivPunIx5KnuuVf3R1zT5VkSIWh1vBJFWh1o=; fh=tljoCh6h0nkUpSJAIYdx1U+YiTBrRT89A0TvZopscFY=; b=eQ+9O+deIQHfQ6wQPrpHHQhazzabKpRRAez8LU7E9OZ7iO+Xpi0LLY5usKEUDUzrh2 0AOlr3uJ36Ll4eCfFajl3CDhCa8vOK00Pd+Ljbkbe8n8/yXkj3zAC/IL33zaXpn32nha n54oQtTO/vsgiZYwhm3Sz7JzXr6OD4dmhELqDVUKgmPnR3ahOiGok9xrd+TMA08cOaDX D4rZHpljJg9uR1Q0q8TmQh/Y/L0Z5ouRoVCqBQ2Rn0BmOfdzU0N9F5M1qNr4N4+5h9Jd /uJPal92zSGDeotyJXkZ3p5PdpKNitfwwr9qJPkn3cI5GLADcI5rPtj5oKZJ3WAGiw+Q 8PXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=bc2j0hF7; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Ab0eWEnq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id bx41-20020a056a02052900b005c5e2ac7c3csi3106973pgb.732.2023.11.30.23.33.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 23:33:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=bc2j0hF7; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Ab0eWEnq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 9C0A480C9A70; Thu, 30 Nov 2023 23:32:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229692AbjLAHck (ORCPT + 99 others); Fri, 1 Dec 2023 02:32:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbjLAHcj (ORCPT ); Fri, 1 Dec 2023 02:32:39 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EA42194 for ; Thu, 30 Nov 2023 23:32:45 -0800 (PST) Date: Fri, 1 Dec 2023 08:32:40 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701415963; 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=7JGQhu3NivPunIx5KnuuVf3R1zT5VkSIWh1vBJFWh1o=; b=bc2j0hF7SfZX3n+43QgHUcHlvqdJrr0GRiB22ACvz7ewq1rVn83TV9j0SU9WmtozJrBts6 j2X3a7o9yaGnyuhmW+Gx82bdiwf1LxiYS9HYd5ke04oz8ouygh3qem1QrYjG16xQx2UL3q DCUfKo/f26bT5izNqMemDHoOe7FoJXzuZFHYv5KHMMy0JwofHLyqmOLtPZZ0euoZ8tP42z CAlaITWYlPoSHckURmRS3Qk857cF3y7E2iQC6WxRlzA1/Zlna9x+JuGgJYLgoYOt51anaM G4xZ/JxlsbpsfrY2nE+fEzOA2SRcLHYJu+cYroK0KE4dBFSAYY1zRpu8mVk0og== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701415963; 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=7JGQhu3NivPunIx5KnuuVf3R1zT5VkSIWh1vBJFWh1o=; b=Ab0eWEnqeEJ8Um5BDNuqesjmhr21s5Ju/Kp6OKqrpjgCsi4ip7ah1ZlB8jC7ecQyWLTjq/ mAc+BTVTvqoNAtAQ== From: Sebastian Andrzej Siewior To: Yuanhan Zhang Cc: rostedt@goodmis.org, tglx@linutronix.de, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, zyhtheonly@yeah.net Subject: Re: [PATCH v2] sched/cputime: exclude ktimers threads in irqtime_account_irq Message-ID: <20231201073240.T9bFNCkU@linutronix.de> References: <20231127130754.3affb908@gandalf.local.home> <20231130094130.GA12116@didi-ThinkCentre-M930t-N000> <20231130120036.5EpZn4eo@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Thu, 30 Nov 2023 23:32:59 -0800 (PST) On 2023-12-01 15:27:39 [+0800], Yuanhan Zhang wrote: > Hi Sebastian, thanks for your reply. Hi, > Sebastian Andrzej Siewior =E4=BA=8E2023=E5=B9=B41= 1=E6=9C=8830=E6=97=A5=E5=91=A8=E5=9B=9B 20:00=E5=86=99=E9=81=93=EF=BC=9A > > > > On 2023-11-30 17:41:47 [+0800], tiozhang wrote: > > > In CONFIG_PREEMPT_RT kernel, ktimers also calls __do_softirq, > > > so when accounting CPUTIME_SOFTIRQ, ktimers need to be excluded > > > as well as ksoftirqd. > > > Also add this_cpu_ktimers to keep consistency with this_cpu_ksoftirqd. > > > > I'm still not sure what the benefit here is. It says align with > > ksoftirqd but why? Why don't we account softirq time for ksoftirqd (and > > should continue to do so for ktimersd)? >=20 > That is my miss. When CONFIG_IRQ_TIME_ACCOUNTING is enabled, > ksoftirqd is counted elsewhere (where ktimers should also be aligned). > Please review my later patch v3. What is elsewhere? > > ktimers runs almost all the time in softirq context. So does every > > force-threaded interrupt. Should we exclude them, too? >=20 > For force-threaded interrupt, it counts on CPUTIME_SYSTEM > instead of CPUTIME_IRQ nor CPUTIME_SOFTIRQ. > To me, it does not quite make sense, I'm also thinking of sending a patch > of this, but IMHO it should not be considered in this patch... Sure. I was just curious what is different with ktimers/ksoftirqd which run mostly in softirq vs threaded interrupts which do the same. Sebastian