From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 91E0742901E for ; Tue, 25 Aug 2026 12:35:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787661358; cv=none; b=UjJRxfqe4QZLbHuy1ouetx3jvsUFQsCbhydy/oOvrrEpQmNdegNOl9ZgUCOzslml3wcR6OCWsmptf167AbDzZrs7gOIVJFOl0aLoAqlhPFDD/00ikvj9s2aqSN47Jbm+4aQTD2ucu5S1NjqvuFwGQW6YjAyC/x3Osqt2dcye9P0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787661358; c=relaxed/simple; bh=jRfgwgkxpESuexznYfvwTKt23FrJ9msZHlf89Qm0bf4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=FlTjzFLEHYujWpSvzEt75ZN82+LGN3XQ1Wi6dOWgg4khskcEklhL9F9kKcROaBBgUUHlJnVvAtNzI+fVs0frcAF2x6ScRk7hPzwHZFldMraEhNxxHo/O5/oHNEU2amuYzXCwz/GeJpF+BKS7qNcGAntsjil6Ae7QAGEzWqDVizc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=qB5nr1hG; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="qB5nr1hG" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 533C94E4137A; Tue, 25 Aug 2026 12:35:48 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 1F16B604C4; Tue, 25 Aug 2026 12:35:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id F364511C79335; Tue, 25 Aug 2026 14:35:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1787661343; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=3OJtt0xiX5fif9iuFEdnCMWb/FO+kzZFhvV69mHkujE=; b=qB5nr1hGxRMJp5K42Q1o9VLQkUe+S2RA+Mhwnzs7h684WHWsHKYPEcQpALHoVnlWLVPzlp M7NkFFctUQkDZ4P9u+yAtfn24u1Teblk0g5octp6h9TLQxt07NE0d41Zj1+ZKEotQZPXIG rdctE91h/NSRoS47wYpjCcgNBCDzxsa1HjaHrq6ZGFJFTSix/G7iBxZp6NC/vZ9YBYySje wnTeCZMLif+mch2cQRTTl3vL2pq0chzkVBNlRvw0QVWJi2Y2WqulBQMnANqagtBgDbTmOx +PlHA2q1Stu6UOqPsyVaPA7JNBDlaFAI97acQeCFxtUt5JTtqje0o21Rv2Xjmw== From: Miquel Raynal To: David Laight Cc: Karl Mehltretter , Richard Weinberger , Vignesh Raghavendra , Andy Shevchenko , Lukas Wunner , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mtd: cfi_cmdset_0001: shrink do_write_buffer() stack frame In-Reply-To: <20260824085632.2dd08ba9@pumpkin> (David Laight's message of "Mon, 24 Aug 2026 08:56:32 +0100") References: <20260824014703.56502-1-kmehltretter@gmail.com> <20260824085632.2dd08ba9@pumpkin> User-Agent: mu4e 1.12.12; emacs 30.2 Date: Tue, 25 Aug 2026 14:35:33 +0200 Message-ID: <87o6eqgyy2.fsf@bootlin.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=utf-8 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Hi David & Vignesh, On 24/08/2026 at 08:56:32 +01, David Laight = wrote: > On Mon, 24 Aug 2026 03:47:03 +0200 > Karl Mehltretter wrote: > >> arm32 allmodconfig fails to build with gcc: >>=20 >> drivers/mtd/chips/cfi_cmdset_0001.c:1883:1: error: the frame size of 1= 296 >> bytes is larger than 1280 bytes [-Werror=3Dframe-larger-than=3D] >>=20 >> With MTD_MAP_BANK_WIDTH_32 a map_word is 32 bytes, and with KASAN_STACK >> every temporary gets its own redzoned slot. do_write_buffer() builds a >> map_word for each of the twelve commands it issues, and those temporaries >> dominate its frame. > > Looks to me like pretty much all of mtd/map.h should be real functions > and not #defines or inlines. > > The bloat from all those expansions is going to be significant. > They only time they get optimised to anything small is when only > CONFIG_MTD_MAP_BANK_WIDTH_1 is set. > > The execution time of all those that do real io (especially reads) > will be dominated by the io access itself. David, may I ask if you acknowledge the fix? Vignesh, same question, maybe you also test that there is no apparent regression? Thanks, Miqu=C3=A8l