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 X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 9D36CC433E7 for ; Sat, 10 Oct 2020 02:14:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62E832225D for ; Sat, 10 Oct 2020 02:14:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730137AbgJJCN6 convert rfc822-to-8bit (ORCPT ); Fri, 9 Oct 2020 22:13:58 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:3627 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729749AbgJJB65 (ORCPT ); Fri, 9 Oct 2020 21:58:57 -0400 Received: from dggeme752-chm.china.huawei.com (unknown [172.30.72.53]) by Forcepoint Email with ESMTP id DE0C23B8B24E2CB482DA; Sat, 10 Oct 2020 09:58:23 +0800 (CST) Received: from dggeme753-chm.china.huawei.com (10.3.19.99) by dggeme752-chm.china.huawei.com (10.3.19.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1913.5; Sat, 10 Oct 2020 09:58:23 +0800 Received: from dggeme753-chm.china.huawei.com ([10.7.64.70]) by dggeme753-chm.china.huawei.com ([10.7.64.70]) with mapi id 15.01.1913.007; Sat, 10 Oct 2020 09:58:23 +0800 From: linmiaohe To: Michal Hocko CC: "akpm@linux-foundation.org" , "hannes@cmpxchg.org" , "vdavydov.dev@gmail.com" , "cgroups@vger.kernel.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] mm: memcontrol: eliminate redundant check in __mem_cgroup_insert_exceeded() Thread-Topic: [PATCH] mm: memcontrol: eliminate redundant check in __mem_cgroup_insert_exceeded() Thread-Index: AdaeqIsdp2waPEHTskKLt/T+m78yvw== Date: Sat, 10 Oct 2020 01:58:23 +0000 Message-ID: <176a5eb5a80d40fdb3fe6e4f460fee08@huawei.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.174.177.16] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Michal Hocko wrote: > On Fri 09-10-20 09:51:04, Miaohe Lin wrote: >> The mz->usage_in_excess >= mz_node->usage_in_excess check is exactly >> the else case of mz->usage_in_excess < mz_node->usage_in_excess. So we >> could replace else if (mz->usage_in_excess >= >> mz_node->usage_in_excess) with else equally. >> >> Signed-off-by: Miaohe Lin > >Acked-by: Michal Hocko > >I believe this is a result of a very unreadable code. Resp. the comment makes it hard to follow. It would be slightly better to simply drop the comment which doesn't really explain much IMHO. > Agree. Will do it in v2. Many thanks.