Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5112193imm; Tue, 31 Jul 2018 05:50:54 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdT/JFNWvjxehEuq6uSxE2sBGOG9fjeZ0JYxs3PTlKtg/eBpLfLNAgnXpdD2imJDqB/InqT X-Received: by 2002:a17:902:22e:: with SMTP id 43-v6mr14588257plc.118.1533041454242; Tue, 31 Jul 2018 05:50:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533041454; cv=none; d=google.com; s=arc-20160816; b=N/8aRMwZhonepxzGhkOntSBKwKZPDpwdX+IqkF4HJw1QHStXDByX2TVssHSpKllUf6 xM/73inxwnedsVIAXC3lDluHiMQzTQMEQGkqPBtMjFj/cdlDTl7GAhi3s9qGTkWXscs7 3nD2iT2h3SOXyti0Hz7mwdJG5osdkukSY/uB3/Gc/b9HpRtN/hwNsoumm9tIoiv0h3yI adw/yxqCf6aO391r7+PWCws4FF8tDPNL/QbzQVjmjU8clbOiM/VKnIQT6ONvQoeCvsEf 4r0hPJ4th0NNfgDUpBL5jxe7sDQD/SoeabrSfc+TpPtRlUL61Mb1zhQgHM7tOG5I60oZ zKfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=2MXB3iVkA8QFA8HxEUSDNwnHF8DeFIVsXeAJGBk8AFs=; b=prfcxQC+ZkmKbZug6IetfH2AXcypJE60ERY5Ogx/unIqRlrjd46Lnt5AbAf2v/yay/ 2FWrBk+fJu4scrqdnWxbq/iI0lLUNiGb91nDahGN+CUDtzyOTA+o1eS2jfG3LHov09We Zw6/VxZoSjjV2TnI+Rgsaz6I6y4jZ+gs0uIcZeahd4Z4Ey3aQeMcBqzUOaa5ibo25MHS QKu887TuIDPbvmPPevqf2C2sFY1OEFWTBvPJpzJd3iEGxC71bjYfcsCd2nZEvXRT+BN2 JKcNqHyn89DxhHl5zYt+HvOmkVgtk1gNQePQkQDit8O8is7Dfxgc0BX22HKXtgytZoIT X/jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=pyCoRTUn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r22-v6si12461012pls.37.2018.07.31.05.50.39; Tue, 31 Jul 2018 05:50:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=pyCoRTUn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732237AbeGaOaC (ORCPT + 99 others); Tue, 31 Jul 2018 10:30:02 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:55818 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732084AbeGaOaC (ORCPT ); Tue, 31 Jul 2018 10:30:02 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6VC4LIs143099 for ; Tue, 31 Jul 2018 12:49:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : references : in-reply-to : from : date : message-id : subject : to : cc : content-type; s=corp-2018-07-02; bh=2MXB3iVkA8QFA8HxEUSDNwnHF8DeFIVsXeAJGBk8AFs=; b=pyCoRTUnEkfExszTViZg8nPZh/yeXhR/H/ui9hdg2qoxh4yASUC6OTjxklUFSoE/dbQw Ju4Yg1KQdjZ7M8MdyVuqJoJFcub1HtilnfPN03SNEKlmlFx0DPoj+Vu00elsiR/cTaFL UUSG/R0I4+AJrZ9e9c8kDGnLWD2NaNh9NOiTeiZJAQamgpe9/bRONjE+JCzar4i9mvLd Im8zOVGGoJm8TCMYdAtoTxYmpDUB2gbv7WLQU+BT0P76D/2/sx+YMvneqgbDl8OcCXMl ritRa5sUWUO+Yxm1PyCJcGMVJlB1r9ltyxdLUmIxGo7jS+r7qm/ZpXH0PkFl5mPkVVCL Vg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2kgfwt0udq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 31 Jul 2018 12:49:49 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w6VCnmqV031032 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 31 Jul 2018 12:49:49 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w6VCnm1g016095 for ; Tue, 31 Jul 2018 12:49:48 GMT Received: from mail-oi0-f50.google.com (/209.85.218.50) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 31 Jul 2018 05:49:48 -0700 Received: by mail-oi0-f50.google.com with SMTP id v8-v6so27655881oie.5 for ; Tue, 31 Jul 2018 05:49:48 -0700 (PDT) X-Gm-Message-State: AOUpUlGlCETGS/3Z4PoQC1H9lsz/Z/hCvT6gJs0QNRocOHVc16t9iBPc pqLkq3AhyVPSc0PyzaMLezVcexT32zGGVBgGjMs= X-Received: by 2002:aca:e089:: with SMTP id x131-v6mr20785817oig.221.1533041387799; Tue, 31 Jul 2018 05:49:47 -0700 (PDT) MIME-Version: 1.0 References: <20180731124504.27582-1-osalvador@techadventures.net> In-Reply-To: <20180731124504.27582-1-osalvador@techadventures.net> From: Pavel Tatashin Date: Tue, 31 Jul 2018 08:49:11 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm: make __paginginit based on CONFIG_MEMORY_HOTPLUG To: osalvador@techadventures.net Cc: Andrew Morton , Michal Hocko , Vlastimil Babka , kirill.shutemov@linux.intel.com, iamjoonsoo.kim@lge.com, Mel Gorman , Souptick Joarder , Linux Memory Management List , LKML , osalvador@suse.de Content-Type: text/plain; charset="UTF-8" X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8970 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807310129 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Oscar, Have you looked into replacing __paginginit via __meminit ? What is the reason to keep both? Thank you, Pavel On Tue, Jul 31, 2018 at 8:45 AM wrote: > > From: Oscar Salvador > > __pagininit macro is being used to mark functions for: > > a) Functions that we do not need to keep once the system is fully > initialized with regard to memory. > b) Functions that will be needed for the memory-hotplug code, > and because of that we need to keep them after initialization. > > Right now, the condition to choose between one or the other is based on > CONFIG_SPARSEMEM, but I think that this should be changed to be based > on CONFIG_MEMORY_HOTPLUG. > > The reason behind this is that it can very well be that we have CONFIG_SPARSEMEM > enabled, but not CONFIG_MEMORY_HOTPLUG, and thus, we will not need the > functions marked as __paginginit to stay around, since no > memory-hotplug code will call them. > > Although the amount of freed bytes is not that big, I think it will > become more clear what __paginginit is used for. > > Signed-off-by: Oscar Salvador > --- > mm/internal.h | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/mm/internal.h b/mm/internal.h > index 33c22754d282..c9170b4f7699 100644 > --- a/mm/internal.h > +++ b/mm/internal.h > @@ -392,10 +392,11 @@ static inline struct page *mem_map_next(struct page *iter, > /* > * FLATMEM and DISCONTIGMEM configurations use alloc_bootmem_node, > * so all functions starting at paging_init should be marked __init > - * in those cases. SPARSEMEM, however, allows for memory hotplug, > - * and alloc_bootmem_node is not used. > + * in those cases. > + * In case that MEMORY_HOTPLUG is enabled, we need to keep those > + * functions around since they can be called when hot-adding memory. > */ > -#ifdef CONFIG_SPARSEMEM > +#ifdef CONFIG_MEMORY_HOTPLUG > #define __paginginit __meminit > #else > #define __paginginit __init > -- > 2.13.6 >