From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C991C43334 for ; Sun, 26 Jun 2022 20:13:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A813C8E0002; Sun, 26 Jun 2022 16:13:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A31648E0001; Sun, 26 Jun 2022 16:13:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F8CE8E0002; Sun, 26 Jun 2022 16:13:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 817F88E0001 for ; Sun, 26 Jun 2022 16:13:28 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 47FB334CD9 for ; Sun, 26 Jun 2022 20:13:28 +0000 (UTC) X-FDA: 79621486896.05.B26526D Received: from relay3.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by imf14.hostedemail.com (Postfix) with ESMTP id EE020100013 for ; Sun, 26 Jun 2022 20:13:27 +0000 (UTC) Received: from omf03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id D012C1201EE; Sun, 26 Jun 2022 20:13:26 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf03.hostedemail.com (Postfix) with ESMTPA id 642306000B; Sun, 26 Jun 2022 20:13:19 +0000 (UTC) Message-ID: <48797a0c929e87a72fccc48ce5cb95263da23e22.camel@perches.com> Subject: Re: [RFC[ Alloc in vsprintf From: Joe Perches To: Kent Overstreet Cc: Andrew Morton , Linus Torvalds , David Laight , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Rasmus Villemoes , Matthew Wilcox , Miguel Ojeda , Andy Shevchenko , LKML , linux-mm Date: Sun, 26 Jun 2022 13:13:18 -0700 In-Reply-To: <20220626200618.jhxu5lg4w7o2irhr@moria.home.lan> References: <20220620004233.3805-1-kent.overstreet@gmail.com> <0a5901f8460f452a89c9b0cda32fb833@AcuMS.aculab.com> <20220620150514.3tjy5dv7pv5frcwd@moria.home.lan> <53d77ae6101a0f24cfb694174d4c7699424c57e8.camel@perches.com> <20220621005752.ohiq5besmy3r5rjo@moria.home.lan> <355e912490dbaef8fe4e12df0201c3f5b439565d.camel@perches.com> <20220626200618.jhxu5lg4w7o2irhr@moria.home.lan> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.1-0ubuntu1 MIME-Version: 1.0 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+tTOT7eiYgj584PVuGjuFgfb+g9zXp/lI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656274408; a=rsa-sha256; cv=none; b=LWSFf8myoTV3ki40ek2YpCDU8VMzrBPq485qYrpQR4DGmmhe3mf+kk4OKoP4d1Jp29rU+T YA4xnGZxtqcFUg82ni9tDLuXMSjAJn9m62L9ERS4Lymd8SChUr1U3gIZy6yd6RzOnKGQZ5 8m9BBPf1d5WdTSJedq3KhqoNiEj7qqI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656274408; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wIFdf3xrZBJkCUBREsXhb7VJoerA3m9UICJzRNLk044=; b=aIvMWc1xceH22pm3ZjqixbOPoTRldHRpCMavnQok8Vg/9h7AxTWECuU9NqIoRwQHL7cvhY /aUrRyBX5Cc23Puv96unk3QaKXBtxkXeNuV3BUzGZ/BrhloPK2cfSzOVUxOv0WYWNnziVf z36SnMBIsv47+TTziuZIVPpcbd20fkY= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=none; dmarc=none; spf=none (imf14.hostedemail.com: domain of joe@perches.com has no SPF policy when checking 216.40.44.14) smtp.mailfrom=joe@perches.com X-HE-Tag-Orig: 1656274399-556557 X-Stat-Signature: 6gnuk3psrs7fpbtt65ibgicyg4b39buy X-Rspamd-Queue-Id: EE020100013 Authentication-Results: imf14.hostedemail.com; dkim=none; dmarc=none; spf=none (imf14.hostedemail.com: domain of joe@perches.com has no SPF policy when checking 216.40.44.14) smtp.mailfrom=joe@perches.com X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1656274407-36266 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sun, 2022-06-26 at 16:06 -0400, Kent Overstreet wrote: > On Sun, Jun 26, 2022 at 12:53:26PM -0700, Joe Perches wrote: > > In a reply to the printbufs thread, I wrote a proposal to use an > > alloc to reduce stack in vsprintf when CONFIG_KALLSYMS is enabled. > >=20 > > No one has replied to this but I think it's somewhat sensible. > >=20 > > Thoughts? >=20 > As functions get converted to printbufs the separate stack allocated buff= ers > become unnecessary, because printbufs have helpers that do bounds checkin= g and > make outputting to the vsprintf buffer painless. So it's not necessary - = I > haven't fully converted symbol_string() yet but I'll do so by the time I = mail > out the next round of patches. _If_ the printfbufs patch series gets applied. I think that series is not great yet. Even if applied via something like the printbufs series, the stack use of this function needs/could use attending. ~700 bytes of stack use here isn't great.