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 DCF3FC433EF for ; Sun, 26 Jun 2022 21:02:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2ABD38E0002; Sun, 26 Jun 2022 17:02:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 25B858E0001; Sun, 26 Jun 2022 17:02:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 123A38E0002; Sun, 26 Jun 2022 17:02:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 031DB8E0001 for ; Sun, 26 Jun 2022 17:02:40 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id CF7E88069F for ; Sun, 26 Jun 2022 21:02:39 +0000 (UTC) X-FDA: 79621610838.03.77DC24F Received: from relay5.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by imf19.hostedemail.com (Postfix) with ESMTP id 7F7861A002E for ; Sun, 26 Jun 2022 21:02:38 +0000 (UTC) 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: quoted-printable User-Agent: Evolution 3.44.1-0ubuntu1 MIME-Version: 1.0 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19dTAM/tGp+XPWuoAl7IzFSwvdBH7J6rlo= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; dmarc=none; spf=none (imf19.hostedemail.com: domain of joe@perches.com has no SPF policy when checking 216.40.44.15) smtp.mailfrom=joe@perches.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656277359; 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=LgS9t4S9WpPkw525Bj5Qev34p/+foCyEUQWbQt2KzAU=; b=6agdUiL0QrwXmyGuOzQ+w0Lxg5q6nu+5aLTQISQUp4NVQhqoDKJOvldwGD7WaFW+WbNQUf VIaTTxtpjbw58GVuoNmqHXuCCI6j5KZ1FZ4SGiYMY0/rLhqUUhgtWTHs0HJOyptB0L6R3v ys81aS9YTFOJVKwDN9lB2JKo6ZdIU7s= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656277359; a=rsa-sha256; cv=none; b=CT700E4ZZ+VdzSENdqBmXEybGkjlH4GW97142IMyMLqJtBQSy263EQ86KJbvsy1Iu1GbaJ k679flmAiSCLEhvaEfs5JjJjI/rvFMMin/4sMs4KIrFImOZBpt0ij8BC40cnFC9WW/9Hy9 PDGfs+iyrjYT0d1vsxvCqdbbeW0lBj8= X-Stat-Signature: k7aiobhtxoht7jj3kz8awtnpzdwb5k7j X-Rspamd-Queue-Id: 7F7861A002E X-HE-Tag-Orig: 1656277352-34782 X-Rspam-User: Authentication-Results: imf19.hostedemail.com; dkim=none; dmarc=none; spf=none (imf19.hostedemail.com: domain of joe@perches.com has no SPF policy when checking 216.40.44.15) smtp.mailfrom=joe@perches.com X-Rspamd-Server: rspam12 X-HE-Tag: 1656277358-936535 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: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: > > > >=20 > > > > 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 > > > I think that's a bad idea. > >=20 > > Somewhat sensible not sensible... > >=20 > > > Those things are *literally* called from panic situations, which may > > > be while holding core memory allocation locks, or similar. > >=20 > > True, and special_hex_number was used on alloc failure. > >=20 > > > 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". > >=20 > > OK, and that's true for all the temp stack buffers in every %p. >=20 > Serious question: why are you trying to half-ass just _one_ of these func= tions > 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.