Message ID | fe51512baa18e1480ce997fc535813ce6a0b0721.1708286962.git.jcalvinowens@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-70696-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1072118dyc; Sun, 18 Feb 2024 20:10:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVoaxnvV/No8PZJtEeOsdSHmG0IVwyqIHZGTtOQNPapGPW+GTRrSeloLrw15j1BmaHHRtxWGE4qwM0TiEZG6CgOvGRoXw== X-Google-Smtp-Source: AGHT+IHb4bZiGvdOW5NtMsq+MbIdWoG/sUwF/NTHRIJrvAhUeKCSCgjg02QcWFirsGwg6AXWb+vi X-Received: by 2002:aa7:ce0c:0:b0:564:5a23:4ec with SMTP id d12-20020aa7ce0c000000b005645a2304ecmr2398638edv.32.1708315809907; Sun, 18 Feb 2024 20:10:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708315809; cv=pass; d=google.com; s=arc-20160816; b=rwddUkEyHvQjv4KkYw7NZlf7QcP1+k/ADoKhu/uer4mO4n9F0x1XQHIUe5gQJJctmt 71NXZgqnuIxx4hbDl26e2dVHJ9R4SBmlcrG8sCpCg23pc0BMUkQmF294Rg2olgng7Eld L14rSMTMWMkYR57wsj9Hbfn1sfdbIH/MU0aYdrObBDI+SU6glQxTFQXMXcq5bEW5c19Y 53FYzcUzBgJgd5r5iT5+WDNZH5Us5WiAX9dy3J1EQafvXuvNtim6PCUwttGpCJgS1c8u cUJayDzGNvpt6zhUmgeln+F1Ygd3n0lvXFR5L+wpIBPLTCBRq7dPW3kXMxuzRJDuF+cB lnmA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=TVTC/+7z9UujUPV6yizeWZYMhqdw9/+eyC0vrV47nAM=; fh=x84YHbaOGbJaxmroXhuKOoZeph+tFAcGF5HVstl10f8=; b=bLgJDPDpPa1h9JaKXhhnbagDWxdrFs1Hku8tvx4FQZESXCaPZ049yJGPi0Wk5/uqBb 3+w/d1Eo0Tu57O33qHUIajZfSl7Ot+mND9Lp6ZQFaqotMB9qH04gB8bsfsL1QIGg7SGy HlyOgIqiR+cS0yKJbPwzXcfxxabq5nLDixoFNACY0V+3QDX4Gc/Dxa4tloW+PWyfupPo dzwwP2K6J1CYgD4/ceJGXtebYrg6YOVVMJW2d3wKQQd9oDveMJ9ZD10Xx4sBh1d7DTE4 8YJHrls2isFYCoCENXnkJiYnlvqlAMR0xeG2nD84wXzdHBeFj7c3YEgavUZJdqCQtZoL f7Vw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ibSaV+Yv; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-70696-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70696-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id d21-20020a056402517500b00563886a14ecsi2139010ede.48.2024.02.18.20.10.09 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 20:10:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70696-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ibSaV+Yv; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-70696-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70696-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7D47D1F2152A for <ouuuleilei@gmail.com>; Mon, 19 Feb 2024 04:10:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 12D7AC2DB; Mon, 19 Feb 2024 04:09:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ibSaV+Yv" Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 031FC6FC2 for <linux-kernel@vger.kernel.org>; Mon, 19 Feb 2024 04:09:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708315793; cv=none; b=ZDzgaLjKla809HvFH+UR2p9FFfXmoez+JoaKM2jzdnwzphstSCXQPf4fuZvIABGpFBKrN55SY3wrBKaXlbXvHAEkTTLBrEIP+jYFRqbkix/AERnmuiE0zVEinjSpPPiUregZRsuhNjOu0m5RpLVFFJUaT0CKEhQng9zBtqkZJTM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708315793; c=relaxed/simple; bh=TC3g7r12yg/hLMumkJ5ZK916K7lRNtfFKcU36bsB3qA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=EmpF8zkDcDmS8nwgi/t1M5bIMXOr1/kLXx/S156zcdb04Nw9lfhvQfH/NFN9M7D+ZU9KON9y9MJh5drv2Y5v5mgYB2FPtghNjJZRpx+NRcYLRg82Qs1m4u29R8GGKw8xmUkRxCmjjfW6p27yN+XollFLo8IjSSN2v88fQbBHRLs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ibSaV+Yv; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1dbae7b8ff2so9082185ad.3 for <linux-kernel@vger.kernel.org>; Sun, 18 Feb 2024 20:09:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708315791; x=1708920591; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=TVTC/+7z9UujUPV6yizeWZYMhqdw9/+eyC0vrV47nAM=; b=ibSaV+YvyPKHODK8ZMTc1aVtyipND44LDA6hCtHgb9vq0rcq2PO1cTUFNT4ELbi6c7 hwGcoxOtry4L2RouAXjgEb4u3UWWuDuj7Ri/031ZT29erhI8SWMMIi89fyHzD0BTYLW6 dIkNWlSkuJcl5hZDK5ULDGJewVqW6+C3bEZqVBet78J/KjfZpp7sENRtW2l2h55U6S3b EtfUrWJhkejlOSOLqjfVUKY5OEsmhn2Fk66dVVTjo5kakUvaaCSGi/wSEfuutq/1Lxkq nkyTFdrHuhCMeZ9rffFQEXvEPWpAbxSsUtsh3gacDmIbMqUeeZvpgkiaDinppvlDhp5f ZAyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708315791; x=1708920591; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TVTC/+7z9UujUPV6yizeWZYMhqdw9/+eyC0vrV47nAM=; b=JxObKS7xrOHOBUQKBOU3nU8YkyoOQrOMnalA2CWG4IsbFBUhUc4/YnYvkamalock3W uhA7NkiUvDuskESSUQmV5bbLDZWHK7GEZRCUqBXcY7VKm1qaY2kdZJw8VlaUUvHxHhPK pJOUv0qY8R1rBibPlrpPWt7/JnUFrouz3Qp+7jtBd1Q3V4em3DKVK8u7Y6uhmsB4SiiR Zc3yWbD2pAaiD1v6fqipO8JRXg+wTLwq6l4ucZwBgpamWpctePvYTTuEHlvXkAJPhjJr bApV4dl5QVVM6fF1NBHiUWbhwNkN3A/qv5TFMnLSVc+1iR6jpatNwJFZrxiTAADmOPRQ 53KQ== X-Forwarded-Encrypted: i=1; AJvYcCUbPfqgwCDWYuQCQDDYOfVaJYqULQc/oz7D5QhRmSy9a9njmoAh4P7JCqtDYpBEV/eR1tbXRflQI9Y5Ogphv7QWIuxislS2je8SYbGW X-Gm-Message-State: AOJu0YzLAZNC4q3MWBb33SBNYexRQ9iKwht4tzWM/ld8KWFM20EQjU3W snSTvZkOgQ9vBu0EnGLFUkUMFemQKczRU5gasdPDF004efOMhWd3 X-Received: by 2002:a17:902:c949:b0:1dc:43d:962 with SMTP id i9-20020a170902c94900b001dc043d0962mr63325pla.42.1708315791120; Sun, 18 Feb 2024 20:09:51 -0800 (PST) Received: from mozart.vkv.me ([192.184.167.79]) by smtp.gmail.com with ESMTPSA id f4-20020a170902ce8400b001d95d47cce4sm3365746plg.138.2024.02.18.20.09.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 20:09:50 -0800 (PST) From: Calvin Owens <jcalvinowens@gmail.com> To: Russell King <linux@armlinux.org.uk>, Arnd Bergmann <arnd@arndb.de> Cc: Dave Martin <Dave.Martin@arm.com>, jcalvinowens@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm: Silence gcc warnings about arch ABI drift Date: Sun, 18 Feb 2024 20:09:06 -0800 Message-ID: <fe51512baa18e1480ce997fc535813ce6a0b0721.1708286962.git.jcalvinowens@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791298958790632195 X-GMAIL-MSGID: 1791298958790632195 |
Series |
arm: Silence gcc warnings about arch ABI drift
|
|
Commit Message
Calvin Owens
Feb. 19, 2024, 4:09 a.m. UTC
32-bit arm builds uniquely emit a lot of spam like this:
fs/bcachefs/backpointers.c: In function ‘extent_matches_bp’:
fs/bcachefs/backpointers.c:15:13: note: parameter passing for argument of type ‘struct bch_backpointer’ changed in GCC 9.1
Apply the arm64 change from commit ebcc5928c5d9 ("arm64: Silence gcc
warnings about arch ABI drift") to silence them. It seems like Dave's
original rationale applies here too.
Cc: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Calvin Owens <jcalvinowens@gmail.com>
---
arch/arm/Makefile | 3 +++
1 file changed, 3 insertions(+)
Comments
On Mon, Feb 19, 2024, at 05:09, Calvin Owens wrote: > 32-bit arm builds uniquely emit a lot of spam like this: > > fs/bcachefs/backpointers.c: In function ‘extent_matches_bp’: > fs/bcachefs/backpointers.c:15:13: note: parameter passing for > argument of type ‘struct bch_backpointer’ changed in GCC 9.1 > > Apply the arm64 change from commit ebcc5928c5d9 ("arm64: Silence gcc > warnings about arch ABI drift") to silence them. It seems like Dave's > original rationale applies here too. > > Cc: Dave Martin <Dave.Martin@arm.com> > Signed-off-by: Calvin Owens <jcalvinowens@gmail.com> > --- I think these should be addressed in bcachefs instead. While it's not the fault of bcachefs that the calling convention changed between gcc versions, have a look at the actual structure layout: struct bch_val { __u64 __nothing[0]; }; struct bpos { /* * Word order matches machine byte order - btree code treats a bpos as a * single large integer, for search/comparison purposes * * Note that wherever a bpos is embedded in another on disk data * structure, it has to be byte swabbed when reading in metadata that * wasn't written in native endian order: */ #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ __u32 snapshot; __u64 offset; __u64 inode; #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ __u64 inode; __u64 offset; /* Points to end of extent - sectors */ __u32 snapshot; #else #error edit for your odd byteorder. #endif } __packed struct bch_backpointer { struct bch_val v; __u8 btree_id; __u8 level; __u8 data_type; __u64 bucket_offset:40; __u32 bucket_len; struct bpos pos; } __packed __aligned(8); This is not something that should ever be passed by value into a function. Arnd
On Mon, Feb 19, 2024 at 07:21:11AM +0100, Arnd Bergmann wrote: > On Mon, Feb 19, 2024, at 05:09, Calvin Owens wrote: > > 32-bit arm builds uniquely emit a lot of spam like this: > > > > fs/bcachefs/backpointers.c: In function ‘extent_matches_bp’: > > fs/bcachefs/backpointers.c:15:13: note: parameter passing for > > argument of type ‘struct bch_backpointer’ changed in GCC 9.1 > > > > Apply the arm64 change from commit ebcc5928c5d9 ("arm64: Silence gcc > > warnings about arch ABI drift") to silence them. It seems like Dave's > > original rationale applies here too. > > > > Cc: Dave Martin <Dave.Martin@arm.com> > > Signed-off-by: Calvin Owens <jcalvinowens@gmail.com> > > --- > > I think these should be addressed in bcachefs instead. > While it's not the fault of bcachefs that the calling > convention changed between gcc versions, have a look at > the actual structure layout: > > struct bch_val { > __u64 __nothing[0]; > }; > struct bpos { > /* > * Word order matches machine byte order - btree code treats a bpos as a > * single large integer, for search/comparison purposes > * > * Note that wherever a bpos is embedded in another on disk data > * structure, it has to be byte swabbed when reading in metadata that > * wasn't written in native endian order: > */ > #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ > __u32 snapshot; > __u64 offset; > __u64 inode; > #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ > __u64 inode; > __u64 offset; /* Points to end of extent - sectors */ > __u32 snapshot; > #else > #error edit for your odd byteorder. > #endif > } __packed > struct bch_backpointer { > struct bch_val v; > __u8 btree_id; > __u8 level; > __u8 data_type; > __u64 bucket_offset:40; > __u32 bucket_len; > struct bpos pos; > } __packed __aligned(8); > > This is not something that should ever be passed by value > into a function. Why?
On Monday 02/19 at 07:21 +0100, Arnd Bergmann wrote: > On Mon, Feb 19, 2024, at 05:09, Calvin Owens wrote: > > 32-bit arm builds uniquely emit a lot of spam like this: > > > > fs/bcachefs/backpointers.c: In function ‘extent_matches_bp’: > > fs/bcachefs/backpointers.c:15:13: note: parameter passing for > > argument of type ‘struct bch_backpointer’ changed in GCC 9.1 > > > > Apply the arm64 change from commit ebcc5928c5d9 ("arm64: Silence gcc > > warnings about arch ABI drift") to silence them. It seems like Dave's > > original rationale applies here too. > > > > Cc: Dave Martin <Dave.Martin@arm.com> > > Signed-off-by: Calvin Owens <jcalvinowens@gmail.com> > > --- > > I think these should be addressed in bcachefs instead. That seems reasonable to me. For clarity, I just happened to notice this while doing allyesconfig cross builds for something entirely unrelated. I'll take it up with them. It's not a big problem from my POV, the notes don't cause -Werror builds to fail or anything like that. Thanks, Calvin > While it's not the fault of bcachefs that the calling > convention changed between gcc versions, have a look at > the actual structure layout: > > struct bch_val { > __u64 __nothing[0]; > }; > struct bpos { > /* > * Word order matches machine byte order - btree code treats a bpos as a > * single large integer, for search/comparison purposes > * > * Note that wherever a bpos is embedded in another on disk data > * structure, it has to be byte swabbed when reading in metadata that > * wasn't written in native endian order: > */ > #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ > __u32 snapshot; > __u64 offset; > __u64 inode; > #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ > __u64 inode; > __u64 offset; /* Points to end of extent - sectors */ > __u32 snapshot; > #else > #error edit for your odd byteorder. > #endif > } __packed > struct bch_backpointer { > struct bch_val v; > __u8 btree_id; > __u8 level; > __u8 data_type; > __u64 bucket_offset:40; > __u32 bucket_len; > struct bpos pos; > } __packed __aligned(8); > > This is not something that should ever be passed by value > into a function. > > Arnd
On Sun, Feb 18, 2024 at 10:58:07PM -0800, Calvin Owens wrote: > On Monday 02/19 at 07:21 +0100, Arnd Bergmann wrote: > > On Mon, Feb 19, 2024, at 05:09, Calvin Owens wrote: > > > 32-bit arm builds uniquely emit a lot of spam like this: > > > > > > fs/bcachefs/backpointers.c: In function ‘extent_matches_bp’: > > > fs/bcachefs/backpointers.c:15:13: note: parameter passing for > > > argument of type ‘struct bch_backpointer’ changed in GCC 9.1 > > > > > > Apply the arm64 change from commit ebcc5928c5d9 ("arm64: Silence gcc > > > warnings about arch ABI drift") to silence them. It seems like Dave's > > > original rationale applies here too. > > > > > > Cc: Dave Martin <Dave.Martin@arm.com> > > > Signed-off-by: Calvin Owens <jcalvinowens@gmail.com> > > > --- > > > > I think these should be addressed in bcachefs instead. > > That seems reasonable to me. For clarity, I just happened to notice this > while doing allyesconfig cross builds for something entirely unrelated. > > I'll take it up with them. It's not a big problem from my POV, the notes > don't cause -Werror builds to fail or anything like that. Considering we're not dynamic linking it's a non issue for us.
On Monday 02/19 at 02:03 -0500, Kent Overstreet wrote: > On Sun, Feb 18, 2024 at 10:58:07PM -0800, Calvin Owens wrote: > > On Monday 02/19 at 07:21 +0100, Arnd Bergmann wrote: > > > On Mon, Feb 19, 2024, at 05:09, Calvin Owens wrote: > > > > 32-bit arm builds uniquely emit a lot of spam like this: > > > > > > > > fs/bcachefs/backpointers.c: In function ‘extent_matches_bp’: > > > > fs/bcachefs/backpointers.c:15:13: note: parameter passing for > > > > argument of type ‘struct bch_backpointer’ changed in GCC 9.1 > > > > > > > > Apply the arm64 change from commit ebcc5928c5d9 ("arm64: Silence gcc > > > > warnings about arch ABI drift") to silence them. It seems like Dave's > > > > original rationale applies here too. > > > > > > > > Cc: Dave Martin <Dave.Martin@arm.com> > > > > Signed-off-by: Calvin Owens <jcalvinowens@gmail.com> > > > > --- > > > > > > I think these should be addressed in bcachefs instead. > > > > That seems reasonable to me. For clarity, I just happened to notice this > > while doing allyesconfig cross builds for something entirely unrelated. > > > > I'll take it up with them. It's not a big problem from my POV, the notes > > don't cause -Werror builds to fail or anything like that. > > Considering we're not dynamic linking it's a non issue for us. [ dropping arm people/lists ] Would you mind taking this then? Thanks, Calvin ---8<--- From: Calvin Owens <jcalvinowens@gmail.com> Subject: [PATCH] bcachefs: Silence gcc warnings about arm arch ABI drift 32-bit arm builds emit a lot of spam like this: fs/bcachefs/backpointers.c: In function ‘extent_matches_bp’: fs/bcachefs/backpointers.c:15:13: note: parameter passing for argument of type ‘struct bch_backpointer’ changed in GCC 9.1 Apply the change from commit ebcc5928c5d9 ("arm64: Silence gcc warnings about arch ABI drift") to fs/bcachefs/ to silence them. Signed-off-by: Calvin Owens <jcalvinowens@gmail.com> --- fs/bcachefs/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/bcachefs/Makefile b/fs/bcachefs/Makefile index 1a05cecda7cc..3433959d4f35 100644 --- a/fs/bcachefs/Makefile +++ b/fs/bcachefs/Makefile @@ -90,3 +90,6 @@ bcachefs-y := \ xattr.o obj-$(CONFIG_MEAN_AND_VARIANCE_UNIT_TEST) += mean_and_variance_test.o + +# Silence "note: xyz changed in GCC X.X" messages +subdir-ccflags-y += $(call cc-disable-warning, psabi)
On Sun, Feb 18, 2024 at 11:36:08PM -0800, Calvin Owens wrote: > On Monday 02/19 at 02:03 -0500, Kent Overstreet wrote: > > On Sun, Feb 18, 2024 at 10:58:07PM -0800, Calvin Owens wrote: > > > On Monday 02/19 at 07:21 +0100, Arnd Bergmann wrote: > > > > On Mon, Feb 19, 2024, at 05:09, Calvin Owens wrote: > > > > > 32-bit arm builds uniquely emit a lot of spam like this: > > > > > > > > > > fs/bcachefs/backpointers.c: In function ‘extent_matches_bp’: > > > > > fs/bcachefs/backpointers.c:15:13: note: parameter passing for > > > > > argument of type ‘struct bch_backpointer’ changed in GCC 9.1 > > > > > > > > > > Apply the arm64 change from commit ebcc5928c5d9 ("arm64: Silence gcc > > > > > warnings about arch ABI drift") to silence them. It seems like Dave's > > > > > original rationale applies here too. > > > > > > > > > > Cc: Dave Martin <Dave.Martin@arm.com> > > > > > Signed-off-by: Calvin Owens <jcalvinowens@gmail.com> > > > > > --- > > > > > > > > I think these should be addressed in bcachefs instead. > > > > > > That seems reasonable to me. For clarity, I just happened to notice this > > > while doing allyesconfig cross builds for something entirely unrelated. > > > > > > I'll take it up with them. It's not a big problem from my POV, the notes > > > don't cause -Werror builds to fail or anything like that. > > > > Considering we're not dynamic linking it's a non issue for us. > > [ dropping arm people/lists ] > > Would you mind taking this then? > > Thanks, > Calvin That looks like just the thing - thanks! > ---8<--- > From: Calvin Owens <jcalvinowens@gmail.com> > Subject: [PATCH] bcachefs: Silence gcc warnings about arm arch ABI drift > > 32-bit arm builds emit a lot of spam like this: > > fs/bcachefs/backpointers.c: In function ‘extent_matches_bp’: > fs/bcachefs/backpointers.c:15:13: note: parameter passing for argument of type ‘struct bch_backpointer’ changed in GCC 9.1 > > Apply the change from commit ebcc5928c5d9 ("arm64: Silence gcc warnings > about arch ABI drift") to fs/bcachefs/ to silence them. > > Signed-off-by: Calvin Owens <jcalvinowens@gmail.com> > --- > fs/bcachefs/Makefile | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/fs/bcachefs/Makefile b/fs/bcachefs/Makefile > index 1a05cecda7cc..3433959d4f35 100644 > --- a/fs/bcachefs/Makefile > +++ b/fs/bcachefs/Makefile > @@ -90,3 +90,6 @@ bcachefs-y := \ > xattr.o > > obj-$(CONFIG_MEAN_AND_VARIANCE_UNIT_TEST) += mean_and_variance_test.o > + > +# Silence "note: xyz changed in GCC X.X" messages > +subdir-ccflags-y += $(call cc-disable-warning, psabi) > -- > 2.43.0 >
On Mon, Feb 19, 2024, at 07:25, Kent Overstreet wrote: > On Mon, Feb 19, 2024 at 07:21:11AM +0100, Arnd Bergmann wrote: >> >> This is not something that should ever be passed by value >> into a function. > > Why? Mostly because of the size, as 8 registers (on 32-bit) or 4 registers (on 64 bit) mean that even in the best case passing these through argument registers is going to cause spills if anything else gets passed as well. Passing them through the stack in turn requires the same number of registers to get copied in and out for every call, which in turn can evict other registers that hold local variables. On top of that, you have all the complications that make passing them inconsistent and possibly worse depending on how exactly a particular ABI passes structures: - If each struct member is passed individually, you always need eight registers - bitfields tend to get the compiler into corner cases that are not as optimized - __u64 members tend to need even/odd register pairs on many 32-bit architectures. - on big-endian kernels, two __u64 members are misaligned, which causes them to be in two halves of separate registers if the struct gets passed as four 64-bit regs. I can't think of any platform where passing the structure through a const pointer ends up worse than passing by value. Arnd
On Mon, Feb 19, 2024 at 09:26:51AM +0000, Russell King (Oracle) wrote: > On Mon, Feb 19, 2024 at 07:21:11AM +0100, Arnd Bergmann wrote: > > I think these should be addressed in bcachefs instead. > > While it's not the fault of bcachefs that the calling > > convention changed between gcc versions, have a look at > > the actual structure layout: > > > > struct bch_val { > > __u64 __nothing[0]; > > }; > > struct bpos { > > /* > > * Word order matches machine byte order - btree code treats a bpos as a > > * single large integer, for search/comparison purposes > > * > > * Note that wherever a bpos is embedded in another on disk data > > * structure, it has to be byte swabbed when reading in metadata that > > * wasn't written in native endian order: > > */ > > #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ > > __u32 snapshot; > > __u64 offset; > > __u64 inode; > > #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ > > __u64 inode; > > __u64 offset; /* Points to end of extent - sectors */ > > __u32 snapshot; > > #else > > #error edit for your odd byteorder. > > #endif > > } __packed > > struct bch_backpointer { > > struct bch_val v; > > __u8 btree_id; > > __u8 level; > > __u8 data_type; > > __u64 bucket_offset:40; > > __u32 bucket_len; > > struct bpos pos; > > } __packed __aligned(8); > > > > This is not something that should ever be passed by value > > into a function. > > +1 - bcachefs definitely needs fixing. Passing all that as an argument > not only means that it has to be read into registers, but also when > accessing members, it has to be extracted from those registers as well. > > Passing that by argument is utterly insane. If the compiler people can't figure out a vaguely efficient way to pass a small struct by value, that's their problem - from the way you describe it, I have to wonder at what insanity is going on there.
On Mon, Feb 19, 2024 at 09:52:08AM +0000, Russell King (Oracle) wrote: > On Mon, Feb 19, 2024 at 04:40:00AM -0500, Kent Overstreet wrote: > > On Mon, Feb 19, 2024 at 09:26:51AM +0000, Russell King (Oracle) wrote: > > > On Mon, Feb 19, 2024 at 07:21:11AM +0100, Arnd Bergmann wrote: > > > > I think these should be addressed in bcachefs instead. > > > > While it's not the fault of bcachefs that the calling > > > > convention changed between gcc versions, have a look at > > > > the actual structure layout: > > > > > > > > struct bch_val { > > > > __u64 __nothing[0]; > > > > }; > > > > struct bpos { > > > > /* > > > > * Word order matches machine byte order - btree code treats a bpos as a > > > > * single large integer, for search/comparison purposes > > > > * > > > > * Note that wherever a bpos is embedded in another on disk data > > > > * structure, it has to be byte swabbed when reading in metadata that > > > > * wasn't written in native endian order: > > > > */ > > > > #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ > > > > __u32 snapshot; > > > > __u64 offset; > > > > __u64 inode; > > > > #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ > > > > __u64 inode; > > > > __u64 offset; /* Points to end of extent - sectors */ > > > > __u32 snapshot; > > > > #else > > > > #error edit for your odd byteorder. > > > > #endif > > > > } __packed > > > > struct bch_backpointer { > > > > struct bch_val v; > > > > __u8 btree_id; > > > > __u8 level; > > > > __u8 data_type; > > > > __u64 bucket_offset:40; > > > > __u32 bucket_len; > > > > struct bpos pos; > > > > } __packed __aligned(8); > > > > > > > > This is not something that should ever be passed by value > > > > into a function. > > > > > > +1 - bcachefs definitely needs fixing. Passing all that as an argument > > > not only means that it has to be read into registers, but also when > > > accessing members, it has to be extracted from those registers as well. > > > > > > Passing that by argument is utterly insane. > > > > If the compiler people can't figure out a vaguely efficient way to pass > > a small struct by value, that's their problem - from the way you > > describe it, I have to wonder at what insanity is going on there. > > It sounds like you have a personal cruisade here. > > Passing structures on through function arguments is never efficient. > The entire thing _has_ to be loaded from memory at function call and > either placed onto the stack (creating an effective memcpy() on every > function call) or into registers. Fundamentally. It's not something > compiler people can mess around with. > > Sorry but it's bcachefs that's the problem here, and well done to the > compiler people for pointing out stupid code. Eh? Passing via stack copy is normal and expected; you were talking about something else. I'm not always trying to write code that will generate the fastest assembly possible; there aro other considerations. As long a the compiler is doing something /reasonable/, the code is fine.
On Mon, Feb 19, 2024, at 10:40, Kent Overstreet wrote: > On Mon, Feb 19, 2024 at 09:26:51AM +0000, Russell King (Oracle) wrote: >> On Mon, Feb 19, 2024 at 07:21:11AM +0100, Arnd Bergmann wrote: >> >> +1 - bcachefs definitely needs fixing. Passing all that as an argument >> not only means that it has to be read into registers, but also when >> accessing members, it has to be extracted from those registers as well. >> >> Passing that by argument is utterly insane. > > If the compiler people can't figure out a vaguely efficient way to pass > a small struct by value, that's their problem - from the way you > describe it, I have to wonder at what insanity is going on there. On most ABIs, there are only six argument registers (24 bytes) for function calls. The compiler has very little choice here if it tries to pass 32 bytes worth of data. On both x86_64 and arm64, there are theoretically enough registers to pass the data, but kernel disallows using the vector and floating point registers for passing large compounds arguments. The integer registers on x86 apparently allow passing compounds up to 16 bytes, but only if all members are naturally aligned. Since you have both __packed members and bitfields, the compiler would not even be allowed to pass the structure efficiently even if it was small enough. Arnd
On Mon, Feb 19, 2024 at 10:57:46AM +0100, Arnd Bergmann wrote: > On Mon, Feb 19, 2024, at 10:40, Kent Overstreet wrote: > > On Mon, Feb 19, 2024 at 09:26:51AM +0000, Russell King (Oracle) wrote: > >> On Mon, Feb 19, 2024 at 07:21:11AM +0100, Arnd Bergmann wrote: > >> > >> +1 - bcachefs definitely needs fixing. Passing all that as an argument > >> not only means that it has to be read into registers, but also when > >> accessing members, it has to be extracted from those registers as well. > >> > >> Passing that by argument is utterly insane. > > > > If the compiler people can't figure out a vaguely efficient way to pass > > a small struct by value, that's their problem - from the way you > > describe it, I have to wonder at what insanity is going on there. > > On most ABIs, there are only six argument registers (24 bytes) > for function calls. The compiler has very little choice here if > it tries to pass 32 bytes worth of data. > > On both x86_64 and arm64, there are theoretically enough > registers to pass the data, but kernel disallows using the > vector and floating point registers for passing large > compounds arguments. > > The integer registers on x86 apparently allow passing compounds > up to 16 bytes, but only if all members are naturally aligned. > Since you have both __packed members and bitfields, the compiler > would not even be allowed to pass the structure efficiently > even if it was small enough. from an efficiency pov, the thing that matters is whether the compiler is going to emit a call to memcpy (bad) or inline the copy - and also whether the compiler can elide the copy if the variable is never modified in the callee. if were passing by reference it's also going to be living on the stack, not registers.
On Mon, Feb 19, 2024 at 07:53:15PM +0000, David Laight wrote: > ... > > I'm not always trying to write code that will generate the fastest > > assembly possible; there aro other considerations. As long a the > > compiler is doing something /reasonable/, the code is fine. > > Speaks the man who was writing horrid 'jit' code ... > > This also begs the question of why that data is so compressed > in the first place? > It is quite likely that a few accesses generate far more code > than the data you are attempting to save. It's easy to understand if you understand profiling, benchmarking and cache effects. That 'jit code' is for _all_ filesystem metadata.
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 473280d5adce..184a5a2c7756 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -28,6 +28,9 @@ KBUILD_CFLAGS += $(call cc-option,-mno-fdpic) # This should work on most of the modern platforms KBUILD_DEFCONFIG := multi_v7_defconfig +# Silence "note: xyz changed in GCC X.X" messages +KBUILD_CFLAGS += $(call cc-disable-warning, psabi) + # defines filename extension depending memory management type. ifeq ($(CONFIG_MMU),) MMUEXT := -nommu