Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2642006ybt; Mon, 22 Jun 2020 03:32:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3MsC3AR2/xFGfkgaonEvSjjj9NBlBZh+1zy3Wb3SpwEojyf4Itm/zx8BhZ6LHAZuv9HIo X-Received: by 2002:a17:906:2cd5:: with SMTP id r21mr14669648ejr.20.1592821961706; Mon, 22 Jun 2020 03:32:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592821961; cv=none; d=google.com; s=arc-20160816; b=UR6ad8nq3VK3elKyEpRFdWQPvfMKQwAGriW8jENOLAhwebHv1gL4urcuXUTRMprhxM m8ZiWr00g4ehzAg9vOW0jVEz32CA4LdlbyWmEaPBCerkvNagVbgFsrX6Z7ijT14FUCtS O0x2GBuIMlWVyKUrlGVFU1P0rbvrVOLUlWLZSXVh7jok0Ou0sewOFqfrACzLFz4esvKN ibE2BoFxhSFHAwzzNsZxPeT2qqASnLyTYmHdwtEExR3lAOMQ34LNYhjKoJOn0js9HUp3 J/w7fcUm8arUtPSeeQyA5fRCJdqGtOxwLsy2H81plnKVNsoN0SCRDdE/dBxZ6IeoqHZ4 5Beg== 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=Eadon67c/uAihY8EbojEN4hd5r+Ga1mpwTddsmrDYqI=; b=NeCqqnbfrstWBUgvmlK0QsqlLxcejCj9JE8r5hK7T85meN8V6QhAHi0u00Qa3L1Wot Zceairnov37b3ubpolr8CIl/vIhT8+ERKt5i0GwllZPogwBQ+iBAf9yTSmEymg6OPL77 LapzPngIt/B9ZRj8OCCyPucvlEDeXf7bhlP76hAMlPRlSO/VkQyoWUbca0wOwempqq+I YAaeAL1W1jCmOKcWZ7Wt3+WdoUGFjePM4XSfjtkssVwLAJm3bCwhSLDILtmTaisguLf3 WVUgdiw4+PQX3yun+PpUyehKWCjdkiDdICFQyiKcEzqgHZylU51BUqX4JvAYgYQZ1st1 UEkQ== 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 u26si2677457edy.187.2020.06.22.03.32.18; Mon, 22 Jun 2020 03:32:41 -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 S1727105AbgFVKa1 (ORCPT + 99 others); Mon, 22 Jun 2020 06:30:27 -0400 Received: from foss.arm.com ([217.140.110.172]:39072 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726905AbgFVKa0 (ORCPT ); Mon, 22 Jun 2020 06:30:26 -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 922271FB; Mon, 22 Jun 2020 03:30:25 -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 0C9323F71E; Mon, 22 Jun 2020 03:30:23 -0700 (PDT) Date: Mon, 22 Jun 2020 11:30:21 +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: <20200622103020.i2x2oh367j57cowh@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> <20200619184225.ospkxdg5gzh42y2b@e107158-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200619184225.ospkxdg5gzh42y2b@e107158-lin.cambridge.arm.com> 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 19:42, Qais Yousef wrote: > 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). FWIW, they end up in .data section actually. So they're assumed to be initialized. So we must explicitly initialize everything.. Cheers -- Qais Yousef