Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3676229ybt; Tue, 30 Jun 2020 08:41:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzs0AJfuMEEZF/JDxo+cLj9TTFFXmBO7l2IXyNPoJ/JQOSCXibY7Q8A6DreL0JdXLake4LF X-Received: by 2002:a17:906:e089:: with SMTP id gh9mr18464892ejb.482.1593531719357; Tue, 30 Jun 2020 08:41:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593531719; cv=none; d=google.com; s=arc-20160816; b=wr/EHaP5kRAmEttrkJ8vT59iB8VICK+L7rq6S1Mq/I5Hg1dNepOtB7qF1XbR+nHbBG FLVNxsjV09PlSeOB17SPZdlSLHrT/bmgJdlm7s1B6C1y0144r51I9+XRZsT8ZVWl6BNM Ll0bXjogMD0erLPD8CqLVbvwObarhMxpp4fgj0wrP/Qte4SN/kC6ELC5+o9kSrEAOcX0 6bXqGny4zp/W12biNyhi9RGo7pKK/11WMVf47DT04nbCPJ4hVMU9aJPvnc7Bh3ZEsMX4 TOL7a7avpsbntNFPWgswgUURPhZYHifRlKgU2TZMFxtp9ei96HzGP52+sBZD8RIPtNMV A3ew== 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; bh=OGejIa1cqYZGPGnAsTUKjInsHH+xLu2VBy7F9KTCyd0=; b=h6f6DLdzAGHmBcwRvt3r79wQ+brP+S/Nn/jcWjtY36V5j49ChUvdBBENCHoTtdsfYc InkAL+FCs5py0agOBjWfGe8tFkInHVGMvG/O97Gkg4JcqoAJQyslaPzV7HH93ghp+uvQ jf2fX9aVJObQSW7bBjpVITR780TN7mdclkbPZu4OtE/ZL+uoBJOEz1qttuxAI+ZfZW1I aH57YEILmuDkIAYLaLnnQw6SaYnbMxEyx09YemB+bapQWWSS82Y40MSBvYjylyMyZdX8 eO4vWvjd401wL/PjjWL4MSngtfWZJQpm/OIEbFXEuLnHijZcLxwz4tnLwWuTqZtqRm2T vV6A== 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 oa20si1835678ejb.714.2020.06.30.08.41.36; Tue, 30 Jun 2020 08:41:59 -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 S2389604AbgF3Pkj (ORCPT + 99 others); Tue, 30 Jun 2020 11:40:39 -0400 Received: from foss.arm.com ([217.140.110.172]:36818 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389589AbgF3Pkj (ORCPT ); Tue, 30 Jun 2020 11:40:39 -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 04B0430E; Tue, 30 Jun 2020 08:40:38 -0700 (PDT) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 570AF3F71E; Tue, 30 Jun 2020 08:40:36 -0700 (PDT) Date: Tue, 30 Jun 2020 16:40:34 +0100 From: Qais Yousef To: Patrick Bellasi Cc: Ingo Molnar , Peter Zijlstra , Valentin Schneider , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Chris Redpath , Lukasz Luba , linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 2/2] sched/uclamp: Protect uclamp fast path code with static key Message-ID: <20200630154033.5r6zi7ajgag7jlec@e107158-lin.cambridge.arm.com> References: <20200629162633.8800-1-qais.yousef@arm.com> <20200629162633.8800-3-qais.yousef@arm.com> <87366dnfaq.derkling@matbug.net> <20200630094623.hnlqtgavauqlsuyd@e107158-lin.cambridge.arm.com> <87zh8kmwlt.derkling@matbug.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87zh8kmwlt.derkling@matbug.net> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Patrick On 06/30/20 16:55, Patrick Bellasi wrote: > > Hi Qais, > sorry for commenting on v5 with a v6 already posted, but... > ... I cannot keep up with your re-spinning rate ;) I classified that as a nit really and doesn't affect correctness. We have different subjective view on what is better here. I did all the work in the past 2 weeks and I think as the author of this patch I have the right to keep my preference on subjective matters. I did consider your feedback and didn't ignore it and improved the naming and added a comment to make sure there's no confusion. We could nitpick the best name forever, but is it really that important? I really don't see any added value for one approach or another here to start a long debate about it. The comments were small enough that I didn't see any controversy that warrants holding the patches longer. I agreed with your proposal to use uc_se->active and clarified why your other suggestions don't hold. You pointed that uclamp_is_enabled() confused you; and I responded that I'll change the name. Sorry for not being explicit about answering the below, but I thought my answer implied that I don't prefer it. > > >> Thus, perhaps we can just use the same pattern used by the > >> sched_numa_balancing static key: > >> > >> $ git grep sched_numa_balancing > >> kernel/sched/core.c:DEFINE_STATIC_KEY_FALSE(sched_numa_balancing); > >> kernel/sched/core.c: static_branch_enable(&sched_numa_balancing); > >> kernel/sched/core.c: static_branch_disable(&sched_numa_balancing); > >> kernel/sched/core.c: int state = static_branch_likely(&sched_numa_balancing); > >> kernel/sched/fair.c: if (!static_branch_likely(&sched_numa_balancing)) > >> kernel/sched/fair.c: if (!static_branch_likely(&sched_numa_balancing)) > >> kernel/sched/fair.c: if (!static_branch_likely(&sched_numa_balancing)) > >> kernel/sched/fair.c: if (static_branch_unlikely(&sched_numa_balancing)) > >> kernel/sched/sched.h:extern struct static_key_false sched_numa_balancing; > >> > >> IOW: unconditionally define sched_uclamp_used as non static in core.c, > >> and use it directly on schedutil too. > > So, what about this instead of adding the (renamed) method above? I am sorry there's no written rule that says one should do it in a specific way. And AFAIK both way are implemented in the kernel. I appreciate your suggestion but as the person who did all the hard work, I think my preference matters here too. And actually with my approach when uclamp is not compiled in there's no need to define an extra variable; and since uclamp_is_used() is defined as false for !CONFIG_UCLAMP_TASK, it'll help with DCE, so less likely to end up with dead code that'll never run in the final binary. Thanks a lot for all of your comments and feedback anyway! -- Qais Yousef