Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1114564imu; Wed, 23 Jan 2019 11:00:21 -0800 (PST) X-Google-Smtp-Source: ALg8bN4S/Kt7SN+S/EQ601jdhTAjCuOe6sYkZjOzma2D/XNlWVOu6s+RygANq77ASFwPJmRdsZr8 X-Received: by 2002:a63:de04:: with SMTP id f4mr3026765pgg.292.1548270021011; Wed, 23 Jan 2019 11:00:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548270020; cv=none; d=google.com; s=arc-20160816; b=rYoIB5N04tujRQduYHu3uuGCueiZRHwQDZOiPtppKi/mufeh9CWjzVvulwuFxpsUhA HSGmpu7yGMA7gC7fCcuM/xbkyZoDWTMXWFTT1U+Squ4AryQNlnQOevFLAEEYSXy8NLJe 0f8qkDzjMoBJN0oC750i2IeIpBFHlnfPf8JIhU/ofzC8CF3AR1Bid53ZyZd9HCvlR3Z3 G/6Hu3JRgrVmBaEqM6h7YtUwwdcBuCN7hX4BdVpNL2kVAdIUGAYFjWLf/tZJnISrFE5z pdCawynVV6q1GBOU3qwUu5tZQcVPCGZoc1WKmYxo17ywR9JZz3wPiAtBTMBpP6wb+CWA 9F1Q== 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=dgfqcSanb6lp9vXdmjSxOrnt6Pt+KGuiUR8MqoSxjtE=; b=uNNgHX+3FQz6ACvZqPai5HDajJ+AkqO0P86LpAv7vxHb0wz468qCxTj+s98HWdfiQv 7nz3QAau2tWAvyBZXnyN0sNetpMM8vp6BHAYVqUGPDkmnsLmjMCU7Du/IGoSJmDtlRik yPjOMOHu4zSGs0ckq+rtwSYXRc795iflVAQJsq2Pfm1sEleWBi4p1gac8eI7xHgTGFDc nWUJpVuv4SgAYOGzR7cxS7+v0a91Cp0bm2RYVRgeXpO/Ao6EnRyEKHUa0KdsN0YAIaZr l+O1Tri2KzmEaakPaEmLatAAjRUpREyPHe3H2DEFFRSrK3M07hfG66+AnEO6JWfyoK1Z lNXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=I9aCRh9N; 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 a19si21195304pgn.102.2019.01.23.11.00.04; Wed, 23 Jan 2019 11:00:20 -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=bombadil.20170209 header.b=I9aCRh9N; 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 S1726202AbfAWS7s (ORCPT + 99 others); Wed, 23 Jan 2019 13:59:48 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:52982 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbfAWS7s (ORCPT ); Wed, 23 Jan 2019 13:59:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=dgfqcSanb6lp9vXdmjSxOrnt6Pt+KGuiUR8MqoSxjtE=; b=I9aCRh9NxXEkgaarWs8JkHsB2 TMXVjUSy/Hy9/cXLp1VbmmzrZe1f5hkReu9jj0zg2LBmSSyjGnk0yngC3grF4incfpJpTJyKdIGoC lqYlLWvPM6ZwYYg49Ue10/qM+HZsduT+3xFZSH5bITQ4Z9J8qoMTE8TsVhlj6OZZqJxCZTKEIA/+Y onAhUUGqPzCZZu+qp5tEiXcEOorfzECaY/xg4lEA6zaWdnef7LObxH+Y/ymDjVjO8gJ8l+LEpliAF GsNitQuAT5I8kFwQXvYa5sxbBgXfHMQ8FzIk/omNNI46UI0IlmvwxkAduLNKAGPCZJKnfgdFIYBaL Gwoxb553w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmNkV-0000w4-0X; Wed, 23 Jan 2019 18:59:43 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4BD1C201EC16E; Wed, 23 Jan 2019 19:59:40 +0100 (CET) Date: Wed, 23 Jan 2019 19:59:40 +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: <20190123185940.GF17749@hirez.programming.kicks-ass.net> References: <20190121153308.GL27931@hirez.programming.kicks-ass.net> <20190121154412.fak2t2iquj3aixtu@e110439-lin> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190123141426.5samtr4hl6okdypu@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 Wed, Jan 23, 2019 at 02:14:26PM +0000, Patrick Bellasi wrote: > > > Consider also that the uclamp_task_update_active() added by this patch > > > not only has lower overhead but it will be use also by cgroups where > > > we want to force update all the tasks on a cgroup's clamp change. > > > > I haven't gotten that far; but I would prefer not to have two different > > 'change' paths in __sched_setscheduler(). > > Yes, I agree that two paths in __sched_setscheduler() could be > confusing. Still we have to consider that here we are adding > "not class specific" attributes. But that change thing is not class specific; the whole: rq = task_rq_lock(p, &rf); queued = task_on_rq_queued(p); running = task_current(rq, p); if (queued) dequeue_task(rq, p, queue_flags); if (running) put_prev_task(rq, p); /* @p is in it's invariant state; frob it's state */ if (queued) enqueue_task(rq, p, queue_flags); if (running) set_curr_task(rq, p); task_rq_unlock(rq, p, &rf); pattern is all over the place; it is just because C sucks that that isn't more explicitly shared (do_set_cpus_allowed(), rt_mutex_setprio(), set_user_nice(), __sched_setscheduler(), sched_setnuma(), sched_move_task()). This is _the_ pattern for changing state and is not class specific at all.