From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8126CECAAA1 for ; Fri, 2 Sep 2022 07:53:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234651AbiIBHxn (ORCPT ); Fri, 2 Sep 2022 03:53:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235271AbiIBHxi (ORCPT ); Fri, 2 Sep 2022 03:53:38 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 58296B5A4E for ; Fri, 2 Sep 2022 00:53:37 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1411DD6E; Fri, 2 Sep 2022 00:53:43 -0700 (PDT) Received: from [192.168.1.162] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B7EB23F766; Fri, 2 Sep 2022 00:53:34 -0700 (PDT) Message-ID: <6281126b-3b93-86fa-25d6-d637b6c7dd87@arm.com> Date: Fri, 2 Sep 2022 09:53:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [RFC PATCH 1/1] sched/pelt: Introduce PELT multiplier Content-Language: en-US To: Peter Zijlstra Cc: Ingo Molnar , Vincent Guittot , Morten Rasmussen , Vincent Donnefort , Quentin Perret , Patrick Bellasi , Abhijeet Dharmapurikar , Jian-Min , Qais Yousef , linux-kernel@vger.kernel.org References: <20220829055450.1703092-1-dietmar.eggemann@arm.com> <20220829055450.1703092-2-dietmar.eggemann@arm.com> From: Dietmar Eggemann In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/08/2022 12:02, Peter Zijlstra wrote: > On Mon, Aug 29, 2022 at 10:08:13AM +0200, Peter Zijlstra wrote: >> On Mon, Aug 29, 2022 at 07:54:50AM +0200, Dietmar Eggemann wrote: >>> From: Vincent Donnefort [...] >>> +extern unsigned int sched_pelt_lshift; >>> + >>> +/* >>> + * absolute time |1 |2 |3 |4 |5 |6 | >>> + * @ mult = 1 --------****************--------****************- >>> + * @ mult = 2 --------********----------------********--------- >>> + * @ mult = 4 --------****--------------------****------------- >>> + * clock task mult >>> + * @ mult = 2 | | |2 |3 | | | | |5 |6 | | | >>> + * @ mult = 4 | | | | |2|3| | | | | | | | | | |5|6| | | | | | | >>> + * >>> + */ >>> +static inline void update_rq_clock_task_mult(struct rq *rq, s64 delta) >>> +{ >>> + delta <<= READ_ONCE(sched_pelt_lshift); >>> + >>> + rq->clock_task_mult += delta; >>> + >>> + update_rq_clock_pelt(rq, delta); >>> +} >> >> Hurmph... I'd almost go write you something like >> static_call()/static_branch() but for immediates. >> >> That said; given there's only like 3 options, perhaps a few >> static_branch() instances work just fine ? > > Also, I'm not at all sure about exposing that as an official sysctl. > > How about something like so? [...] > void update_rq_clock(struct rq *rq) > --- a/kernel/sched/features.h > +++ b/kernel/sched/features.h > @@ -101,3 +101,6 @@ SCHED_FEAT(LATENCY_WARN, false) > > SCHED_FEAT(ALT_PERIOD, true) > SCHED_FEAT(BASE_SLICE, true) > + > +SCHED_FEAT(PELT_M2, false) > +SCHED_FEAT(PELT_M4, false) The sched features interface would definitely be much less official but I think it's not useful for Android since they don't mount debugfs anymore. [...]