From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753947AbdJaQpZ (ORCPT ); Tue, 31 Oct 2017 12:45:25 -0400 Received: from out0-225.mail.aliyun.com ([140.205.0.225]:36217 "EHLO out0-225.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751366AbdJaQpV (ORCPT ); Tue, 31 Oct 2017 12:45:21 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03296;MF=yang.s@alibaba-inc.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---.9Hr-EKI_1509468309; Subject: Re: [PATCH 1/2] mm: extract common code for calculating total memory size From: "Yang Shi" 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> <180e8cff-b0e9-bed7-2283-3a96d97fdf62@alibaba-inc.com> Message-ID: <038f781e-e96b-f122-2455-8a41d3a981a7@alibaba-inc.com> Date: Wed, 01 Nov 2017 00:45:03 +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: <180e8cff-b0e9-bed7-2283-3a96d97fdf62@alibaba-inc.com> 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 9:51 AM, Yang Shi wrote: > > > 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. I mean it is *not* on the hot path. Sorry for the typo and inconvenience. Yang > > Thanks, > Yang > >>