Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31165720rwd; Thu, 6 Jul 2023 17:09:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlGcNeUwW2avnt3JKcRB+09tGjVJKv/drlRoRH8SRUdkJ20jFtNZEefhaOjo9IKGA8BF4vIm X-Received: by 2002:a05:6a21:9988:b0:12f:46ef:a76f with SMTP id ve8-20020a056a21998800b0012f46efa76fmr3310792pzb.41.1688688569726; Thu, 06 Jul 2023 17:09:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688688569; cv=none; d=google.com; s=arc-20160816; b=mKbAG2q2Rdj6+XTKfm1+hL6IrIV5MkYW+IRJF4VOhMP9rAcCncAas4WMm2oCFZIEMz 5YGKkGvfudImTMqDpavu5oIJ+8bvqnNVZnb7Qxdl4D8l0Js2hQ8ob0Ph5HeSVmjDywbZ b2Cv63n3yz21P8Iijvz9PH5uhi+7UwxhBbFAuyoMdj2ws+g2VllXRb9zWnmlpGiwfdt2 IPx93qzwsmEvt/9WKSTRo2IgrxhH0b+3EkS3DabMqloxy4ZLE6FQJekJ7lDUCcTzUemW R+L5DYFOcRfslG9mPHelDpt+z2u2uAYnqnKtNG3Xz0BLKQVacZ3JkEHUjTOd/8tNiDo8 l44g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=yd4tdV3MuPuZUoHI1ZbvsPmOzuAV7z04rHvKL/AEFeo=; fh=vwrLIi/0Esz7rfh4LPvFmLWv3aIE4ofD7tnD0DA3HDw=; b=XZXAvgbgIJgs00ta/WZW5mh2UQyHcXrXi6S6uzzNPaiSOcMkqovgqvSQEniI1RaLDD 6IXU4UeSpZzuyypq4A81/j1YcpS41CgXrZIjRPusQU4VtCmaQZNSFdnt1bk+nZ4UMRy5 s7lVdgNDHVDTOUAu0yOTzaGHPzjoax//MOrGcnwmD75fkib9JNSdyfP3vkUxlFpTUt+3 99f6dOfp/Fh832QMCNnwMPh4a1Vdc1HOWZlud7yDb0DLvIb55V3CJtHeQWMXRGpgAQh8 lN2wmhHCk5MWnhU3wcfx/P92ehQjDWa1lqClNDZAn//DWAwvD/Uiz1gZvumRSEI8UTe8 PUDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d1jzLILO; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kv8-20020a17090328c800b001b3ac2cdacasi2055714plb.553.2023.07.06.17.09.13; Thu, 06 Jul 2023 17:09:29 -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=@intel.com header.s=Intel header.b=d1jzLILO; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231281AbjGFXiU (ORCPT + 99 others); Thu, 6 Jul 2023 19:38:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbjGFXiT (ORCPT ); Thu, 6 Jul 2023 19:38:19 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 511D81BE9; Thu, 6 Jul 2023 16:38:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688686698; x=1720222698; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=0JKvud1PQdDP/vY9wglSJ4Q5ihblqLm8EVHVndBkp7Y=; b=d1jzLILO73L2R7BUXqAgjMhI0WKZe4bZ11FS102lu4ZwtmcYwTAEZ0wu uJ+7x54sesy4Wv+wTcNONGg5n8j9rvdrotcZBURS934ehcMzfR67TDLsS kPHmAjRza8/MKeSDELl3Opjy5nw+qjzVwCeXeV0aCJejOHRbuEac71dr4 1nYgMHX/DP4SbMTNDsNG/wqOJLKFPx4DF6faMUrIqmCT4hI37BfGdMJsM RfUNP+7Pi4tOoSqMpQHOHL3LUb1KLYz1VgR/mdAgvIn9pdEX7s0u94cqx yHSIoCaqV/hEqZfI+tnXiBq61fHR6wKVGTJ0x7QFQkfg7zjUaeCADDN8d w==; X-IronPort-AV: E=McAfee;i="6600,9927,10763"; a="348550714" X-IronPort-AV: E=Sophos;i="6.01,187,1684825200"; d="scan'208";a="348550714" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2023 16:38:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10763"; a="754927658" X-IronPort-AV: E=Sophos;i="6.01,187,1684825200"; d="scan'208";a="754927658" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by orsmga001.jf.intel.com with ESMTP; 06 Jul 2023 16:38:15 -0700 Date: Thu, 6 Jul 2023 16:40:59 -0700 From: Ricardo Neri To: Tim Chen Cc: Ionela Voinescu , "Peter Zijlstra (Intel)" , Juri Lelli , Vincent Guittot , Ricardo Neri , "Ravi V. Shankar" , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Len Brown , Mel Gorman , "Rafael J. Wysocki" , Srinivas Pandruvada , Steven Rostedt , Valentin Schneider , Lukasz Luba , Zhao Liu , "Yuan, Perry" , x86@kernel.org, "Joel Fernandes (Google)" , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, "Tim C . Chen" , Zhao Liu Subject: Re: [PATCH v4 06/24] sched/fair: Collect load-balancing stats for IPC classes Message-ID: <20230706234058.GC12259@ranerica-svr.sc.intel.com> References: <20230613042422.5344-1-ricardo.neri-calderon@linux.intel.com> <20230613042422.5344-7-ricardo.neri-calderon@linux.intel.com> <20230624000121.GA32639@ranerica-svr.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 Mon, Jun 26, 2023 at 12:52:59PM -0700, Tim Chen wrote: > > > > > > > nit: the comment is unnecessary, and a bit misleading, IMO. > > > > > > The comment says "This group will not be selected." but the only way to > > > guarantee that here is to reset the sum_score to 0 when you find an > > > invalid score, which I don't believe is your intention. > > > > You raise an interesting point. We will call this function for each rq > > in the sched group. Thus, if we encounter an error, the scores would be > > incomplete. Therefore, I think that the scores should be discarded and > > reset to 0 so that they are not used, IMO. > > Since we still have other rqs to loop through, reset to 0 here does > not guarantee that it will stay that way at the end of the loop when > the sum could still be added to. That is true, to discard the would need an indication that we should not keep iterating on the runqueues of this group. > May need a special value like -EINVAL > and make the score a "long" to mark such case. IIUC, unsigned longs allow to handle negative errors if you use IS_ERR_VALUE(); but yes, it looks odd.