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 72FC0C43334 for ; Mon, 20 Jun 2022 15:14:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E213E6B0071; Mon, 20 Jun 2022 11:14:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DD3AA6B0073; Mon, 20 Jun 2022 11:14:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C98C58E0001; Mon, 20 Jun 2022 11:14:00 -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 BAAFF6B0071 for ; Mon, 20 Jun 2022 11:14:00 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 8E40634BF6 for ; Mon, 20 Jun 2022 15:14:00 +0000 (UTC) X-FDA: 79598959440.06.980E926 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) by imf13.hostedemail.com (Postfix) with ESMTP id 9F85D200BA for ; Mon, 20 Jun 2022 15:13:59 +0000 (UTC) Received: by mail-qk1-f174.google.com with SMTP id d128so7997925qkg.8 for ; Mon, 20 Jun 2022 08:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ncDFNOnl+cCgd6dAuRe9aChIBV1dAVghpVpOuyZyjVU=; b=jiS48Fs848z08I+sel1Ax9ab2PeBI2TMzMUV4U6B4nvdTN6o01DkA+pcswlRLgyfxT f47uOz0SJzKGbY7H/YSZcSH5nS4/jfAB2YCnFnQ3EEBnVD6V4nWaYm7hXwi6kVJwcZPN zRmO9EVAX1ja45Mh8FWOTmCCCVd3/Woyoc+jlGP8uYbGDcYHcrD+wvw3Pcjr0uONoC2+ yZMEYGq79eXneDYySZxKh5eZJBILfPSmKIcVLfVM+TUhUUyHPYIm9NXorqFSx585u4DG 4PB30movJbM4S3j3yQubVwVFZH8nHvFQ2iVo/GNKLVlNBLVDkHaIVRfYTZ0YIuofYpmO aMTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ncDFNOnl+cCgd6dAuRe9aChIBV1dAVghpVpOuyZyjVU=; b=5buKdIKEvTXTzt5Cx7YyMR7zUi/2tHypAL910bLYVuNKdCS9KSuAVyHFere1686b1j vO8XGD7RHMstIPBEuvYyA/FhZxdGJJRFiPXl/l/MUEOiT334quo1QskZ6KRyC5C+DVao 7j5Jo3KN2USNS7Wl/ni3dbf0zF0ZSGJ9UyU4T6dgLntCLfzt6Jramy1emwsT7CLS1e5u k63fHWRgL4DFdj9zixyrqqCesoafAUC8S5fvKSd6LMbLhJFIzwmV8aWZcnFT1WRKFEFP Dv78L6XPUpXua4N5MrxPFK/0DpDA72D66tTOfFqZZcbgfOO4Cd3UUeeJ/fYhUNfABcQG RDKg== X-Gm-Message-State: AJIora+LoTGyaNTTYRaxB8Uoj/YCT2/xOvXWaGn8ReSWeAoLw9X92xAw 7zawrYU1fDOhncqjoKKZDkSmXbGCaC8BUlc= X-Google-Smtp-Source: AGRyM1szywDzgnhgTGpkuYD1vzFatQ2rmjw6UpkostX6GW84beAb66eFMNv+PS+oh9s4WjlmQUng0Q== X-Received: by 2002:a37:ef02:0:b0:6ac:470a:cf96 with SMTP id j2-20020a37ef02000000b006ac470acf96mr7029701qkk.763.1655738038675; Mon, 20 Jun 2022 08:13:58 -0700 (PDT) Received: from localhost (c-73-219-103-14.hsd1.vt.comcast.net. [73.219.103.14]) by smtp.gmail.com with ESMTPSA id g19-20020ac85813000000b00307aed25fc7sm10834097qtg.31.2022.06.20.08.13.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 08:13:57 -0700 (PDT) Date: Mon, 20 Jun 2022 11:13:56 -0400 From: Kent Overstreet To: Michal Hocko Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, pmladek@suse.com, rostedt@goodmis.org, enozhatsky@chromium.org, linux@rasmusvillemoes.dk, willy@infradead.org Subject: Re: [PATCH v4 24/34] mm/memcontrol.c: Convert to printbuf Message-ID: <20220620151356.gxmpv3wceg3kn4k2@moria.home.lan> References: <20220620004233.3805-1-kent.overstreet@gmail.com> <20220620004233.3805-25-kent.overstreet@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655738039; a=rsa-sha256; cv=none; b=M5emlAF0zV0lumhsew2QpI3R887YOcoAvw/MkQiKmkZ0Q6IuK9mGAyuXMg/Zx24bmpUA+l 7sgIFyRq2f0RTbyjb8xkzyFjYOx8yipVS+3FcSPzszq9vCVgRSlDzC/H7jOfoJA5qfuv1C HPJ2DxYfUb9vvX6sXoz+NMuAv/zJdqA= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=jiS48Fs8; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf13.hostedemail.com: domain of kent.overstreet@gmail.com designates 209.85.222.174 as permitted sender) smtp.mailfrom=kent.overstreet@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655738039; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ncDFNOnl+cCgd6dAuRe9aChIBV1dAVghpVpOuyZyjVU=; b=hOqXKyrVb8L0/ydyQ85fqA770FVYkGhBLVp287g1rKPgDWs3Lbtm47PURQGxVl7o4D+2qK eBzn1L9uT35kujV4YwNTz+VHxX8UdvfOiVw3bKOPL1/D07prpInQMbtJxzlXRjhoieOAYa XziLUIUW/95QrQQ7ve9q0oiWV7AdyOk= X-Rspamd-Queue-Id: 9F85D200BA X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=jiS48Fs8; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf13.hostedemail.com: domain of kent.overstreet@gmail.com designates 209.85.222.174 as permitted sender) smtp.mailfrom=kent.overstreet@gmail.com X-Rspamd-Server: rspam06 X-Stat-Signature: knybgcbxeqjzph4yxr8sdx7n46i69zqj X-HE-Tag: 1655738039-545457 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 Mon, Jun 20, 2022 at 01:37:56PM +0200, Michal Hocko wrote: > On Sun 19-06-22 20:42:23, Kent Overstreet wrote: > > This converts memory_stat_format() from seq_buf to printbuf. Printbuf is > > simalar to seq_buf except that it heap allocates the string buffer: > > here, we were already heap allocating the buffer with kmalloc() so the > > conversion is trivial. > > > > Signed-off-by: Kent Overstreet > > I have asked for a justification two times already not hearing anything. > Please drop this patch. I do not see any actual advantage of the > conversion. The primary downside of the existing code is that an > internal buffer is exposed to the caller which is error prone and ugly. > The conversion doesn't really address that part. Do you want to tone down the hostility? Yeesh. This patch is part of a wider series that deletes seq_buf, if you missed it here you go: https://lore.kernel.org/all/20220620004233.3805-1-kent.overstreet@gmail.com/ > Moreover there is an inconsistency between failrure case where the > printbuf is destroyed by a docummented way (printbuf_exit) and when the > caller frees the buffer directly. If printbuf_exit evers need to do more > than just kfree (e.g. kvfree) then this is a subtle bug hard to find. Ok, _that's_ a technical point we can talk about and address. I'll add documentation to the printbuf code that the buffer must be freeable with kfree().