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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6338C433EF for ; Sun, 26 Jun 2022 21:02:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232269AbiFZVCl convert rfc822-to-8bit (ORCPT ); Sun, 26 Jun 2022 17:02:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232124AbiFZVCk (ORCPT ); Sun, 26 Jun 2022 17:02:40 -0400 Received: from relay4.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7FEC388D for ; Sun, 26 Jun 2022 14:02:38 -0700 (PDT) Received: from omf02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 1C5C76077D; Sun, 26 Jun 2022 21:02:37 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf02.hostedemail.com (Postfix) with ESMTPA id A762F8000D; Sun, 26 Jun 2022 21:02:32 +0000 (UTC) Message-ID: <20e7ca5f3b7b5b473afe891e8b28c83de62bc6d6.camel@perches.com> Subject: Re: [RFC[ Alloc in vsprintf From: Joe Perches To: Kent Overstreet Cc: Linus Torvalds , Andrew Morton , David Laight , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Rasmus Villemoes , Matthew Wilcox , Miguel Ojeda , Andy Shevchenko , LKML , linux-mm Date: Sun, 26 Jun 2022 14:02:31 -0700 In-Reply-To: <20220626205158.bqeyetui3cromscp@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> <93ab94ec92497af13c563c52fc7e1f7f81dac333.camel@perches.com> <20220626205158.bqeyetui3cromscp@moria.home.lan> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.1-0ubuntu1 MIME-Version: 1.0 X-Stat-Signature: utcy8ffawdp8eazsjjuun81kku5n1chr X-Rspamd-Server: rspamout07 X-Rspamd-Queue-Id: A762F8000D X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19dTAM/tGp+XPWuoAl7IzFSwvdBH7J6rlo= X-HE-Tag: 1656277352-34782 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2022-06-26 at 16:51 -0400, Kent Overstreet wrote: > On Sun, Jun 26, 2022 at 01:39:01PM -0700, Joe Perches wrote: > > On Sun, 2022-06-26 at 13:19 -0700, Linus Torvalds wrote: > > > On Sun, Jun 26, 2022 at 12:53 PM 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. > > > > > > > > No one has replied to this but I think it's somewhat sensible. > > > > > > I think that's a bad idea. > > > > Somewhat sensible not sensible... > > > > > Those things are *literally* called from panic situations, which may > > > be while holding core memory allocation locks, or similar. > > > > True, and special_hex_number was used on alloc failure. > > > > > Now, you are correct that the stack buffer is annoying. But I think > > > the proper way to fix that is to say "we already *have* the target > > > buffer, let's use it". > > > > OK, and that's true for all the temp stack buffers in every %p. > > Serious question: why are you trying to half-ass just _one_ of these functions > when I've been working on solving stack allocations in all of them? Because the stack use in _this_ function is quite large. Backporting to stable would be trivial. No so with printbufs. > if you want to help out instead of just slag what I'm > doing... well, it'd be nice... Also nice to _be_ nice. Honestly Kent, I haven't seen much of that from you.