Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp733543pxu; Mon, 23 Nov 2020 02:45:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhIep1+dNl1sUa5io5MKFSdPLJRxI70TgVfgoQSGWK7m6kMV2wZWwocnH/FRYOHzlp5hOO X-Received: by 2002:a17:906:35da:: with SMTP id p26mr43938347ejb.256.1606128308420; Mon, 23 Nov 2020 02:45:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606128308; cv=none; d=google.com; s=arc-20160816; b=NSpxPZ2jKA/yPwkJTTDmfQ0lbQN3TNEzU3FvS8rO2RRCo5Lf8Z7gG0HOv73adNO/JH EaxkasPu8aqikpw/YyrCkZ8VpJvJ3KDinvnCFovl71zJ9aXtw5rrr4B11+fkHRfgEPn2 rx+uXFQDEvxgcAZFi6sDnv3v75jjm1NEaasFekmJvxFqAhGtbz8kO92Zd4kAGc/v3UUm PV0P1whJD0fBfNWBub0y2E2BI9YAETkiHUelC0DTJXfNkGMvLYtn8MQLs0ARdnNCJNyn YvL69TEWEq7ofRovbVhGzuaivr5QccMlcFdgQYbiOYTC9YywJ2v8e7rCUXgqvIt9GjSD e8vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Zu6OfJ95y/pN6IwPuUeH5utOpyu4tZOqYK7qDx71Ni8=; b=Jn2oGlolEnPRZrAbSMF2Szf0WHuSIU3UkNZy7yyXg8up3uLikuiwUCu9Ul/XG4rmUN RPncSSYqr5bcSLT/o1G5R3pxcsdME7Oar6/rP5PS1hkrh6LT/3r0/leC6X5NZXVMO5Zz V1LdtHsAPrMA6lXKaCX5q5Z9eBruk0NSEsnDCt0TDKwKWJG/fr+O2CGb0jTp+eY7zg4v CJVRtPEjJxzfv6wDMspm66qy/thKIew0idfGjDr7ZD2gnHMmim/TMVHv+WVsu5Vpu1bq vBYdLcVnA9tR5HIy9jPA/b2VNpzo3jWZ4uYmMP9i+rqK7dHK6hvPeax9Tpn7m1AK1jMC bhJA== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e18si6207922ejq.261.2020.11.23.02.44.45; Mon, 23 Nov 2020 02:45:08 -0800 (PST) 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728698AbgKWKj3 (ORCPT + 99 others); Mon, 23 Nov 2020 05:39:29 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:38210 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728158AbgKWKj2 (ORCPT ); Mon, 23 Nov 2020 05:39:28 -0500 Received: by mail-lf1-f66.google.com with SMTP id s27so3071007lfp.5; Mon, 23 Nov 2020 02:39:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Zu6OfJ95y/pN6IwPuUeH5utOpyu4tZOqYK7qDx71Ni8=; b=k9JqMwa01H/TlQXgxHuXxiJo/wUA1VsRNt3AxNiDnjURaGSfwSG+QEH43PMQ/Rw1yY jI0xFRSXAQYJo6c9tZyoSmxZKkpl0/SPZVInxv12CnjZSbi9CbCfe7JsoESPfnrPYxcL /wdnvFU12+j7+AiUVRfO3Z/xZljrjdTmRU+U6oWeioBukaiqLgHK7Qg2EseYZFj77X3g u0xkug4Er8VAo6rNgd+IHkwi6U6pEtKYAMYh1oA7k8a83ajT6qc/pvdgxwZm5aNwLm5S 9KipbC5NH5+C8dqx073LE1hbCWvEFbrAaxVHZcoPzf126t2IGpe2BqsfrCR6j7DWieQx W/jw== X-Gm-Message-State: AOAM5315nVHeLZzfG5vjv0Rr2yYdullCmpn9zwwYRaIfZFX49akRVQ94 tF/QIM8NvrHlm8dvXmZAnLfT8v76LDstGQ== X-Received: by 2002:a19:1d0:: with SMTP id 199mr12243126lfb.151.1606127965943; Mon, 23 Nov 2020 02:39:25 -0800 (PST) Received: from xi.terra (c-beaee455.07-184-6d6c6d4.bbcust.telenor.se. [85.228.174.190]) by smtp.gmail.com with ESMTPSA id s20sm493368ljg.15.2020.11.23.02.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 02:39:25 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.93.0.4) (envelope-from ) id 1kh9Ft-0002BT-Sm; Mon, 23 Nov 2020 11:39:34 +0100 Date: Mon, 23 Nov 2020 11:39:33 +0100 From: Johan Hovold To: Jessica Yu Cc: Johan Hovold , linux-kernel@vger.kernel.org, Linus Torvalds , Rob Herring , Frank Rowand , Greg Kroah-Hartman , Arnd Bergmann , Geert Uytterhoeven , Dmitry Torokhov , David Miller , Jakub Jelinek , Peter Zijlstra , Thomas Gleixner , Steven Rostedt , Daniel Kurtz , linux-arch@vger.kernel.org, linux-m68k@lists.linux-m68k.org Subject: Re: [PATCH 0/8] linker-section array fix and clean ups Message-ID: References: <20201103175711.10731-1-johan@kernel.org> <20201106160344.GA12184@linux-8ccs.fritz.box> <20201106164537.GD4085@localhost> <20201111154716.GB5304@linux-8ccs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 13, 2020 at 03:18:36PM +0100, Johan Hovold wrote: > On Wed, Nov 11, 2020 at 04:47:16PM +0100, Jessica Yu wrote: > > > Thanks for providing the links and references. Your explanation and > > this reply from Jakub [1] clarified things for me. I was not aware of > > the distinction gcc made between aligned attributes on types vs. on > > variables. So from what I understand now, gcc suppresses the > > optimization when the alignment is specified in the variable > > declaration, but not necessarily when the aligned attribute is just on > > the type. > > > > Even though it's been in use for a long time, I think it would be > > really helpful if this gcc quirk was explained just a bit more in the > > patch changelogs, especially since this is undocumented behavior. > > I found the explanation in [1] (as well as in your cover letter) to be > > sufficient. Maybe something like "GCC suppresses any optimizations > > increasing alignment when the alignment is specified in the variable > > declaration, as opposed to just on the type definition. Therefore, > > explicitly specify type alignment when declaring entries to prevent > > gcc from increasing alignment." > > Sure, I can try to expand the commit messages a bit. I've amended the commit messages of the relevant patches to make it more clear that the optimisation can be suppressed by specifying alignment when declaring variables, but without making additional claims about the type attribute. I hope the result is acceptable to you. Perhaps you can include a lore link to the patches when applying so that this thread can be found easily if needed. Johan