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=-7.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,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 CD8D9C4320E for ; Thu, 2 Sep 2021 06:32:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD40160FE6 for ; Thu, 2 Sep 2021 06:32:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241232AbhIBGdK (ORCPT ); Thu, 2 Sep 2021 02:33:10 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:15237 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239001AbhIBGdI (ORCPT ); Thu, 2 Sep 2021 02:33:08 -0400 Received: from dggeme703-chm.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4H0WKL6jyKz1DFPt; Thu, 2 Sep 2021 14:31:18 +0800 (CST) Received: from [10.174.178.75] (10.174.178.75) by dggeme703-chm.china.huawei.com (10.1.199.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Thu, 2 Sep 2021 14:32:01 +0800 Subject: Re: [PATCH 2/6] mm/page_alloc.c: simplify the code by using macro K() To: David Laight , Oleksandr Natalenko CC: "vbabka@suse.cz" , "sfr@canb.auug.org.au" , "peterz@infradead.org" , "mgorman@techsingularity.net" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Andrew Morton References: <20210830141051.64090-1-linmiaohe@huawei.com> <9161665.bUqNH3lxUD@natalenko.name> <52bbb8f2-db63-8c56-ea49-d982c13ba541@huawei.com> <9426505.MgecbftzqH@natalenko.name> <03653d41-abe0-46f0-9eee-28cad9f5edea@huawei.com> From: Miaohe Lin Message-ID: Date: Thu, 2 Sep 2021 14:32:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.75] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggeme703-chm.china.huawei.com (10.1.199.99) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/9/2 5:25, David Laight wrote: > From: Miaohe Lin >> Sent: 01 September 2021 08:38 > ... >>>>> Shouldn't this macro go to some header file instead to get rid of define >>>>> repetitions? >>>> >>>> Many thanks for figuring this out. I think we should get rid of these >>>> repetitions too. But I'am not sure where this definition should be. Any >>>> suggestion? Thanks. >>> >>> I'm not sure what place suits best. At first I thought maybe linux/mm.h or >>> linux/mm_inline.h, but since PAGE_SHIFT is declared in asm-generic/page.h, >>> probably K(x) can also go there as well? >> >> K(x) is relevant with PAGE_SHIFT. So I think K(x) can also go asm-generic/page.h too. >> Am I supposed to do this when free or will you kindly do this? > > It is a bit of a short name to go in a public header file. > It seems K(x) is a bit of short and it needs a more self-annotated name. We can discuss this there: https://lkml.org/lkml/2021/9/1/334 Thanks. > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK > Registration No: 1397386 (Wales) >