Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp232004pxb; Thu, 2 Sep 2021 02:58:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcjQtasQDOYftfi8JnbkUBv+fZ1FHQwSPAFvmyCs+9iXnbxTozrSGeM30UU17XiHyIKvqg X-Received: by 2002:a5d:91d2:: with SMTP id k18mr2124720ior.20.1630576684638; Thu, 02 Sep 2021 02:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630576684; cv=none; d=google.com; s=arc-20160816; b=sZxZfq5MDW+fuZJfbNnR8hyuXYX8SqCDY4EiOAWAjgwKzemjHaOYe2C+JMYQYJqUkf /gzCsiwCB6S+Ajr5bQrs8VrLdqPE1Zn0VB/5wNFQD2Vxq4tT/Pw6KSpdGmio6XOLz1IF d6yZjvzKtAKbepyuJ2n5r3YXNmGlvdoCxJkpCxkNWATDhZqI8qjp/aBLrH8Fwoq4qQ/S H3xLkJIgDa82vqkbdlDTcUR60hfBIyjpRgAY8Plgf/+OVCU9QBn+aOEQpzyaR8f/c7IJ kt4zCK0IqoAX6WhrZ4kL9DStwv6dV8Ihe9xQa6svkQB9hTT/iTo5WEUiiWNA9yzsWKzX vadA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=ZF8Hdobih66/eOpuI6oD1bY3zSBDlMyyFThRpp8fwog=; b=aZI9sQIvkgYNgUnYerPrZfVzWgE8SKR9+WdggKFIuoCUwqkq+LNZYNScDqYBGblHOZ N6QRodrcei1TeeGq8bIN9iLHH5UiXfnsT6i5ozxwhDLdi7cgzeI7EsExsbLgj4qnC2Li pjTwTtqqSWfpVxxht1m1RAn2GI7x/NDFZ9rx248y4e7E6k1L2MKVYn0Cj+j/+UIfbBcI 8qBxEFeciHhfEbRhMHpgo7dvDbWeue5QhCRFfOxVdcYC7dO4e5BIW/nK9ZWSd9Occk2x 7DZkgHsmeEua+3hvHUU427XnK094HHXpklS+0czT8QN5tAuzeJWsE0ooAGguUqwahBD1 TL+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e15si1534975ilu.153.2021.09.02.02.57.47; Thu, 02 Sep 2021 02:58:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240533AbhIBGdJ (ORCPT + 99 others); Thu, 2 Sep 2021 02:33:09 -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) >