Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1009848ybt; Fri, 19 Jun 2020 21:30:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8SL9Ec6YNt1gVOcVd8qx3bZ9h5s7oS64UFnO8hpH4KDuCyrCMBbdW+tiV15PAf44rXmQL X-Received: by 2002:a50:951d:: with SMTP id u29mr6714315eda.333.1592627437587; Fri, 19 Jun 2020 21:30:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592627437; cv=none; d=google.com; s=arc-20160816; b=JdRDTJ3/v8Q4VRB7qFXr7UXmtMO1EQ+Rs5CDaMoKSCCnTwKx9Vt1bCVaXTIv9PTYUI b/KoWybikkuKa+82va1T6/4fwcldASFA7BetVqpveKt+jcoQWvhYmos4cX6vLaKGHjGl xXstds46zy4FJcG9tS+pcmxms3nqb7MqL020jEsOHlY+V299P/vSs9NzNpqAfhixXLbB L3KUHEYvesVo3n3O53eH7QY/00ox2TWB7R7xL01WU980LehjSy8N56sRtvM59wwFli62 9j3bQ828fQ2vqZ9Zy72cHNlq/YGs0LnMXBRYR0OPcK7/zTQlcJCVVGZIp7R98JPMuh9p h7jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:date:in-reply-to:message-id :subject:cc:to:from:user-agent:references; bh=Mh2nAQHwSmcBG+GuHvZpUx8nEB+tsuQ/LKhHT8gQRbA=; b=Jhf+iRB/LFX+25Jyun5divEDT0K51TRihEsxGnNbREjdbYVwbthQ5pzOW/gTF4Vc8f Euw6MiUqxITokm+vAVkBzPxnjbhH+DJ8EPTV0Q+Eufqk+FMHLu/Xw5JMglfuvFrjAv1w Dou1Q/j8jY20gic7zLIsAVSV5Ado1oXYyAmS2Mq+cMjmkbXQpsl0NK8yM/KTxC7eDfZO DJtFmhOl7GjzJG4a9IAHOPhRXRr4VoxRIfmBSp1l99WDGepqDHz91OsiXxK13PaIbRPx kAtr4RC+rkHXMiEC59hkzCxmWCGmFPVTnC0kx8tDVWvE7bkLvIRr3HGQiEehng87Po+b KFFw== 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 a24si5258794ejr.16.2020.06.19.21.30.15; Fri, 19 Jun 2020 21:30:37 -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 S2388641AbgFSSwl (ORCPT + 99 others); Fri, 19 Jun 2020 14:52:41 -0400 Received: from foss.arm.com ([217.140.110.172]:56276 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726990AbgFSSwk (ORCPT ); Fri, 19 Jun 2020 14:52:40 -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 E13D52B; Fri, 19 Jun 2020 11:52:39 -0700 (PDT) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4013A3F73C; Fri, 19 Jun 2020 11:52:38 -0700 (PDT) References: <20200618195525.7889-1-qais.yousef@arm.com> <20200618195525.7889-3-qais.yousef@arm.com> <20200619125148.y4cq3hwllgozbutq@e107158-lin.cambridge.arm.com> <20200619141348.5o5iqomwe6lofgiu@e107158-lin.cambridge.arm.com> <20200619172524.y66a4hz6g6hr3thr@e107158-lin.cambridge.arm.com> User-agent: mu4e 0.9.17; emacs 26.3 From: Valentin Schneider To: Qais Yousef Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Patrick Bellasi , Chris Redpath , Lukasz Luba , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] sched/uclamp: Protect uclamp fast path code with static key Message-ID: In-reply-to: <20200619172524.y66a4hz6g6hr3thr@e107158-lin.cambridge.arm.com> Date: Fri, 19 Jun 2020 19:52:32 +0100 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/06/20 18:25, Qais Yousef wrote: > On 06/19/20 16:17, Valentin Schneider wrote: > > [...] > >> > But here this is >> > just extra churn. >> > >> > If an imbalance has happend this means either: >> > >> > 1. enqueue/dequeue_task() is imablanced itself >> > 2. uclamp_update_active() calls dec without inc. >> > >> > If 1 happened we have more reasons to be worried about. For 2 the function >> > takes task_rq_lock() and does dec/inc in obvious way. >> > >> >> True. I won't argue over the feasibility of the scenarios we are currently >> aware of, my point was that if they do happen, it's nice to have debug >> helps in the right places as the final breakage can happen much further >> downstream. >> >> FWIW I don't like the diff I suggested at all, but if we can come up with a >> cleverer scheme I think we should do it, as per the above. > > There's the fact as well that this whole thing is to deal with potentially > avoid doing anything that is stricly not necessary in the fast path. > > keep in mind that my patch of introducing the sysctl is not accepted yet > because it introduces such thing, but in that case it's not a debug only > feature. CONFIG_SCHED_DEBUG do get enabled by distros because it exports a lot > of useful info. Sigh, true, but they really shouldn't. The whole point of having SCHED_WARN_ON() is that it's a no-op on !SCHED_DEBUG kernels, which should be any "production" kernel :(