Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1782810ybk; Mon, 11 May 2020 04:15:20 -0700 (PDT) X-Google-Smtp-Source: APiQypLLaF+m/QH4JHNaikr1ww0kqNNbHjJE+PIvQxf4naEZrqXKT9JQ87pCUmjl2aZMqh4B8uWt X-Received: by 2002:a17:906:3e56:: with SMTP id t22mr7014582eji.277.1589195720747; Mon, 11 May 2020 04:15:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589195720; cv=none; d=google.com; s=arc-20160816; b=E5D29WPXzqIGn2wEmOIh5Z38wgOSFt31fvxm3D1bz9flZdt57HHtpFJodi0YXWvOhd RYMV45oo+/yOh8WKZkyvUQhynkWRJFej9AChl3XgNx8tZaK0ynhMzPTu6F2vd2sRArYZ lFpaJp0OYIr3gIeNcvqhyNHE2ZJ+ry4FcSAMP+uloJegRPWWTatTSv5J2JCKoKxXcJYf KVk6wFjPYoJlVUTkKQ3+Q4QoBnysFS09KTM1T9MIie3gVLoEgO9wS46VFbdM1szGGoVk DaaP24PZqEXMv8Vb2XII5SzcxzvQhD34kjWvsQZ4JF8FN+zC+WWiVugAkFnGr2Gu1wok xrvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=gJGL//lVbVlyFDgRBOGW1C/9Kp17ZUErDFaWHd8dJE0=; b=qiw4FCcdQsj6A2x/geRlvwqy/oZ4u+oqjLzKzmB9eJyZ4hg8iWa0u2RBrj2sZ2aXMV xMHedC376n9jWFhQIH2SXrkbHWTV5FP3nRq9GLJUG25/Jol2w67WzaGrBlM3fyZ8r/SZ dTVMcF4ZgpWrIxsF1nboQ4TQMgT2kXtQePthdTXXY30GMXAQY/no5Q73+MYFKbikj1Fo ER+uzSdeEVBkHTtU0MT0NjRVNiIU8QmGQncHrqayZA4zHp7EnCXOpPurgBaYDUann0V9 ieN7Sol7R479Myo2elLS+rm3Y/LAiNQzVOmVZwexxqqFuwRU+MKJTcOI2/LZBInWdlDW X1Eg== 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 g8si1202380ejb.85.2020.05.11.04.14.57; Mon, 11 May 2020 04:15:20 -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 S1728531AbgEKLNJ (ORCPT + 99 others); Mon, 11 May 2020 07:13:09 -0400 Received: from foss.arm.com ([217.140.110.172]:56782 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725993AbgEKLNJ (ORCPT ); Mon, 11 May 2020 07:13:09 -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 E63841FB; Mon, 11 May 2020 04:13:08 -0700 (PDT) Received: from [192.168.0.7] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 678013F305; Mon, 11 May 2020 04:13:06 -0700 (PDT) Subject: Re: [PATCH v5 3/4] sched: Allow sched_{get,set}attr to change latency_nice of the task To: Parth Shah , linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@redhat.com, vincent.guittot@linaro.org, qais.yousef@arm.com, chris.hyser@oracle.com, pkondeti@codeaurora.org, patrick.bellasi@matbug.net, valentin.schneider@arm.com, David.Laight@ACULAB.COM, pjt@google.com, pavel@ucw.cz, tj@kernel.org, dhaval.giani@oracle.com, qperret@google.com, tim.c.chen@linux.intel.com References: <20200228090755.22829-1-parth@linux.ibm.com> <20200228090755.22829-4-parth@linux.ibm.com> From: Dietmar Eggemann Message-ID: <00bf190a-6d84-48aa-83cb-b25e6c24777c@arm.com> Date: Mon, 11 May 2020 13:13:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200228090755.22829-4-parth@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/02/2020 10:07, Parth Shah wrote: > Introduce the latency_nice attribute to sched_attr and provide a > mechanism to change the value with the use of sched_setattr/sched_getattr > syscall. > > Also add new flag "SCHED_FLAG_LATENCY_NICE" to hint the change in > latency_nice of the task on every sched_setattr syscall. > > Signed-off-by: Parth Shah > Reviewed-by: Qais Yousef [...] ndif /* _UAPI_LINUX_SCHED_TYPES_H */ > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 866ea3d2d284..cd1fb9c8be26 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -4710,6 +4710,9 @@ static void __setscheduler_params(struct task_struct *p, > p->rt_priority = attr->sched_priority; > p->normal_prio = normal_prio(p); > set_load_weight(p, true); > + > + if (attr->sched_flags & SCHED_FLAG_LATENCY_NICE) > + p->latency_nice = attr->sched_latency_nice; > } How do you make sure that p->latency_nice can be set independently from p->static_prio? AFAICS, util_clamp achieves this by relying on SCHED_FLAG_KEEP_PARAMS, so completely bypassing __setscheduler_params() and using it's own __setscheduler_uclamp(). [...]