From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932363AbdJ0QwQ (ORCPT ); Fri, 27 Oct 2017 12:52:16 -0400 Received: from out0-241.mail.aliyun.com ([140.205.0.241]:35875 "EHLO out0-241.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751345AbdJ0QwM (ORCPT ); Fri, 27 Oct 2017 12:52:12 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03291;MF=yang.s@alibaba-inc.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---.9FUf9-y_1509123091; Subject: Re: [PATCH 1/2] mm: extract common code for calculating total memory size To: Christopher Lameter Cc: penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, mhocko@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1508971740-118317-1-git-send-email-yang.s@alibaba-inc.com> <1508971740-118317-2-git-send-email-yang.s@alibaba-inc.com> From: "Yang Shi" Message-ID: <180e8cff-b0e9-bed7-2283-3a96d97fdf62@alibaba-inc.com> Date: Sat, 28 Oct 2017 00:51:26 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/27/17 3:00 AM, Christopher Lameter wrote: > On Thu, 26 Oct 2017, Yang Shi wrote: > >> diff --git a/include/linux/mm.h b/include/linux/mm.h >> index 935c4d4..e21b81e 100644 >> --- a/include/linux/mm.h >> +++ b/include/linux/mm.h >> @@ -2050,6 +2050,31 @@ extern int __meminit __early_pfn_to_nid(unsigned long pfn, >> static inline void zero_resv_unavail(void) {} >> #endif >> >> +static inline void calc_mem_size(unsigned long *total, unsigned long *reserved, >> + unsigned long *highmem) >> +{ > > Huge incline function. This needs to go into mm/page_alloc.c or > mm/slab_common.c It is used by lib/show_mem.c too. But since it is definitely on a hot patch, I think I can change it to non inline. Thanks, Yang >