Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3005461iog; Mon, 20 Jun 2022 09:10:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uyPWZpPbG+e+gPiR8mulzbsDcT5nXcSsvQEpDUIdFNvi+Tt92L91ks3lmBCmGpcXL/4O9a X-Received: by 2002:a17:907:7241:b0:711:d911:2691 with SMTP id ds1-20020a170907724100b00711d9112691mr21346791ejc.626.1655741445045; Mon, 20 Jun 2022 09:10:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655741445; cv=none; d=google.com; s=arc-20160816; b=SI06zluZvwlYRAGvnaUr1mYYGojKQC1d3HHCFYBheRH6meYl4aTVlgT8uPOoI8Ptib XE27v0Grp2RpGtn2BUYY3fYp13egtXr75dRs6eGmVntYnFDMA7ZKLXeLKbrSflpIWwuy YcOv88/vTpqcnUD+cpVgL0VQlMogwhCHF1rAEbEt9IUBB0sgLJQw0aRjWOpwq5XjC10l y6wLusdAcCAk0eDMzf19nTp4Cqhkmsq6lf2Z/oilTajqUybvJcNRbFgmsWpjuBtbSVDb 0+iwaPAh4HiJijkkDSt7sGhGNKz+JCqTN9lPranV9n8vWp/OugdmibcO1bKRiopXSd8Q g2Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=sFrNkLmQVBsGTGEriUNS1o9LyiWXjD8lzDz4B1bsy88=; b=CpYSEEh4OWNlAo8HPiMfueazO6I8JZntKJXvdOa/SPahU4uFsg9KQvp4/r5fm9l4pZ 4SZEUwV5hNnqR51o1GquaRl1X+/NrrsoKZpPuwFsnVPwdbDgdcwhIyXVvBAJbJghlhP8 mrbqhHlFbdkVPi7afRJoBbIEBqNAAPLBtYjOdYKDErR733rxZcQu/envgO4av89MBm1U DXUxCcuj6IaTMaVk4OIxs0XY+e7LzKdc7xny4Ph0h1LzVaU4plHtYYewgab0ZSUZIUBV zbkn0BPWCVEuqY76KhY83FLyMX8zy9+8gBTqp+MOBsskjCkUUBW1dG+pHKE0yaGVWMgL 7BJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="YFpq/JaH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x7-20020a056402414700b004357f8bc462si4000465eda.272.2022.06.20.09.10.18; Mon, 20 Jun 2022 09:10:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="YFpq/JaH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240115AbiFTPwa (ORCPT + 99 others); Mon, 20 Jun 2022 11:52:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235564AbiFTPw2 (ORCPT ); Mon, 20 Jun 2022 11:52:28 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3A3B1C92D for ; Mon, 20 Jun 2022 08:52:26 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 62C9E21B2F; Mon, 20 Jun 2022 15:52:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1655740345; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sFrNkLmQVBsGTGEriUNS1o9LyiWXjD8lzDz4B1bsy88=; b=YFpq/JaHRz/KiQ66fsfPnEdadgkqCr/nFcyYc/rUA+kGODkLqt6kbfJJyNVH7oSzBM+H7O 9guLocjbacZqamk8a+W9u/zk8KEJ2nrLCp7QD9kJpss9+JZ2dx8hptcI9AvXByZGExX9Qc 0eRhzDwoWAvvyCpI7Cb0tTPWihXh344= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id EFBEB2C141; Mon, 20 Jun 2022 15:52:24 +0000 (UTC) Date: Mon, 20 Jun 2022 17:52:24 +0200 From: Michal Hocko To: Kent Overstreet 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: References: <20220620004233.3805-1-kent.overstreet@gmail.com> <20220620004233.3805-25-kent.overstreet@gmail.com> <20220620151356.gxmpv3wceg3kn4k2@moria.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220620151356.gxmpv3wceg3kn4k2@moria.home.lan> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 20-06-22 11:13:56, Kent Overstreet wrote: > 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. I have merely pointed out you have ignored my review feedback _twice_ already. Ignoring the review feedback and posting new versions without questions being addressed is wasting other people's time. > 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/ Each patch should have its justification. If the reasoning is that seq_buf is going away then I can live with that. That is not obvious from this patch which I care about because it falls into area I maintain and review. Unlike the rest of the large patchset which I do not really have time to review in its entirety. > > 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(). Hmm, wouldn't that be just too restrictive without any good reasons? Maybe there are no seq_buf users currently but if there ever raises a need for larger buffers then you might want to use kvmalloc for the allocation and you will need to change all users to use kvfree (potentially missing some). You could either start requiring kvfree since the beginning or get rid of exposing internal buffer altogether and use printbuf_exit in all cases. -- Michal Hocko SUSE Labs