Received: by 10.223.176.5 with SMTP id f5csp246548wra; Tue, 30 Jan 2018 10:50:03 -0800 (PST) X-Google-Smtp-Source: AH8x224EjwC++l8uf9eGxM6TSJYe0w6ifj5NscwYhXCsJY1qQLZWdpYNDxGlXAcinpBUKwzitwGd X-Received: by 10.98.147.154 with SMTP id r26mr30980272pfk.207.1517338203817; Tue, 30 Jan 2018 10:50:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517338203; cv=none; d=google.com; s=arc-20160816; b=1IzC7zxpsJRzeY9nUOwRQlk8/wsle2ymrVuckaWCfoTTXZGWOSu3Tp/MldP7BRUtAN BIMcYhU4ybPyhrtX2YleoVKEkpoHaVhBq89d+dJvsfR/IZzriDN0avNZkY/ljSNM9rMj QHoxpQexyLjsHKtQbbc0K1vjWqJUmLjBVhDG/iNrkAAmKiqgFI5jG280aAO0L6bRQ5Jk XJYZYJs6uD3WRhfClHQubhupJXhcT40S6qh7w+FHbq7swiQzRH3FBcZKpIwogpX3zsWC modeeeXr5hRkCnlMFK30aOa68Iuv/ZsLVM/AMd1udlR6Hlift9S2TRc3KTGaTD6ql+l3 K1sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Wm1VfwUaAw+VpkYwzJ0Kdlrbnn2ye9STf29uKqgju4o=; b=KOhU2+99PrF8nSg+zT5hECpLAm24I9CcaAKhW8ClXIxTPKmLtOermbA7blcg4pH8Tp 7cCPKIGPA5ivZBq9sahFwu+V6nAviSvFfgE9EMEYWmRRUE2FDfUXFKbmz3WFUOCv76SC RFxD0QIIRhgUExHS3CAV/YHXjPwbu4fx9zlVllHAzBWAPo18THfCjHQmjq6g+rJBFVMt 8dx0e4y297dIsnfSv57vKTen+4NLnR7GOi/I8I9sz7+k7b022cIBJhEfCrzcbjjZ0+Tx 4SGexgewYxmayVyJARZu/82geVLOzZvcppa3Jg5WcAnLp8/hFeDkkcerVcoBuiK6e3fz 61Tg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p14-v6si4008897plo.420.2018.01.30.10.49.49; Tue, 30 Jan 2018 10:50:03 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752869AbeA3S3u (ORCPT + 99 others); Tue, 30 Jan 2018 13:29:50 -0500 Received: from mx2.suse.de ([195.135.220.15]:43089 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752023AbeA3S3t (ORCPT ); Tue, 30 Jan 2018 13:29:49 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 7DC1AAECE; Tue, 30 Jan 2018 18:29:48 +0000 (UTC) Date: Tue, 30 Jan 2018 19:29:47 +0100 From: Michal Hocko To: Pavel Tatashin Cc: Bharata B Rao , Linux Kernel Mailing List , Linux Memory Management List , Andrew Morton Subject: Re: Memory hotplug not increasing the total RAM Message-ID: <20180130182947.GK21609@dhcp22.suse.cz> References: <20180130083006.GB1245@in.ibm.com> <20180130091600.GA26445@dhcp22.suse.cz> <20180130092815.GR21609@dhcp22.suse.cz> <20180130095345.GC1245@in.ibm.com> <20180130101141.GW21609@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 30-01-18 13:11:06, Pavel Tatashin wrote: > Hi Michal, > > Thank you for taking care of the problem. The patch may introduce a > small performance regression during normal boot, as we add a branch > into a hot initialization path. But, it fixes a current problem, so: > > Reviewed-by: Pavel Tatashin Thanks! > However, I think we should change the hotplug code to also not to > touch the map area until struct pages are initialized. > > Currently, we loop through "struct page"s several times during memory hotplug: > > 1. memset(0) in sparse_add_one_section() > 2. loop in __add_section() to set do: set_page_node(page, nid); and > SetPageReserved(page); > 3. loop in pages_correctly_reserved() to check that SetPageReserved is set. > 4. loop in memmap_init_zone() to call __init_single_pfn() You might be very well correct but the hotplug code is quite subtle and we do depend on PageReserved at some unexpected places so it is not that easy I am afraid. My TODO list in the hotplug is quite long. If you feel like you want to work on that I would be more than happy. -- Michal Hocko SUSE Labs