Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3947574pxb; Tue, 10 Nov 2020 04:23:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxNICtTKg7MnF7C88vGNQaF5n5pA8g+mpwbh5icNuZKsjvaqK8U3irsppMnaovuXJuUUQH X-Received: by 2002:a17:907:10d9:: with SMTP id rv25mr20366800ejb.437.1605011015724; Tue, 10 Nov 2020 04:23:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605011015; cv=none; d=google.com; s=arc-20160816; b=uK0z7/Iqni6VLH8b84IX/fUWHqxUkrrcqLstlDkuqIno7kNi+OO50kz1davm3RARq0 Lka3ubaesblg+v+1vRwXMHto8+YsDYxMUVuEDdsGDk72S+tNazprHqtMrcOOHMAmo/Et Rp6r6uReB25MdFJcXBbUQRe4lzTZhiiOtqX57zap5GYvLC6gPC3R9+vDOt8HJuvld+7u gH4HMHjQgGHEmid5D9YihiHNr61FdxFpDYTO3IWx/HV79rXfe/xUWC5N2XFH8MYgTxP4 i+ItjgIdi/AZJ1dB7AMvkPnqR9ym4tUxAUYqfPnIm8iTh09yh6DA47Cb1jFBDAZau60f /PaQ== 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=9QfKBizSdwVq/e1ux0PD/cnEhUP9wW2XpNQEsyGL030=; b=UA6nAAfeI8rOfkCT4Qz+gZvv8sn6ZpbedL29IafegA8VVWiQNtcL+cADNBfhmTJDf0 kUkNvaZ0+UELAFAf2Fb77fTjjlW/RWv2JG5sjXGdoMtYYQyYhnR5q8fhFOd0f9YL++KH uIwT6DoMZhhevtWdW1wnUHjbzbTefoH7eqF+1fWizM0ecl7jTJB3MoMgvt4Q78/cubvz uG5L9ZTtMIRJkrIczWDUxPzOAVrRDbIjA8n9JeNwS6ols+UZl5PaR/tUqQvs0PM7kO/Y cGJOeZ0rVu9j2DzWrRQ++R1TqIYI/LtNsDYR+6lPcvM1n8SJylXsdrDnF2XrJOr/fmY1 zFpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=Tz1YHSHw; 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 qk1si9021471ejb.260.2020.11.10.04.23.12; Tue, 10 Nov 2020 04:23:35 -0800 (PST) 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=@infradead.org header.s=merlin.20170209 header.b=Tz1YHSHw; 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 S1730360AbgKJMVP (ORCPT + 99 others); Tue, 10 Nov 2020 07:21:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730186AbgKJMVP (ORCPT ); Tue, 10 Nov 2020 07:21:15 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0985C0613CF for ; Tue, 10 Nov 2020 04:21:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=9QfKBizSdwVq/e1ux0PD/cnEhUP9wW2XpNQEsyGL030=; b=Tz1YHSHwxXV3vgWp4zS8+NHwe8 DvqHrn8U+FoInOcHUCiIPUEqRdNIy/QysWvYhhj3BhygzOuPA5SCicwyiB8qDeNG4h/P81dPIVQ3h 4v2DP5fBn1GLUTVTA53LWPt76mVLHmEDZp5kNobQ6MQUn/AJDlQDlAJer9KlQYPqmK1uyu0ch62hK SPU16tKP7AMSq1Lczz7klAOqAhKNXbNL3Gaw/xa6Xtxw/d5K91PsUSOUD9lQ94voVddkhTdrGf83H lPcIbC3pN+3RO/IZV2/5B9Ve7c5lE0EjL9YMsTk7EswWQnM1E3s1kb/8G1iBgC2YUkuBvBx+CtGlH Kc1hvZIg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcSe6-0004AG-4o; Tue, 10 Nov 2020 12:21:10 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9EA73301E02; Tue, 10 Nov 2020 13:21:08 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7E3472C29A9E6; Tue, 10 Nov 2020 13:21:08 +0100 (CET) Date: Tue, 10 Nov 2020 13:21:08 +0100 From: Peter Zijlstra To: Yun Hsiang Cc: dietmar.eggemann@arm.com, linux-kernel@vger.kernel.org, qais.yousef@arm.com, patrick.bellasi@matbug.net, kernel test robot Subject: Re: [PATCH v5 1/1] sched/uclamp: add SCHED_FLAG_UTIL_CLAMP_RESET flag to reset uclamp Message-ID: <20201110122108.GG2594@hirez.programming.kicks-ass.net> References: <20201103023756.1012088-1-hsiang023167@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201103023756.1012088-1-hsiang023167@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 03, 2020 at 10:37:56AM +0800, Yun Hsiang wrote: > If the user wants to stop controlling uclamp and let the task inherit > the value from the group, we need a method to reset. > > Add SCHED_FLAG_UTIL_CLAMP_RESET flag to allow the user to reset uclamp via > sched_setattr syscall. > > The policy is > _CLAMP_RESET => reset both min and max > _CLAMP_RESET | _CLAMP_MIN => reset min value > _CLAMP_RESET | _CLAMP_MAX => reset max value > _CLAMP_RESET | _CLAMP_MIN | _CLAMP_MAX => reset both min and max > The obvious alternative would be to use a magic value in sched_util_{min,max} to indicate reset. After all, we strictly enforce the values are inside [0,1024], which leaves us with many unused values. Specifically -1 comes to mind. It would allow doing this without an extra flag, OTOH the explicit flag is well, more explicit. I don't have a strong preference either way, but I wanted to make sure it was considered, and perhaps we can record why this isn't as nice a solution, dunno.