Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1926757rdb; Mon, 9 Oct 2023 07:18:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEk2Zl/E1sGc1c5LKasjkF8d0fsaCG0uUhvOYQNfTx1+hoi/rZPjqFau9BzRkAyUZBA7xuH X-Received: by 2002:a05:6a20:5496:b0:133:8784:15f7 with SMTP id i22-20020a056a20549600b00133878415f7mr16255208pzk.14.1696861138611; Mon, 09 Oct 2023 07:18:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696861138; cv=none; d=google.com; s=arc-20160816; b=YaFgNzpKYrFVquOskxsQSdxdDRI9K5lmbxrUvH40fyLbVmSZAAl5FmfPB4VnYcee+4 8s9YDLJHzX1x8U+l7ibZU61/wwAgaQTWqeuIGVM/B2h4y/J24xY1qgfCMe6mhy1duepd JuBOviTtpOYRV1LKiWDigWP35vliFKjL+Rj4AhtkWP0ff55NPV7Z5guIEYXtat11aHYv J8pe0Buu2Q4IqTVbX/wo9DvWbSxKtbeR3g7Q0Y/SiRcIxTrDsdi4IvCvoKped9pF4EP2 Mbj29GS+26ifcYBiXU7BsuOm0BDp+rcVCJgiFs80emZ826dq9YpLeVykssblyzkkskfU LByQ== 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=R/xYt7LuoTIJFEU/NbrEF3ez7zUOXlYRJH/cRSvSwUk=; fh=v/v83w3yRXVx6Zw3G2iB1s8Adj6J8/IaUT/afFw+7Kw=; b=flpngKJoksylqa7sJpL3LbTHM4FsSWi+BXBYBNkI+jt/u+39N47Z/BPTGYEcejGKbc yq5syODFXwj2pwqxq10u93C4ExJx3cISdhPRjk2VjgLnz6h8XDE72nd/TlipOaCtgkQR NtXnnhP4NoeIUa22Fkmw7ncfeChjxjCF43HQRWQiAgWuL+gkrgLU7TrZ1Af1VUpohDd3 aj5fGI63uHUK9B/9Q+HEiXtB8SdaKrG5BCtutrR89LZZYJ0hGioUlfWZP4aoJutA7F00 iYBUqtgJp/vD1rnbHDisQEA29x07tqa3ZOAPcACCBsjjfP0CDjVcdzlciYI8Vy7yZLE8 X72w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=BtUeqwsZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id q20-20020a656854000000b005891f64e424si9569811pgt.785.2023.10.09.07.18.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 07:18:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=BtUeqwsZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id D207080FC148; Mon, 9 Oct 2023 07:18:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346491AbjJIOSq (ORCPT + 99 others); Mon, 9 Oct 2023 10:18:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234553AbjJIOSp (ORCPT ); Mon, 9 Oct 2023 10:18:45 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B36749D for ; Mon, 9 Oct 2023 07:18:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=R/xYt7LuoTIJFEU/NbrEF3ez7zUOXlYRJH/cRSvSwUk=; b=BtUeqwsZc3eE9fG63OiyMu11V0 InoTFNpndJVXehKx3ScVlszPc/C1nOYdV4drsq5z4NkmEC6BUpSxQD/oa5G25cMlIgdnEdNc7oITZ EJ+/vwOWFC+ohDBOr/9eReLKjgUQGDep8xwu4wyKPK5OHcI5gI7Wx748dFNjqY0yuJX/rYcY/i4sA +JmbB+X71/+npwF0RoXynhSC+BM9gJ2KwBjjr42HcAYoJBs8ZomCtE899IhP4K8JZZ6TWURNLaDNI W2alVFRxKaydCH3JbF6Nn/ht6hK683X+F28ZqOLfWJgwEJUtZIJOIQ07e/CngbJBrhvZw9/yNYlAd QstJTiOw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qpr5m-00GI81-Cl; Mon, 09 Oct 2023 14:18:42 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id CB579300454; Mon, 9 Oct 2023 16:18:41 +0200 (CEST) Date: Mon, 9 Oct 2023 16:18:41 +0200 From: Peter Zijlstra To: brookxu 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: <20231009141841.GF14330@noisy.programming.kicks-ass.net> References: <531ddc82793a39f4c09316d701a4b1170bcad4ab.1696761522.git.chunguang.xu@shopee.com> <20231008105801.GC6320@noisy.programming.kicks-ass.net> <5dba07eb-88f0-bf84-494e-b979f32ad44d@gmail.com> <20231009084341.GA14330@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 09 Oct 2023 07:18:55 -0700 (PDT) X-Spam-Level: ** On Mon, Oct 09, 2023 at 07:38:58PM +0800, brookxu wrote: > I found another question when I tried to allocate task_delay_info on demand, > it is hard for us to > > determine whether tsk->delays is NULL due to memory failure or delayacct > disabled, if due to > > memory failure I think we should not try to allocate it again, otherwise we > may have performance > > issues, such as following code. If we limit only try once, the code is very > trick.. Yeah, I wouldn't worry about that. Not until it's shown to be a real issue. First do the simple thing, only make it more complicated if there's a real need.