Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp699272pxa; Wed, 5 Aug 2020 10:36:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhyeuuDykFqmi6rIJjefTNGDCujSjApJILq8SqBSazQQ98SagKzzMRzhlmPLNIPMhVIwtw X-Received: by 2002:aa7:cdd2:: with SMTP id h18mr304350edw.387.1596648967616; Wed, 05 Aug 2020 10:36:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596648967; cv=none; d=google.com; s=arc-20160816; b=qL3LkbCSegbYmWYqnqQonUZ1lD1a5mfvM0M94xgs6p/nWdZ6PTYywjOcIE8DWmQ9ZY CvfK9Gbs9K2x9WMq4qjHNafSqahf/ATPS5pPWF5ABUVsnHEfb4dqa386QUJdiG59sYAW QMQUGk+HCIfA8oJAfxo6lqbC3zznzDDper5D/gvaaCaR5lHm7bPifN0aaE8MkzVFcMnx 6nBg4mRwLOesqvx3tUP3eX3Wo1bk6Hha9iiVTX0uvTYyuy2zE0lBamIX2uSwqi/IPUPE OEMfcYpzOsunKs1ef/F/e+Jwv6EeEwcX8KxDl+ieYp7FY+03jWheiN5jhXdSA626Ocs6 KIkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=PBC4y/Rehj0gvz/KJuRqUAs+jpyR1vRs+0jy5K0YxXw=; b=hDLVD48kifZHwyvqbWWqXa9w7eObwD/zrkavz0TryqZsKmpAJTkRABnJvHPi7M1rMQ m1w62wSuX36BcwhyeEoxJ1EeUf4NGtwKsQGChd5zqegfXUc3pMaA2ZTg9xZPgTXdu4sZ dONk+PkSTvLGOTsFwNV7rvbu1LuSjcl1Iq4dT2Vidd7gI2oYx/OhcvCUJE1WXZ3SiIN9 bl6+1I6oYLBROrMqxyjctT3F9y6aYpeW2RXK1vr4Sd/7om5Hmt7/9Io0s52SVaXqttNW i/kHF2wJlF5vhrqyFZzyG6Cepe4bQShYyxaGTg1YRtXnz52mFz2iGZMhupw/29o+Nc7q 6eyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p10si1634912edy.86.2020.08.05.10.35.43; Wed, 05 Aug 2020 10:36:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728919AbgHEReb (ORCPT + 99 others); Wed, 5 Aug 2020 13:34:31 -0400 Received: from foss.arm.com ([217.140.110.172]:33806 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728629AbgHER1g (ORCPT ); Wed, 5 Aug 2020 13:27:36 -0400 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 DE2281063; Wed, 5 Aug 2020 05:41:33 -0700 (PDT) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A34A93FA1C; Wed, 5 Aug 2020 05:41:31 -0700 (PDT) Date: Wed, 5 Aug 2020 13:41:29 +0100 From: Qais Yousef To: Dongdong Yang Cc: Greg KH , "rjw@rjwysocki.net" , Viresh Kumar , "mingo@redhat.com" , "peterz@infradead.org" , "juri.lelli@redhat.com" , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Benjamin Segall , "mgorman@suse.de" , "linux-kernel@vger.kernel.org" , "devel@driverdev.osuosl.org" , "linux-pm@vger.kernel.org" , "yangdongdong@xiaomi.com" , "yanziily@xiaomi.com" , "rocking@linux.alibaba.com" Subject: Re: [PATCH v4] sched: Provide USF for the portable equipment. Message-ID: <20200805124128.kfx7uofqnrtk6kux@e107158-lin.cambridge.arm.com> References: <820a185b6765d6246ac34f612faedeb35189487c.1596526941.git.yangdongdong@xiaomi.com> <20200804104331.6vphb2iclwz3buig@e107158-lin.cambridge.arm.com> <20200805095341.cmoxmy47ts3ntxee@e107158-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/05/20 19:13, Dongdong Yang wrote: > Appreciate Qais for your clamp implementation. I would like to add traces > for uclamp_rq_util_with and feedback you if I run into any issues. Thanks. FYI, top posting in LKML is frowned upon. Please put your answer underneath the quoted text. > > The util would not be adjusted as soon as FB screen on notification be > received by USF from kernel level if it is set by sched_usf_non_ux, no > matter whether screen on or off. However, sched_util_clamp_min/max have not > been recovered until user space screen on detection. The screen on response > would not be in time for the sensitive user when many background tasks are > running. Whether the kernel module could also > set sched_util_clamp_min/max? For boosting, are you just changing the sysctl or are you actively using sched_setattr() to boost tasks too? Please have a look at the documentation for the sysctl interface. https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/tree/Documentation/admin-guide/sysctl/kernel.rst?h=sched/core#n1065 In summary, they just control the _allowed_ levels. So you can use it to cap/throttle the maximum performance level the system is running at. But you can't use it to boost the whole system. You must use the sched_setattr() to boost important tasks individually or if all the tasks are in a cgroup you can use that. For cgroup interface there's a caveat. If you want to use it let me know so I can explain how boosting would work there. I advise to use the sched_setattr() interface to target and boost those important tasks only. You can as well be smart and target all the background tasks to cap them via sched_setattr(). In this case you wouldn't have to modify the sysctl_sched_util_clamp_min/max. I don't see uclamp being a suitable interface for in-kernel users. PM_QOS is more suitable in my opinion for in-kernel users if you want to impact the overall system performance. I might have misunderstood what you were saying above. If so, can you please rephrase? Thanks -- Qais Yousef