Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4007187ioo; Wed, 25 May 2022 12:41:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGhDP3BlA7AofzvhD7tB9owzSDm9XA0h1yRIqYoGTeQqj4k1xvqjSVA/Xm98gnzlBZ1XTW X-Received: by 2002:a17:907:a088:b0:6f4:f661:f77a with SMTP id hu8-20020a170907a08800b006f4f661f77amr30644538ejc.77.1653507695482; Wed, 25 May 2022 12:41:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653507695; cv=none; d=google.com; s=arc-20160816; b=kdiZCpX029mHB5eHuUhNJroQGV0P/eRkVrXj3jab13MWKCu1RnnnVBuZ9akFhas9s+ sQBODkSaB0WmsIxRUdyoNjqeVuv3eTnw6lFgF0GxqkRdymZezXhWSkZ3iwqN1RUyLk6P 9v8vEbPgDsQ6dPvMLw7mtJSbKF4XOqwn1LmTPdzVYri5xuCh85c+MXQSPBjtMSelprmr YOH+WwI1njgrNzgRyhqwTaQ+1DSz1L/jboWlWPwHyBoCf4Dmhq0Rvq03duXrftCECCfn n+YF3EjIA+6RqwIdHfSXuOafvXW6VuVNLudIXC6S35HYA5Y8NxEsnMGmrC3Re0tQFgro /wPg== 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; bh=Tje26vtvfMlZqmLjxxioF9yB1MYw7C9WV63VEGOurGg=; b=E3OgPgqdc93K2pxwYBk8RQ0HePpccrN5+PVOXcde6+Xfc0tCyOV+YQm9sQnRgYbQTe yhfg3KXmq8+k/olj0qA/XwW/zbbEFCKTfV7E4TsWT7ozSy1OUPi9v+NsGWxMVY90XeYy b/gEIGvWorzQMufvQkjQ5KTZOhZIO3pDWXoFwsZ2FMVi5TNWhlj8sOaXrEgE/SbsfOVg EUxSWqSI4HytMVC0KjuZq1JWbEm1JC7ta3ukqvHQ4MqDfzAFupza/l/GVLGa9ziC9oPT wvN+gOSWpzBQWW8EQr2TuGhmwHY1VewVfSRJa9+A/lXUZyH8fFnPNubKI3MUdSfptIpy mfGg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm22-20020a170907949600b006ff14d38e93si2254984ejc.308.2022.05.25.12.41.02; Wed, 25 May 2022 12:41:35 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245124AbiEYPaI (ORCPT + 99 others); Wed, 25 May 2022 11:30:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239805AbiEYPaA (ORCPT ); Wed, 25 May 2022 11:30:00 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1A5332F03F for ; Wed, 25 May 2022 08:29:58 -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 650E41424; Wed, 25 May 2022 08:29:58 -0700 (PDT) Received: from wubuntu (unknown [10.57.65.214]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 11A563F73D; Wed, 25 May 2022 08:29:57 -0700 (PDT) Date: Wed, 25 May 2022 16:29:56 +0100 From: Qais Yousef To: Paul Bone Cc: linux-kernel@vger.kernel.org Subject: Re: Scheduling for heterogeneous computers Message-ID: <20220525152956.5oz2chfwlgevvaul@wubuntu> References: <20220308092141.GF748856@aluminium> <20220321121611.ssa7o2npy3ahdofk@wubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 Hi Paul On 05/24/22 15:23, Paul Bone wrote: > Hi Qais, > > That's excellent. > > I'll definitely check out those links. This could be very interesting for > people using firefox on a phone/tablet, where we can run background tasks with > a lower UCLAMP_MAX If you're running on Android, you might find that you won't have permission to use uclamp directly. Android restricts access and requires you to use higher level APIs sometimes. And I'm not sure if they have API to allow you to do what you want. I've seen they have the concept of creating Foreground and Background jobs in one of their Google IO presentations. But not sure if this will be tied to uclamp_max. It might give you similar results still though regardless of the underlying mechanism. If you're running on mainline kernel, then the biggest issue you might encounter is that sched_setattr() syscall is not part of any libc yet. So you need to create your own wrapper - look at uclampset for an example. Laptops can still benefit from this by the way. Hopefully everyone is moving to schedutil by default which is a pre-requisite to using uclamp. It can also help in SMP environments to avoid driving frequency high for tasks that don't really care about performance but otherwise busy. You can also use UCLAMP_MIN to boost bursty tasks that are not busy but require to get work done within a certain amount of time and DVFS delays can prevent them from running at adequate frequency. UCLAMP_MIN will ensure they always perceive a performance point specified by UCLAMP_MIN at a minimum when they wakeup. RT tasks respect uclamp values too. You can opt-in to run at a different frequency than MAX frequency which leads to high power consumption on battery powered devices. RT tasks always run at constant frequency, so need to be controlled with UCLAMP_MIN only. Happy hacking ;-) Cheers -- Qais Yousef