From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D744EC432C3 for ; Sat, 30 Nov 2019 23:24:00 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 489E62075A for ; Sat, 30 Nov 2019 23:24:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="bnwDuX5G" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 489E62075A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47QSB559hWzDqvD for ; Sun, 1 Dec 2019 10:23:57 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux-foundation.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=akpm@linux-foundation.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="bnwDuX5G"; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47QS7w3wJRzDqnn for ; Sun, 1 Dec 2019 10:22:04 +1100 (AEDT) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 15C812075A; Sat, 30 Nov 2019 23:22:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575156121; bh=DVWkysywk22qfCdc/ABNxthYUkugHNyzH42TFvSf8P8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bnwDuX5GZ8oJlAbwtAdxGvTEae6zLG5yYHGKjUGFz+FZ4mJRBF/NjsRgY7LL2Gm03 QGdDSlvOqd/ofXEhQWzv91IcxOdfXCQ4OtTyjqyL1HZmLA65yS5vR67RkTSLmVx7zI prx04uyTaFWoR6lQTXrpdRVYi8X8ZDiSA3b8915Q= Date: Sat, 30 Nov 2019 15:21:59 -0800 From: Andrew Morton To: David Hildenbrand Subject: Re: [PATCH v6 05/10] mm/memory_hotplug: Shrink zones when offlining memory Message-Id: <20191130152159.258fa331542fc693e24723eb@linux-foundation.org> In-Reply-To: References: <20191006085646.5768-1-david@redhat.com> <20191006085646.5768-6-david@redhat.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Rich Felker , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Peter Zijlstra , Catalin Marinas , Dave Hansen , Heiko Carstens , Wei Yang , linux-mm@kvack.org, Michal Hocko , Paul Mackerras , "H. Peter Anvin" , Will Deacon , Dan Williams , linux-s390@vger.kernel.org, Yu Zhao , Yoshinori Sato , Halil Pasic , Jason Gunthorpe , x86@kernel.org, "Matthew Wilcox \(Oracle\)" , Mike Rapoport , Jun Yao , Christian Borntraeger , Ingo Molnar , Gerald Schaefer , Ira Weiny , Fenghua Yu , Pavel Tatashin , Vasily Gorbik , Anshuman Khandual , Masahiro Yamada , Greg Kroah-Hartman , Borislav Petkov , Andy Lutomirski , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Oscar Salvador , Tony Luck , Steve Capper , Robin Murphy , linux-kernel@vger.kernel.org, Logan Gunthorpe , "Aneesh Kumar K.V" , Qian Cai , Tom Lendacky , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Sun, 27 Oct 2019 23:45:52 +0100 David Hildenbrand wrote: > I think I just found an issue with try_offline_node(). > try_offline_node() is pretty much broken already (touches garbage > memmaps and will not considers mixed NIDs within sections), however, > relies on the node span to look for memory sections to probe. So it > seems to rely on the nodes getting shrunk when removing memory, not when > offlining. > > As we shrink the node span when offlining now and not when removing, > this can go wrong once we offline the last memory block of the node and > offline the last CPU. We could still have memory around that we could > re-online, however, the node would already be offline. Unlikely, but > possible. > > Note that the same is also broken without this patch in case memory is > never onlined. The "pfn_to_nid(pfn) != nid" can easily succeed on the > garbage memmap, resulting in no memory being detected as belonging to > the node. Also, resize_pgdat_range() is called when onlining memory, not > when adding it. :/ Oh this is so broken :) > > The right fix is probably to walk over all memory blocks that could > exist and test if they belong to the nid (if offline, check the > block->nid, if online check all pageblocks). A fix we can then move in > front of this patch. > > Will look into this this week. And this series shows almost no sign of having been reviewed. I'll hold it over for 5.6.