Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3959243imu; Mon, 10 Dec 2018 10:33:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/UFPqbRkAITXbeLmBRtm7P1KV+/0q7wpXHp7LjwpSJl0yxnp/s19Y2liqtS1ojm5bXvZAOy X-Received: by 2002:a63:2784:: with SMTP id n126mr12046214pgn.48.1544466828414; Mon, 10 Dec 2018 10:33:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544466828; cv=none; d=google.com; s=arc-20160816; b=ElpunyOf9K/ANs1Jvau+K5W5MfH9XT7lYIEcwN+TzNthlyKmqpfhJh0HS1FXO3aFHG XNbGkFo8FIsD06oISHJ4si/Fj0AWzTVnlW9uD+L9BgWSpVtiJGqhxCorHiwOJJJwBBjV SZKDZ7P16jzXXkT1zQIgbZbpLmLjAo9nEgvt3ZDKHZPtUEqVhVyq7P/YDG0gtnLfxf6f nm7DvsFBXgBUMvClLydR645JHyy/6k634Wx84GXLVokkVpwX7DBhl9LlCIN/KKhpY/FL /N6DnJh1A68FRbXIWe455Q+1OBofXB1CmKpfxZLd9OYHhjh1f+UX47Jz9p9gBZw/CLjF ecbA== 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; bh=75hhkK6ooCsvAz6qLM/gZsWJhGhsPKVJtX87q27bL+k=; b=TT/Ux4I8cOa02C6i3+OcFmilehkOb+Y6hf7c2IJEB4/Uo8q5HXs992p6Jzq0cr6Ima IAjGEa98DHLcyzpA0SJlj9qhEq5bXdsOJrbj+x5GZwBb4HxsmhiJeE3Elwp4jwT6nsUp pvOQKb+tzyI8wbPNkx7ipJY4XqngKV0mnSQi6WRFOVPqoED6Etq2jjSgJsWVXiUfjgMq Z/5p0uQ6VNfuDrVmBz+MB44hp6f1PcR9FfI5SqExf8iYQKfGRTP535FwpKr1g++T7kU9 bluC2d50wQ29eDtMhplbdlL0qF4LPACmUtrmpVxT6oAe3H6wIsAVTpEp+azpMtGCfuyG d8vg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f18si10043102pgl.457.2018.12.10.10.33.33; Mon, 10 Dec 2018 10:33:48 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728500AbeLJSTa (ORCPT + 99 others); Mon, 10 Dec 2018 13:19:30 -0500 Received: from mx2.suse.de ([195.135.220.15]:37126 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726699AbeLJSTa (ORCPT ); Mon, 10 Dec 2018 13:19:30 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 719EFAD6B; Mon, 10 Dec 2018 18:19:28 +0000 (UTC) Date: Mon, 10 Dec 2018 19:19:26 +0100 From: Michal Hocko To: Zaslonko Mikhail Cc: Mikhail Zaslonko , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Pavel.Tatashin@microsoft.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, gerald.schaefer@de.ibm.com Subject: Re: [PATCH 1/1] mm, memory_hotplug: Initialize struct pages for the full memory section Message-ID: <20181210162410.GT1286@dhcp22.suse.cz> References: <20181210130712.30148-1-zaslonko@linux.ibm.com> <20181210130712.30148-2-zaslonko@linux.ibm.com> <20181210132451.GO1286@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 10-12-18 16:45:37, Zaslonko Mikhail wrote: > Hello, > > On 10.12.2018 14:24, Michal Hocko wrote: [...] > > Why do we need to restrict this to the highest zone? In other words, why > > cannot we do what I was suggesting earlier [1]. What does prevent other > > zones to have an incomplete section boundary? > > Well, as you were also suggesting earlier: 'If we do not have a zone which > spans the rest of the section'. I'm not sure how else we should verify that. I am not sure I follow here. Why cannot we simply drop end_pfn check and keep the rest? > Moreover, I was able to recreate the problem only with the highest zone > (memory end is not on the section boundary). What exactly prevents exactmap memmap to generate these unfinished zones? > > [1] http://lkml.kernel.org/r/20181105183533.GQ4361@dhcp22.suse.cz > > > >> Signed-off-by: Mikhail Zaslonko > >> Reviewed-by: Gerald Schaefer > >> Cc: > >> --- > >> mm/page_alloc.c | 15 +++++++++++++++ > >> 1 file changed, 15 insertions(+) > >> > >> diff --git a/mm/page_alloc.c b/mm/page_alloc.c > >> index 2ec9cc407216..41ef5508e5f1 100644 > >> --- a/mm/page_alloc.c > >> +++ b/mm/page_alloc.c > >> @@ -5542,6 +5542,21 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone, > >> cond_resched(); > >> } > >> } > >> +#ifdef CONFIG_SPARSEMEM > >> + /* > >> + * If there is no zone spanning the rest of the section > >> + * then we should at least initialize those pages. Otherwise we > >> + * could blow up on a poisoned page in some paths which depend > >> + * on full sections being initialized (e.g. memory hotplug). > >> + */ > >> + if (end_pfn == max_pfn) { > >> + while (end_pfn % PAGES_PER_SECTION) { > >> + __init_single_page(pfn_to_page(end_pfn), end_pfn, zone, > >> + nid); > >> + end_pfn++; > >> + } > >> + } > >> +#endif > >> } > >> > >> #ifdef CONFIG_ZONE_DEVICE > >> -- > >> 2.16.4 > > > > Thanks, > Mikhail Zaslonko -- Michal Hocko SUSE Labs