Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1935745imu; Thu, 24 Jan 2019 04:38:53 -0800 (PST) X-Google-Smtp-Source: ALg8bN4T3E6fe1y/VUiqDWxdXNeVcjjznu8mxyqlHPk5rwZRtsSuyEplAPkSUX9xpGhRnslecDk1 X-Received: by 2002:a17:902:9006:: with SMTP id a6mr6312651plp.334.1548333533803; Thu, 24 Jan 2019 04:38:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548333533; cv=none; d=google.com; s=arc-20160816; b=KKRLGoamVzqQxqkJEWb1vyvWfrF8RlPgLEHnDReC+DHxphBZomekgqBTE79/ArfRNL 9beDtCWi74dYo9CL8gFYRjpuRReT8N1Wd6YxxxlRX/m6GgTF81fHs+UYlnT/ZlasQxgj uDO3PTRLvysX6kEz/YSSRUMDuhlS/5/nlDDG4najoX0Wzv0VrnsM6k5OCrE61KmTy2Sc KaO2CcIhvjwfNjnn+tSBPrwh5JPwsUkv9Y8jX2pxR236Km5FH4/63sGjYnWqmOY78/mi 8ZWh9dmA6Ivx71RKBim86LEoW0rriZNIgTYRQN8Ss/O1fsVKHHYtOpFolNtWUqEDFOja 2wQw== 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:dkim-signature; bh=RAaay9A+2828Oigi4YlwejmDwHUlVQqtb2GPPHMohlY=; b=RFjB5Gmg4Og862yYgE00QljZCXHn2L+QmDFXyzjCJsV3KMIzibLkbOgtIjcXoyExzt 8+KZoB0XagGi6rTDRvP5FpUkLwqnC8S29ISTgqFzn321YoraZhBWC+7mZfgb0hypGTrq iRt5v/ehA9MQs90z1eCeQJChecRItX9iMnIiBr3lXxaSli0lkvJIJCXfuV8ZODi1S1JC cZGkuQQJkcXSXX4h414mkLXu4cBKQd6+Hcr7mY/8no6e24FSyztdBGU5WCRk4JiJSEF3 Igjp2829fP9mbk0yP+xLYizM4+/mosnD0Gk9YrVIJEEttzrHyVqyrdC1xewm8t/tPsK5 g+IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=TLIGOLYp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d25si20706675pgd.88.2019.01.24.04.38.38; Thu, 24 Jan 2019 04:38:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=TLIGOLYp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727845AbfAXMic (ORCPT + 99 others); Thu, 24 Jan 2019 07:38:32 -0500 Received: from merlin.infradead.org ([205.233.59.134]:53952 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727548AbfAXMic (ORCPT ); Thu, 24 Jan 2019 07:38:32 -0500 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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=RAaay9A+2828Oigi4YlwejmDwHUlVQqtb2GPPHMohlY=; b=TLIGOLYp4d2xowe0kZKd9bzRM oy4rlhAE1EnGNfZOaa5yv+BMzGejjp2y63HL+/SFOVacoP/k6C+FYVx9sB01R5RPVBA09f/lGLX4Z eekSzSLg7qWCDm/zHktvA/VBPnuvFK9UWrOrcnTZ5mNpWoijMBkp7gjRQ9y3glNw0ng3KyUTH8cDd TNMZEWfqdfBChkrIZCx505sF3c2CTMukaLjO2bjimgPo7nqUQ0ytA9Ub0eb9qD3Ks1vX/Pbw0KJGq +3d7ohVVzzWEXX0Xut/uG91Kmv7vEXM3AQyjW8/W9w1SPNRfM6pMM0w0m+Bg9uFZjl+9NWhZ2Ib1D AtCLC+dtQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmeGw-0002HP-Pr; Thu, 24 Jan 2019 12:38:19 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id F2A2F20F51B0C; Thu, 24 Jan 2019 13:38:14 +0100 (CET) Date: Thu, 24 Jan 2019 13:38:14 +0100 From: Peter Zijlstra To: Patrick Bellasi Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-api@vger.kernel.org, Ingo Molnar , Tejun Heo , "Rafael J . Wysocki" , Vincent Guittot , Viresh Kumar , Paul Turner , Quentin Perret , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle , Suren Baghdasaryan Subject: Re: [PATCH v6 05/16] sched/core: uclamp: Update CPU's refcount on clamp changes Message-ID: <20190124123814.GM13777@hirez.programming.kicks-ass.net> References: <20190122093704.GM27931@hirez.programming.kicks-ass.net> <20190122104305.6vjx37muqsxm536t@e110439-lin> <20190122132817.GG13777@hirez.programming.kicks-ass.net> <20190122140115.twtx646vewm757ca@e110439-lin> <20190122145742.GQ27931@hirez.programming.kicks-ass.net> <20190122153315.dhjl67sgpu74hmqv@e110439-lin> <20190123091634.GT27931@hirez.programming.kicks-ass.net> <20190123141426.5samtr4hl6okdypu@e110439-lin> <20190123185940.GF17749@hirez.programming.kicks-ass.net> <20190124112153.pwdsbxjynq6chmvl@e110439-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190124112153.pwdsbxjynq6chmvl@e110439-lin> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 24, 2019 at 11:21:53AM +0000, Patrick Bellasi wrote: > When a task-specific uclamp value is changed for a task, instead, a > dequeue/enqueue is not needed. As long as we are doing a lazy update, > that sounds just like not necessary overhead. When that overhead is shown to be a problem, is when we'll look at that :-) > However, there could still be value in keeping code consistent and if > you prefer it this way what should I do? > > ---8<--- > __sched_setscheduler() > ... > if (policy < 0) > policy = oldpolicy = p->policy; > ... > if (unlikely(policy == p->policy)) { > ... > if (uclamp_changed()) // Force dequeue/enqueue > goto change; > } > change: > ... > > if (queued) > dequeue_task(rq, p, queue_flags); > if (running) > put_prev_task(rq, p); > > __setscheduler_uclamp(); > __setscheduler(rq, p, attr, pi); > > if (queued) > enqueue_task(rq, p, queue_flags); > if (running) > set_curr_task(rq, p); > ... > ---8<--- > > Could be something like that ok with you? Yes, that's about what I was expecting. > Not sure about side-effects on p->prio(): for CFS seems to be reset to > NORMAL in this case :/ That's what we need KEEP_PARAM for, right?