[{"id":3688325,"web_url":"http://patchwork.ozlabs.org/comment/3688325/","msgid":"<6635ed59-23b9-4ad6-bca4-f2a8e1e3e400@163.com>","list_archive_url":null,"date":"2026-05-08T10:31:33","subject":"Re: [PATCH v4 v4 0/3] ext4: improve mballoc statistics reporting and\n control","submitter":{"id":89479,"url":"http://patchwork.ozlabs.org/api/people/89479/","name":"liubaolin","email":"liubaolin12138@163.com"},"content":"Dear Ted, Baokun,\n\n    I have revised the patch according to your previous comments.\n    There are three additional points I would like to clarify:\n\t1.Ted, you previously suggested considering concurrency issues.\n\t  After thinking about it, I decided to use an atomic variable for \ns_mb_stats to address the concurrency problem.\n\t  Using a spinlock would require much larger code changes.\n\t\n\t2.Regarding the modification to Documentation/filesystems/proc.rst, I \npreviously sent an email to Jonathan, the maintainer of proc.rst:\n\t  https://lore.kernel.org/all/87ik9bmphp.fsf@trenco.lwn.net/\n\t  Jonathan replied and agreed with my idea that it is sufficient to \nsimply add the following note in proc.rst:\n\t  “See Documentation/admin-guide/ext4.rst for ext4-specific /proc entries.”\n\t  If you also agree, Ted, then in the future we will no longer \nduplicate ext4 proc file documentation in proc.rst.\n\t  All ext4 proc file related documentation will instead be maintained \ncentrally in Documentation/admin-guide/ext4.rst.\n\n\t3.The functionality of the sys mb_stats file will be retained,\n\t  but the following note will be added to \nDocumentation/ABI/testing/sysfs-fs-ext4:\n\t  “This sysfs entry is deprecated, and users should prefer \n/proc/fs/ext4//mb_stats.”\n\n    Thank you for your comments and reviews.\n\nThanks,\nBaolin\n\n在 2026/5/8 17:34, Baolin Liu 写道:\n> This series improves ext4 mballoc statistics reporting and control.\n> Compared with v3, this version adds a new patch to convert s_mb_stats\n> to atomic_t and use atomic operations for its accesses, so as to avoid\n> potential concurrent accesses to this variable.\n> \n> Patch 3 is updated according to comments from Ted and BaoKun. Writing 0\n> to /proc/fs/ext4/<dev>/mb_stats disables statistics collection, writing\n> 1 enables it, and writing -1 clears the current statistics and enables\n> collection. The related documentation is updated accordingly, and the\n> sysfs mb_stats entry is documented as deprecated in favor of the proc\n> mb_stats entry.\n> \n> Changes since v3:\n>    - add a new patch to convert s_mb_stats to atomic_t and use atomic\n>      operations for its accesses\n>    - update /proc/fs/ext4/<dev>/mb_stats write semantics based on comments\n>      from Ted and BaoKun\n>    - update related documentation and document sysfs mb_stats as deprecated\n> \n> Baolin Liu (3):\n>    ext4: add blocks_allocated to mb_stats output\n>    ext4: use atomic operations for s_mb_stats accesses\n>    ext4: allow controlling mballoc stats through proc mb_stats\n> \n>   Documentation/ABI/testing/sysfs-fs-ext4 |  3 +-\n>   Documentation/admin-guide/ext4.rst      |  9 +++-\n>   Documentation/filesystems/proc.rst      | 13 +-----\n>   fs/ext4/ext4.h                          |  3 +-\n>   fs/ext4/mballoc.c                       | 57 +++++++++++++++++++------\n>   fs/ext4/sysfs.c                         | 55 ++++++++++++++++++++++--\n>   6 files changed, 109 insertions(+), 31 deletions(-)\n>","headers":{"Return-Path":"\n <SRS0=mLN0=DF=vger.kernel.org=linux-ext4+bounces-16362-patchwork-incoming=ozlabs.org@ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-ext4@vger.kernel.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","patchwork-incoming@ozlabs.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256\n header.s=s110527 header.b=pTOiLM8y;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org;\n envelope-from=srs0=mln0=df=vger.kernel.org=linux-ext4+bounces-16362-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)","gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c0a:e001:db::12fc:5321\"\n arc.chain=subspace.kernel.org","gandalf.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=163.com","gandalf.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256\n header.s=s110527 header.b=pTOiLM8y;\n\tdkim-atps=neutral","gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16362-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=163.com header.i=@163.com\n header.b=\"pTOiLM8y\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=117.135.210.2","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=163.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=163.com"],"Received":["from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1 raw public key)\n server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4gBlmk4f0Kz1yJq\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 20:32:22 +1000 (AEST)","from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4gBlmc5vQHz4wCW\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 20:32:16 +1000 (AEST)","by gandalf.ozlabs.org (Postfix)\n\tid 4gBlmc5XRvz4wKJ; Fri, 08 May 2026 20:32:16 +1000 (AEST)","from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4gBlmW43rrz4wCW\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 08 May 2026 20:32:11 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 90F47301CA56\n\tfor <patchwork-incoming@ozlabs.org>; Fri,  8 May 2026 10:32:08 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 6E2382FFDE1;\n\tFri,  8 May 2026 10:32:07 +0000 (UTC)","from m16.mail.163.com (m16.mail.163.com [117.135.210.2])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 238241419A4;\n\tFri,  8 May 2026 10:32:02 +0000 (UTC)","from [192.168.100.68] (unknown [])\n\tby gzga-smtp-mtada-g0-4 (Coremail) with SMTP id\n _____wAnFxeFu_1p55fGAA--.10394S2;\n\tFri, 08 May 2026 18:31:36 +0800 (CST)"],"ARC-Seal":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1778236336; cv=pass;\n\tb=kljsVL4adfCKMgrpBlY4s9EMkm4wBwjsExVEiuNBGoD2uVwuUa/JmhHVdxTm1rPTzxznulurRWyCf/ZlTNvzZAPLd7dauk2afeORjcXg7JjFsZpSSjtlLAwqEeBHdtotvCYMqau3F9PKzh8FvDZi1JlgyS/bGbV5s2xu6pGsiqEpqYUmwSIilREUrkKOBZnvNkp8ttm3ZCkbvYI7Ykw0diIUmG6prJRrmQ0gH2Pm0NSR7m7FcJdp8pQAsxqz20Yb3oRzdPcDtqj83gUEm58aU28WuYzT9bq4rDqVkIu1NWnWpQzoKkahURTvQuS+qQYtYPm512QjTgqpT4ogS5ti8Q==","i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778236327; cv=none;\n b=l40lkETNLWrvYtgj2Qgp7hnjydrgjyXIQmKUpgPdTHgI88Tc8HZSK9WF0/tX3lPc1S330YjZkSgtPKNfOPWuUkiaSCdis8g57COBHwluxkWLohq5GWiQS+kHX0xAcKH1jsgi2fNr1ktcEp0Kiwgtz9ulPRNVmO8/4Th2IFgwQ3I="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1778236336; c=relaxed/relaxed;\n\tbh=c/LvKofPEEUyGe/xHnJLuo4WNzmKyS8YODk1wqBNkP0=;\n\th=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:\n\t In-Reply-To:Content-Type;\n b=Sh9YvrkMappYipDXnqvplp6e26WugOlb6xogMu5iCH5bpt53/vqk2Ft6Ur4/L1I3rTLrurQbjCJBCc+Iwoqrkm6oxaYTFzIIN/srXBxlsbQwCCjm0i2MMUFUKjf7Jd//THdyJhsZfz0J8py809H5LGe6kf/tLcZgjhGfWsA8SAcPex18z+bvw/B/+5QetP/OZqV6v6NupCNBgk5GDkRTOBoTtKAkqJwaRBQVzOzo6J4vWI2cIe6JaUU6JfBmO/KZ4ba15mI3tFbqZGcL25tQ1tESUIXbwZYyZAyhunYkTXtMTnva8FTou7lJQ9RjxBrQSHVpNbo3HlV1nyk0YMAdPA==","i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778236327; c=relaxed/simple;\n\tbh=Z/wNQ7oe54AgygQug1Y8kyZ56XgSIdSYCDbpQSh16xE=;\n\th=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:\n\t In-Reply-To:Content-Type;\n b=N6JKCxn2Art5qUWo0f8USXn34hTAtTX77qmV11OKgp3ex41U5FqCY5BmNnZ0U13Nb7lVsE84ks7bpyKg63MA/1gudYBeKdFAOiUvgWWVrzVm5ySEzsCFs3Z6HSq90ids/4+SiV9IStvjj8CAjLclSP1hbSnsAQohkf/hfcP1f2A="],"ARC-Authentication-Results":["i=2; gandalf.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=163.com; dkim=pass (1024-bit key;\n unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256\n header.s=s110527 header.b=pTOiLM8y; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16362-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org","i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=163.com;\n spf=pass smtp.mailfrom=163.com;\n dkim=pass (1024-bit key) header.d=163.com header.i=@163.com\n header.b=pTOiLM8y; arc=none smtp.client-ip=117.135.210.2"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com;\n\ts=s110527; h=Message-ID:Date:MIME-Version:Subject:To:From:\n\tContent-Type; bh=c/LvKofPEEUyGe/xHnJLuo4WNzmKyS8YODk1wqBNkP0=;\n\tb=pTOiLM8yX6ygK/sAp5wN8T4CBDPuPhfky/zJfqQQCCSDFHZCcwR6tNOjlLGDGU\n\tK1GZ1qO1TVu54P89htNGj164DmSmTmg5hR86fUMsJbgiJHdaUsiPz4XCX+NLTpPg\n\t9zTTnRnb2A2cvDd8+SpYdYaQBplImdwa7Du1o/7Wn/4+g=","Message-ID":"<6635ed59-23b9-4ad6-bca4-f2a8e1e3e400@163.com>","Date":"Fri, 8 May 2026 18:31:33 +0800","Precedence":"bulk","X-Mailing-List":"linux-ext4@vger.kernel.org","List-Id":"<linux-ext4.vger.kernel.org>","List-Subscribe":"<mailto:linux-ext4+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-ext4+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v4 v4 0/3] ext4: improve mballoc statistics reporting and\n control","To":"tytso@mit.edu, libaokun@linux.alibaba.com","Cc":"ojaswin@linux.ibm.com, ritesh.list@gmail.com, yi.zhang@huawei.com,\n linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,\n wangguanyu@vivo.com, adilger@dilger.ca","References":"<20260508093428.5814-1-liubaolin12138@163.com>","From":"liubaolin <liubaolin12138@163.com>","In-Reply-To":"<20260508093428.5814-1-liubaolin12138@163.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","X-CM-TRANSID":"_____wAnFxeFu_1p55fGAA--.10394S2","X-Coremail-Antispam":"1Uf129KBjvJXoWxWFWfuFy3WFyrCryrGrWDCFg_yoW5WF4xpF\n\tWFqwsIqa1DW3W7GwnrCF4xW343Xa4fCw4UGFnFg348uF98tr9ayF4ftay5ZF9rJrW8ZFWU\n\tXF42kr95CFW2y37anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2\n\t9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UOF4iUUUUU=","X-CM-SenderInfo":"xolxutxrol0iasrtmqqrwthudrp/xtbC6gjqtWn9u4g-zQAA3o","X-Spam-Status":"No, score=-1.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,\n\tFREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,\n\tMAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=disabled\n\tversion=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"}}]