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 2EEBEC432BE for ; Thu, 2 Sep 2021 06:32:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A89BA60FE6 for ; Thu, 2 Sep 2021 06:32:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A89BA60FE6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 20AB78D0002; Thu, 2 Sep 2021 02:32:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 192678D0001; Thu, 2 Sep 2021 02:32:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 082718D0002; Thu, 2 Sep 2021 02:32:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0048.hostedemail.com [216.40.44.48]) by kanga.kvack.org (Postfix) with ESMTP id EECFC8D0001 for ; Thu, 2 Sep 2021 02:32:11 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 9DDBA8249980 for ; Thu, 2 Sep 2021 06:32:11 +0000 (UTC) X-FDA: 78541663662.01.56C3026 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf05.hostedemail.com (Postfix) with ESMTP id 09EA85040AAB for ; Thu, 2 Sep 2021 06:32:10 +0000 (UTC) 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 Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=huawei.com; spf=pass (imf05.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Stat-Signature: 7n18dg3mjfmf66qr48wagts797ws9fgk X-Rspamd-Queue-Id: 09EA85040AAB X-Rspamd-Server: rspam04 X-HE-Tag: 1630564330-328724 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000054, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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) >