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.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 664BEC432C0 for ; Sat, 30 Nov 2019 23:22:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1848D20833 for ; Sat, 30 Nov 2019 23:22:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="bnwDuX5G" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1848D20833 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=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B24CB6B0006; Sat, 30 Nov 2019 18:22:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AD4F86B0007; Sat, 30 Nov 2019 18:22:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9C3D46B0008; Sat, 30 Nov 2019 18:22:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0074.hostedemail.com [216.40.44.74]) by kanga.kvack.org (Postfix) with ESMTP id 823A06B0006 for ; Sat, 30 Nov 2019 18:22:03 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 2B481181AEF09 for ; Sat, 30 Nov 2019 23:22:03 +0000 (UTC) X-FDA: 76214518926.26.fifth32_11da8d5c09451 X-HE-Tag: fifth32_11da8d5c09451 X-Filterd-Recvd-Size: 4959 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Sat, 30 Nov 2019 23:22:02 +0000 (UTC) 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 Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, x86@kernel.org, Catalin Marinas , Will Deacon , Tony Luck , Fenghua Yu , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Yoshinori Sato , Rich Felker , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Mark Rutland , Steve Capper , Mike Rapoport , Anshuman Khandual , Yu Zhao , Jun Yao , Robin Murphy , Michal Hocko , Oscar Salvador , "Matthew Wilcox (Oracle)" , Christophe Leroy , "Aneesh Kumar K.V" , Pavel Tatashin , Gerald Schaefer , Halil Pasic , Tom Lendacky , Greg Kroah-Hartman , Masahiro Yamada , Dan Williams , Wei Yang , Qian Cai , Jason Gunthorpe , Logan Gunthorpe , Ira Weiny 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-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.