Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1352C2B9F4 for ; Fri, 18 Jun 2021 02:33:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B4AAA6135C for ; Fri, 18 Jun 2021 02:33:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233648AbhFRCgF (ORCPT ); Thu, 17 Jun 2021 22:36:05 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:5033 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231289AbhFRCgE (ORCPT ); Thu, 17 Jun 2021 22:36:04 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4G5jXg4gFYzXh5P; Fri, 18 Jun 2021 10:28:51 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 18 Jun 2021 10:33:55 +0800 Received: from [127.0.0.1] (10.174.179.0) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 18 Jun 2021 10:33:54 +0800 Subject: Re: [PATCH 1/1] btrfs: tests: remove unnecessary oom message To: , Chris Mason , Josef Bacik , David Sterba , linux-btrfs References: <20210617083053.1064-1-thunder.leizhen@huawei.com> <20210617203518.GZ28158@twin.jikos.cz> From: "Leizhen (ThunderTown)" Message-ID: <5f6198a7-3d3a-603e-73fe-b56c0b71fbf9@huawei.com> Date: Fri, 18 Jun 2021 10:33:53 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20210617203518.GZ28158@twin.jikos.cz> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.0] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On 2021/6/18 4:35, David Sterba wrote: > On Thu, Jun 17, 2021 at 04:30:53PM +0800, Zhen Lei wrote: >> Fixes scripts/checkpatch.pl warning: >> WARNING: Possible unnecessary 'out of memory' message >> >> Remove it can help us save a bit of memory. > > Well, we have a few more messages in tests regarding failed memory > allocations. Though I've never seen one in practice, I think it's not > a big deal to have that one here as well. The failures in the testsuite > are intentionally verbose and saving a few bytes in optional development > feature hardly bothers anyone. The calltrace of the OOM message contains all the information printed by test_err() here. I don't think anyone wants to see a bunch of unhelpful tips when locating an OOM problem. > > Where bytes can be saved are error messages for the same type of error, It also saves a dozen bytes of binary code. > that I've implemented in the past, see file fs/btrfs/tests/btrfs-tests.c > array test_error that maps enums to strings. As mentioned above, I don't think these "no memory" strings are necessary, unless the rest of the test can continue to run healthy. Otherwise, no one trusts the test results in the OOM situation. They're going to locate the OOM problem first, and these information are pointless. > > . >