Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1039822rdb; Mon, 19 Feb 2024 02:09:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVh4lEHz8LYhScwFn2dTN4qM5Dy7/jYQsHRPP3fkoEoxNoJLxdGxF30ojYMk654oCQTfEKLOo+h0P9dBAScqfDx0hfTNsvYrZmhH3NOlA== X-Google-Smtp-Source: AGHT+IEQOK7Gp76DuO58LcDSwm/LxsvYWoZjkNTdUX4QNxV/2Q8eyh6YLitUySB4j5hBlNyVHbDj X-Received: by 2002:a05:6358:341e:b0:179:24b4:41f6 with SMTP id h30-20020a056358341e00b0017924b441f6mr9477777rwd.7.1708337343483; Mon, 19 Feb 2024 02:09:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708337343; cv=pass; d=google.com; s=arc-20160816; b=ENEFpgkNcdZTqqq6MGCCCb4pEUfNhhMEdMHYSCGXKnVYM6Q2LG9Ufk6In8GmAgQjWh GOIfCUfbnYJK9gaOV5BlGSmXMkg3F8BUPL9Ow+Kk8x3RCwEUUX+lBgXb5ol9vnL/rz5t UpfI1uiQR0sy+lWn8uMexBqUah1EZKMEGmG2fAbr7YonsFM8fG0Re1N9FekXLNAe4XrV pL2zjcHS094SKTpm36qniY0Yqt0txO7BZGjk/1Dr24p0los0DPZ40Hhs4mWa98jHIuOT Z6MfuTDuLUWLrUvNVYs7g1N1ovocWbVffGg/+ozPl221sPZ8mdMrE0XoHPW22sYSMgFF +zjg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=gxk0e3O8bT35FXZWS3vzdrhUbpsNOT2IUQee273pX60=; fh=Nw4bECMpuykLKBX+STulIUlWlDRSSfqaTSg6pZqsmOY=; b=pCLJNBhupnDEInMCxIlJhMLCnqXtmTITud2dA2TFrfh0YwVwrTG8OJIlriaw3mgqgY +dnKC+mXt+o0m/ec7KITnqTmvrw9XKWwr0uL8WpD/eNM7ScAt5wDnjvX4VVObjFBmIQ4 VnBdHrqc0zg1XMfMF6RMP3DFaNbJSw55WN52E6ioNEBUdBbRravAhYMPGaVyTIoUakyN 7oOSd1Vl8DPzKYskOPNoBFTktUp+ed3syYfV7euILjWsMH1g2Xri/mR0WXvfEhp4QLH0 vgMclLTXtmuNVmbvp6yd2ibO6Ks55J94mkW6BH4M1rAnH2bZ0siMwuokb4qHmchEHWKL puNw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=F5Zy+6n7; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-71093-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71093-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id cm23-20020a056a00339700b006e045ae9ba7si1553566pfb.173.2024.02.19.02.09.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 02:09:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71093-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=F5Zy+6n7; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-71093-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71093-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1F4FC2833DC for ; Mon, 19 Feb 2024 10:09:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 39F2725603; Mon, 19 Feb 2024 10:08:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="F5Zy+6n7" Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43F8F2556D for ; Mon, 19 Feb 2024 10:08:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708337337; cv=none; b=jSsePPwXVTfCD25Dq39mJ9i5wu35qsPQ4UR+IU9IucwKAeHwOaUgAe7bxM9Th4i7jnOj0NraPSgQe6QccxavCD8IuKGJ5dv+YnhYGRZ4lpOdVZ7uZqVbmliBGWADF4LQvde59goO+zHA+GjmRLnjPCGrgXJoMq6X9EA9rEq1suE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708337337; c=relaxed/simple; bh=vQNnQ4Oebk7hlN/YUyaGGRGNwcnydncgUc66GmV4vZU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AJR2CHWj+I3hFhLbJ87BSkHn2oPVLArAM/1I2aXQ/s3ppBmOSzDcPJtbYzni+MpmUCnlL+zq3Qt9spoYAI9LeHdFZa8Z0AIM/Dv7LwsyVSSq+LyuNzWhQLibETJ00oUkRKZN2m0s1BuYDCB6MKIamBBOgDVuxTtdrmwjhymu34c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=F5Zy+6n7; arc=none smtp.client-ip=95.215.58.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Mon, 19 Feb 2024 05:08:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1708337333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gxk0e3O8bT35FXZWS3vzdrhUbpsNOT2IUQee273pX60=; b=F5Zy+6n7EjnaPhEATMbDMZb5PZViND3IvBazodlaJi0okQpudTUQN1qmmJv0dsIVK5Qakj I7p98xtN/bT0MSgz6QAVqVY9LJUhh0p8Ravgn2RHxv1h36IjTKgop/F5FYgHnX+A+eIAls r7R3dhV9kjO1bamTOGP2oaMivrTWiAA= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Arnd Bergmann Cc: Russell King , Calvin Owens , Dave Martin , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "linux-bcachefs@vger.kernel.org" Subject: Re: [PATCH] arm: Silence gcc warnings about arch ABI drift Message-ID: References: <431dd956-ad31-4da8-ad42-34f7380824bb@app.fastmail.com> <7299839b-06e6-40eb-8024-93ed5f9b733f@app.fastmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7299839b-06e6-40eb-8024-93ed5f9b733f@app.fastmail.com> X-Migadu-Flow: FLOW_OUT 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.