Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp483348pxu; Wed, 7 Oct 2020 08:06:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAnqf7brfUpC67PT9IcTOu7eG2o1RI5J8jg0ZYZbaKiMdom5pNyiAXm32w5QNrPKhKxTNI X-Received: by 2002:a17:906:234d:: with SMTP id m13mr3843479eja.497.1602083171679; Wed, 07 Oct 2020 08:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602083171; cv=none; d=google.com; s=arc-20160816; b=OUID+nK5Mk1PA50NZfFjjWHKyqPwZ98nEwuj+rs+pY8hXyLD8Owjj9Do+AV06s6ygB DiubolFjytN6puBQDOz3t9/tJRYeAEVT9EJZO3d5WMPmoZGjom5NoLPeKsuIQaorQW6c o0wg65aPV+x03q2Hsbsb8FYqNFz6xlmYHKwVj3SXdl2G1Q3AXIUDk9k73zX9g3Gq+lXl F/P5D8H5atKHNOSFIdvJsA1Na0wb5i8LCmd6IrY94EcS9I7RTxeP49t+9dJN1xZm+KQU p8rrlXq/gZMgUEaXv+8AtZaS8rUsmSPbIEGhTBY0q57doxNRckf1se4GKyZ+VN2k9/nH wG5Q== 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=UsP92e7ztJOmTylPESLcrgsG55YfkI2roFO/32OXJm8=; b=Y7Uyp7K5UIk2XOg96kv9MBZTARrqUfVkruqPBHQ4X4KyPOOp0syHcoQRJd5mGV1QMG 27Ul0VjwaaVM+T/c4qkX5p3mRrU1wJCDzaCv22j/YV3Ov2mWK9Nfz+2pT9KHN/5RvxZk Gvwfb8B51xu6hAzPusb8Onoe8oW8Pm74hoLJ8+tFF2mqV4PwzwHSBRCFNshocWAR8k1C sECkXYC5oUqfK55Hv4f1OVsdbCb68idBeCfCR1Qnv7rzUo2oN+nKdlUo08ZITOzvrBtF nEjpDAOFNWDsRPWslphSLrSh6K8g4a0UTCYJtnKIWpb+DP/JtEIo5BShZWDe/lpCRVQC +a2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZsoMHtmQ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m10si1518676ejr.589.2020.10.07.08.05.45; Wed, 07 Oct 2020 08:06:11 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZsoMHtmQ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728722AbgJGPAZ (ORCPT + 99 others); Wed, 7 Oct 2020 11:00:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728641AbgJGPAZ (ORCPT ); Wed, 7 Oct 2020 11:00:25 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9920CC061755 for ; Wed, 7 Oct 2020 08:00:23 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id az3so1165808pjb.4 for ; Wed, 07 Oct 2020 08:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=UsP92e7ztJOmTylPESLcrgsG55YfkI2roFO/32OXJm8=; b=ZsoMHtmQZ2rxjybc1fxKL8N3H01jxmqdQ4RO63yWdg8SITx+IHP8ZhpPIML7VF6B0+ aOFmGQUK+nJ61t1qVqOMnqP8G8wCSAzcyOFoIbTU8YorEG7GfuFT0xLtsYVTezu2FZ3W J+Jq1S526XmF5CajnoT+7/SPtapfU68vTBNvF3JocxQLvJCMHrbRhxsVV9Dc9VvEGgI8 j+o6ceUOoqoQTzuCrG03qgPkSCj7F96F9n2m1qzFvWndwWfvq3WvkUHYDsbXU6uDiQWv GMrsReCcIVcYx4HkqI7vNJgX00CCJv72wcoR+1XP2T+kfK02zycGXX52xa6bQUbsLCDg 7xVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=UsP92e7ztJOmTylPESLcrgsG55YfkI2roFO/32OXJm8=; b=RsNSC9Ehvtcyay6wi9iSpDCHcawko/1Zdj5HDIr8TG97GDNr+k2H8Ng3kpgTG5IB/5 jc8Hkqkleknfs+tQWejnXspJ3c1CxpB1ESBKMu0CHzltE/iINyaNy91G+XduAEHO37jn jtYQtoz+5y+rZqsojfB92mpYxNmR9KA08uF5IIvfaqwbHXFkDbETxtadkayjII/alouh g21/hhe4B0n/y9BQ6rj3f3AHPJwV22fjBa2lOC8d/UWP1/B0br1/ZiKzDBDhast1JcVv rrTzwhaGAVpgoeWpobXI8euM44aqwtuNnAWPWwCAsm7nBS80dpzrPzVyZohoforNUHWe au/Q== X-Gm-Message-State: AOAM532JpXBzXhClZS21nQ5BQNJHCdy2GbvMTpKREnnDPxCvxDiUffiP LmUVjjHWMl52wERy5kRdgxbaFQ2WtpMxKqaE X-Received: by 2002:a17:902:8d8f:b029:d0:cc02:8527 with SMTP id v15-20020a1709028d8fb02900d0cc028527mr3265299plo.33.1602082823047; Wed, 07 Oct 2020 08:00:23 -0700 (PDT) Received: from ubuntu (36-227-138-140.dynamic-ip.hinet.net. [36.227.138.140]) by smtp.gmail.com with ESMTPSA id 15sm3529040pgt.24.2020.10.07.08.00.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 08:00:21 -0700 (PDT) Date: Wed, 7 Oct 2020 23:00:13 +0800 From: Yun Hsiang To: Qais Yousef Cc: Patrick Bellasi , Dietmar Eggemann , peterz@infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] sched/uclamp: release per-task uclamp control if user set to default value Message-ID: <20201007150013.GA219885@ubuntu> References: <20200928082643.133257-1-hsiang023167@gmail.com> <8272de8d-9868-d419-e2bb-d5e2c0614b63@arm.com> <20201002053812.GA176142@ubuntu> <57e6b3d3-22cd-0533-cfe7-e689c7983fcc@arm.com> <87o8lg7gpi.derkling@matbug.net> <20201005171500.eztpptd76fotkwa6@e107158-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201005171500.eztpptd76fotkwa6@e107158-lin.cambridge.arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 05, 2020 at 06:15:00PM +0100, Qais Yousef wrote: > On 10/05/20 18:58, Patrick Bellasi wrote: > > [...] > > > >> it can not go back to the initial state to let the module(group) control. > > > > > > In case A changes its values e.g. from 3a to 3b it will go back to be > > > controlled by /TG again (like it was when it had no user defined > > > values). > > > > True, however it's also true that strictly speaking once a task has > > defined a per-task value, we will always aggregate/clamp that value wrt > > to TG and SystemWide value. > > > > >> But the other tasks in the group will be affected by the group. > > > > This is not clear to me. > > > > All tasks in a group will be treated independently. All the tasks are > > subject to the same _individual_ aggregation/clamping policy. > > I think the confusing bit is this check in uclamp_tg_restrict() > > 1085 uc_max = task_group(p)->uclamp[clamp_id]; > 1086 if (uc_req.value > uc_max.value || !uc_req.user_defined) > 1087 return uc_max; > > If a task is !user_defined then it'll *inherit* the TG value. So you can end > up with 2 different behaviors based on that flag. I.e: if 2 tasks have their > util_min=0, but one is user_defined while the other isn't, the effective > uclamp value will look different for the 2 tasks. > > IIUC, Yun wants to be able to reset this user_defined flag to re-enable this > inheritance behavior for a task. Which I agree with you, seems a sensible thing > to allow (via new sched_setattr() flag of course). > Yes, this is what I want. As Dietmar and Pavan said, use 0 and 1024 to reset user_defined is problematic. I'll send a V2 patch that use SCHED_FLAG_UTIL_CLAMP_RESET to reset the user_defined bit. Thank for the suggestion! > > Thanks > > -- > Qais Yousef > Thanks, Yun