Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1008398ybt; Fri, 19 Jun 2020 21:27:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCS6lDEQo9SPSfNZ0yxHTH5P/jK++Enw82pw3yyGRDkaQRvEGIMdLBvD3ivbWaYV62d7H6 X-Received: by 2002:aa7:c356:: with SMTP id j22mr6194775edr.59.1592627234597; Fri, 19 Jun 2020 21:27:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592627234; cv=none; d=google.com; s=arc-20160816; b=0JFz4HBnURwkxXLKfOMVSQ/RDcPGr1vCssF2/ANMPfrnRlqYCjigF3yNI62gJfk7da u7XCtAfTvSQlVxUEX26mZAbKOl9XpJ205EwqDasxfwYeRpbf61ypuve+VpAb7IvPTtIH KBvnMWbeziM/7FIXbEX6K2sjYW49eUhKcO2vWJZkKjGflMufLk3+RLpP7Nc/q/b344Fo 6mUK/NAmXwt3gT56XYqU2pg7uAG8eCc+ebozpxJjZnvSNe4ZleLSE1jCaoR0TqUm0wYY 00fys8sDJ6IvI+Rs69shefvmZopmUPSqz8zyQxOZoMEKyit0lJ8aApTGp4G6MeyPQ8t7 Hvug== 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=mnNIhslm8oUVWWVozVG2eXXn9jZHG/vgG6qMcX4+sb0=; b=KCOhC57wdllLLFGavdk2Jm8ODPxprgit2E6rwRkJLoG9bjQMjPH86gFofkfL+kZG3J Hy1CARARZUCmzuTuaz5hagqcRLI5Mp7ekGnUhqmpNT9nJLV0bW3jK389Kli1ZhYxJSqz AcBxJ0HILpyDl6CByDyeDcyXL2tUL4cmln19FbVot44LvOFHEIsV3rL+xlHencJumZNX SjDb19My1DngMFIEm9l1GUnVM0q3+lRb8gRntf+W79EGZ90MLS6AyNM1H75+11usm0iO dbr4v8+cTqMbBUTIEeUD2TXwxADizPOs3Z8U7g4suoalkcqK89SK324kMo8mORph4EO+ STBA== 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 n25si5220884ejs.551.2020.06.19.21.26.52; Fri, 19 Jun 2020 21:27:14 -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 S2436687AbgFSSmb (ORCPT + 99 others); Fri, 19 Jun 2020 14:42:31 -0400 Received: from foss.arm.com ([217.140.110.172]:55434 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732225AbgFSSma (ORCPT ); Fri, 19 Jun 2020 14:42:30 -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 83D77D6E; Fri, 19 Jun 2020 11:42:29 -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 F325F3F73C; Fri, 19 Jun 2020 11:42:27 -0700 (PDT) Date: Fri, 19 Jun 2020 19:42:25 +0100 From: Qais Yousef To: Peter Zijlstra Cc: Ingo Molnar , 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 1/2] sched/uclamp: Fix initialization of strut uclamp_rq Message-ID: <20200619184225.ospkxdg5gzh42y2b@e107158-lin.cambridge.arm.com> References: <20200618195525.7889-1-qais.yousef@arm.com> <20200618195525.7889-2-qais.yousef@arm.com> <20200619173055.GA576888@hirez.programming.kicks-ass.net> <20200619173944.blwuimtuqmcxlj2v@e107158-lin.cambridge.arm.com> <20200619181303.GD576888@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200619181303.GD576888@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/19/20 20:13, Peter Zijlstra wrote: > On Fri, Jun 19, 2020 at 06:39:44PM +0100, Qais Yousef wrote: > > On 06/19/20 19:30, Peter Zijlstra wrote: > > > On Thu, Jun 18, 2020 at 08:55:24PM +0100, Qais Yousef wrote: > > > > > > > + for_each_clamp_id(clamp_id) { > > > > + memset(uc_rq[clamp_id].bucket, > > > > + 0, > > > > + sizeof(struct uclamp_bucket)*UCLAMP_BUCKETS); > > > > + > > > > + uc_rq[clamp_id].value = uclamp_none(clamp_id); > > > > > > I think you can replace all that with: > > > > > > *uc_rq = (struct uclamp_rq){ > > > .value = uclamp_none(clamp_id), > > > }; > > > > > > it's shorter and is free or weird line-breaks :-) > > > > Sure. I just sent v2 so that people will be encouraged to run tests hopefully. > > But will fix in v3. > > > > Do we actually need to 0 out anything here? Shouldn't the runqueues all be in > > BSS which gets initialized to 0 by default at boot? > > > > Maybe better stay explicit.. > > C99 named initializer (as used here) explicitly zero initializes all > unnamed members. Is that explicit enough? ;-) Hehe yes, but what I meant is that unless DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); has some special rules, it should be in BSS and already zeroed out when we do sched_init(). So do we really need to explicitly zero out anything? It seems redundant, but again maybe being explicit is more readable, so maybe better keep it the way it is (named initializer of struct). Thanks -- Qais Yousef