Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1349526rdb; Sun, 8 Oct 2023 03:58:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbw3KDUnpmGV7ydZkqv0TMH2DhijrWSWGCdSQkVtl87QOnxO176//pTVH7pZB7veA/bcaY X-Received: by 2002:a17:902:dacd:b0:1c7:54ee:c53c with SMTP id q13-20020a170902dacd00b001c754eec53cmr14965153plx.57.1696762698981; Sun, 08 Oct 2023 03:58:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696762698; cv=none; d=google.com; s=arc-20160816; b=UfZS96Cm7NdyMMUSeQiMsTiu4pQaYlnKuFWKWFyzr6Hp70a0OnzAttJNXm+9CCL62R r95vAJisL5HGIQFYWho6wLyGafr1dpZHlM+Gur6ArmIACMUQ+HYigI7DqHcmkS6NMwaS b3I1s+2xpBz2zRL9drCeB3kQpmbeX0OABvtSuSFuCFP4aUsJMILCNVn9CD4bXnu8EN3p FnBzbg7/W0lwkTNPRaktzC+9QPAX5WIh520zuOgIIICccfz+6VKWr1i4b17QFZXYdI49 mWhsFa3HRBDHl/x+0om+2mFxx/hxfp2WF0FSG5kcJgg8hVT7wu3QWfIxVUATlrew6F+q 1iWw== 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:date:dkim-signature; bh=7pI/ahoeLwQta1iBDvRGZESmSgf9li60JTBecFWXMxk=; fh=uRBWUt5VEDSxxX3+yczlCcx0fMd5mTf4+ApuEK11G4U=; b=NhQ2hoY0bQIDXhy3LDGTjU1z7KGmJ4KvH4IhJkImqYn7sXI490kuPlXimgzlRFBgwL VRkXpvlVt1vkvUFHC0xOwsuf42algRTxAe1F1oyRN3xyd7ht6ENQ2+IAEIcj32TL4Yim 1Cq86PXPtEv13HY4hQ/DJ3f7fmDCMVTDEa0gDC/BhnXao9ohViReiL4gN7LixuocTmHj tD9vXwpwAscs/3HzoR6fTqUzQ1TNxIG07kU4mYV6vPdOhAZ9Evoc6Q821gLSQzxgoxvC hCBSVtyydGjQGDSZu+VqGDdwCaT8EFNrlr5TI/tsV8+P0bPyB0JGL7f61CAJIBpZ61lO kbjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=jgzOlfO4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id h4-20020a170902f54400b001c61bd9db5csi5822400plf.317.2023.10.08.03.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 03:58:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=jgzOlfO4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C15D480A5328; Sun, 8 Oct 2023 03:58:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344655AbjJHK6I (ORCPT + 99 others); Sun, 8 Oct 2023 06:58:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344651AbjJHK6H (ORCPT ); Sun, 8 Oct 2023 06:58:07 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32473BA for ; Sun, 8 Oct 2023 03:58:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=7pI/ahoeLwQta1iBDvRGZESmSgf9li60JTBecFWXMxk=; b=jgzOlfO4cO3bnYQRy5enV0Nj+e WPnanc4s50xLJds4z9pWdVpVuHwzAi2FgJDtp+//bEdUaORyFosJt47wlODgy+0CuIaTOSTt6x2Yn +1UIClin7Q1J60m7IXGWfkRpwjbJyeu1AIDFDmIMI113MYYPPVAd+tbWbIqPKbK684eea3iYVCHEk ItEV6Vp3Jve5dKHvIy1ECq8i3hXXD23uCs/SeHMTd0mhhDzIPUkTD14hysoPCgQ+83kTxhc9LihmK 5OyBieTKMQxbDDh+7tCol/hdvB7QbuGyWf1DHOoNH+l9cNrPbE87GswoduqxnvBPtX+ZWJOVy7OQM Gx8QAn6g==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qpRU0-00EeBZ-28; Sun, 08 Oct 2023 10:58:02 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id B7986300687; Sun, 8 Oct 2023 12:58:01 +0200 (CEST) Date: Sun, 8 Oct 2023 12:58:01 +0200 From: Peter Zijlstra To: "brookxu.cn" Cc: bsingharora@gmail.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] delayacct: convert task->delays to a object Message-ID: <20231008105801.GC6320@noisy.programming.kicks-ass.net> References: <531ddc82793a39f4c09316d701a4b1170bcad4ab.1696761522.git.chunguang.xu@shopee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <531ddc82793a39f4c09316d701a4b1170bcad4ab.1696761522.git.chunguang.xu@shopee.com> X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Sun, 08 Oct 2023 03:58:16 -0700 (PDT) X-Spam-Level: ** On Sun, Oct 08, 2023 at 06:49:37PM +0800, brookxu.cn wrote: > From: Chunguang Xu > > Since in some scenarios we still want to get the task delayacct > through taskstats, so commit <0cd7c741f01de> introduces a sysctl to This is not the canonical way to reference a commit. > enable it dynamically. However, since task->delays is allocated > during fork(), task->delays will not be reallocated when delayacct > is enabled later. This will make we cannot get the delayacct of old > tasks, but the new tasks cans. This can easily lead to confusion. > Therefore, try to workaround this issue by convert task->delays to > an object. And grow task_struct for no reason? I think not. > diff --git a/include/linux/sched.h b/include/linux/sched.h > index 77f01ac385f7..5cc78184a31f 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -37,6 +37,7 @@ > #include > #include > #include > +#include > #include > > /* task_struct member predeclarations (sorted alphabetically): */ > @@ -1331,7 +1332,7 @@ struct task_struct { > struct page_frag task_frag; > > #ifdef CONFIG_TASK_DELAY_ACCT > - struct task_delay_info *delays; > + struct task_delay_info delays; > #endif Yeah, no.