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=-8.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 E0814C49EAD for ; Tue, 5 Nov 2019 09:32:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7BB7421D7F for ; Tue, 5 Nov 2019 09:32:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Q4aEcDNT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BB7421D7F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 13E506B0006; Tue, 5 Nov 2019 04:32:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F03F6B0008; Tue, 5 Nov 2019 04:32:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F22586B000A; Tue, 5 Nov 2019 04:32:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0140.hostedemail.com [216.40.44.140]) by kanga.kvack.org (Postfix) with ESMTP id DC5066B0006 for ; Tue, 5 Nov 2019 04:32:20 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 4D15A8249980 for ; Tue, 5 Nov 2019 09:32:20 +0000 (UTC) X-FDA: 76121708040.12.river81_317228d57764a X-HE-Tag: river81_317228d57764a X-Filterd-Recvd-Size: 10400 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Tue, 5 Nov 2019 09:32:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572946339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BCW2yumpyeD0QRpINarfqjy396nJ9BgD2PKUzKr6dO4=; b=Q4aEcDNThWdMMNSscxNe+0NZWFKfAu8kRipbQGrRNGOe2jhhPyN5XKjXuDvaWuy5q2ssF4 KuVuBHlxp+Sm6WlryFmRC5dnZYo5smb2hscej5EKMZ7871zwxYqU8hdx6A9y3vv4PzUDIY kfsk6e06QKCpZDfMYuxgtxEE4ySvu7A= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-152-p8eCh0xjOsiLVOoP95CF-Q-1; Tue, 05 Nov 2019 04:32:14 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0D653107ACC2; Tue, 5 Nov 2019 09:32:08 +0000 (UTC) Received: from [10.36.117.253] (ovpn-117-253.ams2.redhat.com [10.36.117.253]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E80C60FC2; Tue, 5 Nov 2019 09:31:37 +0000 (UTC) Subject: Re: [PATCH v1 01/10] mm/memory_hotplug: Don't allow to online/offline memory blocks with holes To: Dan Williams Cc: Linux Kernel Mailing List , Linux MM , Michal Hocko , Andrew Morton , kvm-ppc@vger.kernel.org, linuxppc-dev , KVM list , linux-hyperv@vger.kernel.org, devel@driverdev.osuosl.org, xen-devel , X86 ML , Alexander Duyck , Alexander Duyck , Alex Williamson , Allison Randal , Andy Lutomirski , "Aneesh Kumar K.V" , Anshuman Khandual , Anthony Yznaga , Benjamin Herrenschmidt , Borislav Petkov , Boris Ostrovsky , Christophe Leroy , Cornelia Huck , Dave Hansen , Haiyang Zhang , "H. Peter Anvin" , Ingo Molnar , "Isaac J. Manjarres" , Jim Mattson , Joerg Roedel , Johannes Weiner , Juergen Gross , KarimAllah Ahmed , Kees Cook , "K. Y. Srinivasan" , "Matthew Wilcox (Oracle)" , Matt Sickler , Mel Gorman , Michael Ellerman , Michal Hocko , Mike Rapoport , Mike Rapoport , Nicholas Piggin , Oscar Salvador , Paolo Bonzini , Paul Mackerras , Paul Mackerras , Pavel Tatashin , Pavel Tatashin , Peter Zijlstra , Qian Cai , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Sasha Levin , Sean Christopherson , Stefano Stabellini , Stephen Hemminger , Thomas Gleixner , Vitaly Kuznetsov , Vlastimil Babka , Wanpeng Li , YueHaibing References: <20191024120938.11237-1-david@redhat.com> <20191024120938.11237-2-david@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Tue, 5 Nov 2019 10:31:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: p8eCh0xjOsiLVOoP95CF-Q-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable 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 05.11.19 02:30, Dan Williams wrote: > On Thu, Oct 24, 2019 at 5:10 AM David Hildenbrand wrot= e: >> >> Our onlining/offlining code is unnecessarily complicated. Only memory >> blocks added during boot can have holes (a range that is not >> IORESOURCE_SYSTEM_RAM). Hotplugged memory never has holes (e.g., see >> add_memory_resource()). All boot memory is alread online. >=20 > s/alread/already/ >=20 Thanks. > ...also perhaps clarify "already online" by what point in time and why > that is relevant. For example a description of the difference between > the SetPageReserved() in the bootmem path and the one in the hotplug > path. Will add. >=20 >> Therefore, when we stop allowing to offline memory blocks with holes, we >> implicitly no longer have to deal with onlining memory blocks with holes= . >=20 > Maybe an explicit reference of the code areas that deal with holes > would help to back up that assertion. Certainly it would have saved me > some time for the review. I can add a reference to the onlining code that will only online pages=20 that don't fall into memory holes. >=20 >> This allows to simplify the code. For example, we no longer have to >> worry about marking pages that fall into memory holes PG_reserved when >> onlining memory. We can stop setting pages PG_reserved. >=20 > ...but not for bootmem, right? Yes, bootmem is not changed. (especially, early allocations and memory=20 holes are marked PG_reserved - basically everything not given to the=20 buddy after boot) >=20 >> >> Offlining memory blocks added during boot is usually not guranteed to wo= rk >=20 > s/guranteed/guaranteed/ Thanks. >=20 >> either way (unmovable data might have easily ended up on that memory dur= ing >> boot). So stopping to do that should not really hurt (+ people are not >> even aware of a setup where that used to work >=20 > Maybe put a "Link: https://lkml.kernel.org/r/$msg_id" to that discussion? >=20 >> and that the existing code >> still works correctly with memory holes). For the use case of offlining >> memory to unplug DIMMs, we should see no change. (holes on DIMMs would b= e >> weird). >=20 > However, less memory can be offlined than was theoretically allowed > previously, so I don't understand the "we should see no change" > comment. I still agree that's a price worth paying to get the code > cleanups and if someone screams we can look at adding it back, but the > fact that it was already fragile seems decent enough protection. Hotplugged DIMMs (add_memory()) have no holes and will therefore see no=20 change. >> >> Please note that hardware errors (PG_hwpoison) are not memory holes and >> not affected by this change when offlining. >> >> Cc: Andrew Morton >> Cc: Michal Hocko >> Cc: Oscar Salvador >> Cc: Pavel Tatashin >> Cc: Dan Williams >> Cc: Anshuman Khandual >> Signed-off-by: David Hildenbrand >> --- >> mm/memory_hotplug.c | 26 ++++++++++++++++++++++++-- >> 1 file changed, 24 insertions(+), 2 deletions(-) >> >> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c >> index 561371ead39a..8d81730cf036 100644 >> --- a/mm/memory_hotplug.c >> +++ b/mm/memory_hotplug.c >> @@ -1447,10 +1447,19 @@ static void node_states_clear_node(int node, str= uct memory_notify *arg) >> node_clear_state(node, N_MEMORY); >> } >> >> +static int count_system_ram_pages_cb(unsigned long start_pfn, >> + unsigned long nr_pages, void *data) >> +{ >> + unsigned long *nr_system_ram_pages =3D data; >> + >> + *nr_system_ram_pages +=3D nr_pages; >> + return 0; >> +} >> + >> static int __ref __offline_pages(unsigned long start_pfn, >> unsigned long end_pfn) >> { >> - unsigned long pfn, nr_pages; >> + unsigned long pfn, nr_pages =3D 0; >> unsigned long offlined_pages =3D 0; >> int ret, node, nr_isolate_pageblock; >> unsigned long flags; >> @@ -1461,6 +1470,20 @@ static int __ref __offline_pages(unsigned long st= art_pfn, >> >> mem_hotplug_begin(); >> >> + /* >> + * Don't allow to offline memory blocks that contain holes. >> + * Consecuently, memory blocks with holes can never get onlined >=20 > s/Consecuently/Consequently/ Thanks. >=20 >> + * (hotplugged memory has no holes and all boot memory is online= ). >> + * This allows to simplify the onlining/offlining code quite a l= ot. >> + */ >=20 > The last sentence of this comment makes sense in the context of this > patch, but I don't think it stands by itself in the code base after > the fact. The person reading the comment can't see the simplifications > because the code is already gone. I'd clarify it to talk about why it > is safe to not mess around with PG_Reserved in the hotplug path > because of this check. I'll think of something. It's not just the PG_reserved handling but the=20 whole pfn_valid()/walk_system_ram_range() handling that can be simplified. >=20 > After those clarifications you can add: >=20 > Reviewed-by: Dan Williams >=20 Thanks! --=20 Thanks, David / dhildenb 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=-8.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 A6D57C49EAB for ; Tue, 5 Nov 2019 09:32:27 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 7ADC6214D8 for ; Tue, 5 Nov 2019 09:32:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Q4aEcDNT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7ADC6214D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4DA9C89447; Tue, 5 Nov 2019 09:32:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UPWW7tn2gZYP; Tue, 5 Nov 2019 09:32:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id DC8F58902D; Tue, 5 Nov 2019 09:32:24 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id B8F021BF2CC for ; Tue, 5 Nov 2019 09:32:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B216C8A77B for ; Tue, 5 Nov 2019 09:32:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kQ11bOozG0nC for ; Tue, 5 Nov 2019 09:32:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by hemlock.osuosl.org (Postfix) with ESMTPS id F057D8A777 for ; Tue, 5 Nov 2019 09:32:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572946339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BCW2yumpyeD0QRpINarfqjy396nJ9BgD2PKUzKr6dO4=; b=Q4aEcDNThWdMMNSscxNe+0NZWFKfAu8kRipbQGrRNGOe2jhhPyN5XKjXuDvaWuy5q2ssF4 KuVuBHlxp+Sm6WlryFmRC5dnZYo5smb2hscej5EKMZ7871zwxYqU8hdx6A9y3vv4PzUDIY kfsk6e06QKCpZDfMYuxgtxEE4ySvu7A= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-152-p8eCh0xjOsiLVOoP95CF-Q-1; Tue, 05 Nov 2019 04:32:14 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0D653107ACC2; Tue, 5 Nov 2019 09:32:08 +0000 (UTC) Received: from [10.36.117.253] (ovpn-117-253.ams2.redhat.com [10.36.117.253]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E80C60FC2; Tue, 5 Nov 2019 09:31:37 +0000 (UTC) Subject: Re: [PATCH v1 01/10] mm/memory_hotplug: Don't allow to online/offline memory blocks with holes To: Dan Williams References: <20191024120938.11237-1-david@redhat.com> <20191024120938.11237-2-david@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Tue, 5 Nov 2019 10:31:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: p8eCh0xjOsiLVOoP95CF-Q-1 X-Mimecast-Spam-Score: 0 X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-hyperv@vger.kernel.org, Michal Hocko , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , KVM list , Pavel Tatashin , KarimAllah Ahmed , Benjamin Herrenschmidt , Dave Hansen , Alexander Duyck , Michal Hocko , Paul Mackerras , Linux MM , Paul Mackerras , Michael Ellerman , "H. Peter Anvin" , Wanpeng Li , Alexander Duyck , Thomas Gleixner , Kees Cook , devel@driverdev.osuosl.org, Stefano Stabellini , Stephen Hemminger , "Aneesh Kumar K.V" , Joerg Roedel , X86 ML , YueHaibing , "Matthew Wilcox \(Oracle\)" , Mike Rapoport , Peter Zijlstra , Ingo Molnar , Vlastimil Babka , Anthony Yznaga , Oscar Salvador , "Isaac J. Manjarres" , Juergen Gross , Anshuman Khandual , Haiyang Zhang , Sasha Levin , kvm-ppc@vger.kernel.org, Qian Cai , Alex Williamson , Mike Rapoport , Borislav Petkov , Nicholas Piggin , Andy Lutomirski , xen-devel , Boris Ostrovsky , Vitaly Kuznetsov , Allison Randal , Jim Mattson , Christophe Leroy , Mel Gorman , Cornelia Huck , Pavel Tatashin , Linux Kernel Mailing List , Sean Christopherson , Johannes Weiner , Paolo Bonzini , Andrew Morton , linuxppc-dev Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" On 05.11.19 02:30, Dan Williams wrote: > On Thu, Oct 24, 2019 at 5:10 AM David Hildenbrand wrote: >> >> Our onlining/offlining code is unnecessarily complicated. Only memory >> blocks added during boot can have holes (a range that is not >> IORESOURCE_SYSTEM_RAM). Hotplugged memory never has holes (e.g., see >> add_memory_resource()). All boot memory is alread online. > > s/alread/already/ > Thanks. > ...also perhaps clarify "already online" by what point in time and why > that is relevant. For example a description of the difference between > the SetPageReserved() in the bootmem path and the one in the hotplug > path. Will add. > >> Therefore, when we stop allowing to offline memory blocks with holes, we >> implicitly no longer have to deal with onlining memory blocks with holes. > > Maybe an explicit reference of the code areas that deal with holes > would help to back up that assertion. Certainly it would have saved me > some time for the review. I can add a reference to the onlining code that will only online pages that don't fall into memory holes. > >> This allows to simplify the code. For example, we no longer have to >> worry about marking pages that fall into memory holes PG_reserved when >> onlining memory. We can stop setting pages PG_reserved. > > ...but not for bootmem, right? Yes, bootmem is not changed. (especially, early allocations and memory holes are marked PG_reserved - basically everything not given to the buddy after boot) > >> >> Offlining memory blocks added during boot is usually not guranteed to work > > s/guranteed/guaranteed/ Thanks. > >> either way (unmovable data might have easily ended up on that memory during >> boot). So stopping to do that should not really hurt (+ people are not >> even aware of a setup where that used to work > > Maybe put a "Link: https://lkml.kernel.org/r/$msg_id" to that discussion? > >> and that the existing code >> still works correctly with memory holes). For the use case of offlining >> memory to unplug DIMMs, we should see no change. (holes on DIMMs would be >> weird). > > However, less memory can be offlined than was theoretically allowed > previously, so I don't understand the "we should see no change" > comment. I still agree that's a price worth paying to get the code > cleanups and if someone screams we can look at adding it back, but the > fact that it was already fragile seems decent enough protection. Hotplugged DIMMs (add_memory()) have no holes and will therefore see no change. >> >> Please note that hardware errors (PG_hwpoison) are not memory holes and >> not affected by this change when offlining. >> >> Cc: Andrew Morton >> Cc: Michal Hocko >> Cc: Oscar Salvador >> Cc: Pavel Tatashin >> Cc: Dan Williams >> Cc: Anshuman Khandual >> Signed-off-by: David Hildenbrand >> --- >> mm/memory_hotplug.c | 26 ++++++++++++++++++++++++-- >> 1 file changed, 24 insertions(+), 2 deletions(-) >> >> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c >> index 561371ead39a..8d81730cf036 100644 >> --- a/mm/memory_hotplug.c >> +++ b/mm/memory_hotplug.c >> @@ -1447,10 +1447,19 @@ static void node_states_clear_node(int node, struct memory_notify *arg) >> node_clear_state(node, N_MEMORY); >> } >> >> +static int count_system_ram_pages_cb(unsigned long start_pfn, >> + unsigned long nr_pages, void *data) >> +{ >> + unsigned long *nr_system_ram_pages = data; >> + >> + *nr_system_ram_pages += nr_pages; >> + return 0; >> +} >> + >> static int __ref __offline_pages(unsigned long start_pfn, >> unsigned long end_pfn) >> { >> - unsigned long pfn, nr_pages; >> + unsigned long pfn, nr_pages = 0; >> unsigned long offlined_pages = 0; >> int ret, node, nr_isolate_pageblock; >> unsigned long flags; >> @@ -1461,6 +1470,20 @@ static int __ref __offline_pages(unsigned long start_pfn, >> >> mem_hotplug_begin(); >> >> + /* >> + * Don't allow to offline memory blocks that contain holes. >> + * Consecuently, memory blocks with holes can never get onlined > > s/Consecuently/Consequently/ Thanks. > >> + * (hotplugged memory has no holes and all boot memory is online). >> + * This allows to simplify the onlining/offlining code quite a lot. >> + */ > > The last sentence of this comment makes sense in the context of this > patch, but I don't think it stands by itself in the code base after > the fact. The person reading the comment can't see the simplifications > because the code is already gone. I'd clarify it to talk about why it > is safe to not mess around with PG_Reserved in the hotplug path > because of this check. I'll think of something. It's not just the PG_reserved handling but the whole pfn_valid()/walk_system_ram_range() handling that can be simplified. > > After those clarifications you can add: > > Reviewed-by: Dan Williams > Thanks! -- Thanks, David / dhildenb _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel 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=-8.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 6107BC010A3 for ; Tue, 5 Nov 2019 10:52:22 +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 B135D2190F for ; Tue, 5 Nov 2019 10:52:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Q4aEcDNT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B135D2190F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 476mhM3dFjzF4xW for ; Tue, 5 Nov 2019 21:52:19 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=205.139.110.120; helo=us-smtp-1.mimecast.com; envelope-from=david@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="Q4aEcDNT"; dkim-atps=neutral Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (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 476kw65j8RzF4Pc for ; Tue, 5 Nov 2019 20:32:21 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572946339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BCW2yumpyeD0QRpINarfqjy396nJ9BgD2PKUzKr6dO4=; b=Q4aEcDNThWdMMNSscxNe+0NZWFKfAu8kRipbQGrRNGOe2jhhPyN5XKjXuDvaWuy5q2ssF4 KuVuBHlxp+Sm6WlryFmRC5dnZYo5smb2hscej5EKMZ7871zwxYqU8hdx6A9y3vv4PzUDIY kfsk6e06QKCpZDfMYuxgtxEE4ySvu7A= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-152-p8eCh0xjOsiLVOoP95CF-Q-1; Tue, 05 Nov 2019 04:32:14 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0D653107ACC2; Tue, 5 Nov 2019 09:32:08 +0000 (UTC) Received: from [10.36.117.253] (ovpn-117-253.ams2.redhat.com [10.36.117.253]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E80C60FC2; Tue, 5 Nov 2019 09:31:37 +0000 (UTC) Subject: Re: [PATCH v1 01/10] mm/memory_hotplug: Don't allow to online/offline memory blocks with holes To: Dan Williams References: <20191024120938.11237-1-david@redhat.com> <20191024120938.11237-2-david@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Tue, 5 Nov 2019 10:31:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: p8eCh0xjOsiLVOoP95CF-Q-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Tue, 05 Nov 2019 21:46:21 +1100 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: linux-hyperv@vger.kernel.org, Michal Hocko , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , KVM list , Pavel Tatashin , KarimAllah Ahmed , Dave Hansen , Alexander Duyck , Michal Hocko , Linux MM , Paul Mackerras , "H. Peter Anvin" , Wanpeng Li , Alexander Duyck , "K. Y. Srinivasan" , Thomas Gleixner , Kees Cook , devel@driverdev.osuosl.org, Stefano Stabellini , Stephen Hemminger , "Aneesh Kumar K.V" , Joerg Roedel , X86 ML , YueHaibing , "Matthew Wilcox \(Oracle\)" , Mike Rapoport , Peter Zijlstra , Ingo Molnar , Vlastimil Babka , Anthony Yznaga , Oscar Salvador , "Isaac J. Manjarres" , Matt Sickler , Juergen Gross , Anshuman Khandual , Haiyang Zhang , Sasha Levin , kvm-ppc@vger.kernel.org, Qian Cai , Alex Williamson , Mike Rapoport , Borislav Petkov , Nicholas Piggin , Andy Lutomirski , xen-devel , Boris Ostrovsky , Vitaly Kuznetsov , Allison Randal , Jim Mattson , Mel Gorman , Cornelia Huck , Pavel Tatashin , Linux Kernel Mailing List , Sean Christopherson , Johannes Weiner , Paolo Bonzini , Andrew Morton , linuxppc-dev Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 05.11.19 02:30, Dan Williams wrote: > On Thu, Oct 24, 2019 at 5:10 AM David Hildenbrand wrot= e: >> >> Our onlining/offlining code is unnecessarily complicated. Only memory >> blocks added during boot can have holes (a range that is not >> IORESOURCE_SYSTEM_RAM). Hotplugged memory never has holes (e.g., see >> add_memory_resource()). All boot memory is alread online. >=20 > s/alread/already/ >=20 Thanks. > ...also perhaps clarify "already online" by what point in time and why > that is relevant. For example a description of the difference between > the SetPageReserved() in the bootmem path and the one in the hotplug > path. Will add. >=20 >> Therefore, when we stop allowing to offline memory blocks with holes, we >> implicitly no longer have to deal with onlining memory blocks with holes= . >=20 > Maybe an explicit reference of the code areas that deal with holes > would help to back up that assertion. Certainly it would have saved me > some time for the review. I can add a reference to the onlining code that will only online pages=20 that don't fall into memory holes. >=20 >> This allows to simplify the code. For example, we no longer have to >> worry about marking pages that fall into memory holes PG_reserved when >> onlining memory. We can stop setting pages PG_reserved. >=20 > ...but not for bootmem, right? Yes, bootmem is not changed. (especially, early allocations and memory=20 holes are marked PG_reserved - basically everything not given to the=20 buddy after boot) >=20 >> >> Offlining memory blocks added during boot is usually not guranteed to wo= rk >=20 > s/guranteed/guaranteed/ Thanks. >=20 >> either way (unmovable data might have easily ended up on that memory dur= ing >> boot). So stopping to do that should not really hurt (+ people are not >> even aware of a setup where that used to work >=20 > Maybe put a "Link: https://lkml.kernel.org/r/$msg_id" to that discussion? >=20 >> and that the existing code >> still works correctly with memory holes). For the use case of offlining >> memory to unplug DIMMs, we should see no change. (holes on DIMMs would b= e >> weird). >=20 > However, less memory can be offlined than was theoretically allowed > previously, so I don't understand the "we should see no change" > comment. I still agree that's a price worth paying to get the code > cleanups and if someone screams we can look at adding it back, but the > fact that it was already fragile seems decent enough protection. Hotplugged DIMMs (add_memory()) have no holes and will therefore see no=20 change. >> >> Please note that hardware errors (PG_hwpoison) are not memory holes and >> not affected by this change when offlining. >> >> Cc: Andrew Morton >> Cc: Michal Hocko >> Cc: Oscar Salvador >> Cc: Pavel Tatashin >> Cc: Dan Williams >> Cc: Anshuman Khandual >> Signed-off-by: David Hildenbrand >> --- >> mm/memory_hotplug.c | 26 ++++++++++++++++++++++++-- >> 1 file changed, 24 insertions(+), 2 deletions(-) >> >> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c >> index 561371ead39a..8d81730cf036 100644 >> --- a/mm/memory_hotplug.c >> +++ b/mm/memory_hotplug.c >> @@ -1447,10 +1447,19 @@ static void node_states_clear_node(int node, str= uct memory_notify *arg) >> node_clear_state(node, N_MEMORY); >> } >> >> +static int count_system_ram_pages_cb(unsigned long start_pfn, >> + unsigned long nr_pages, void *data) >> +{ >> + unsigned long *nr_system_ram_pages =3D data; >> + >> + *nr_system_ram_pages +=3D nr_pages; >> + return 0; >> +} >> + >> static int __ref __offline_pages(unsigned long start_pfn, >> unsigned long end_pfn) >> { >> - unsigned long pfn, nr_pages; >> + unsigned long pfn, nr_pages =3D 0; >> unsigned long offlined_pages =3D 0; >> int ret, node, nr_isolate_pageblock; >> unsigned long flags; >> @@ -1461,6 +1470,20 @@ static int __ref __offline_pages(unsigned long st= art_pfn, >> >> mem_hotplug_begin(); >> >> + /* >> + * Don't allow to offline memory blocks that contain holes. >> + * Consecuently, memory blocks with holes can never get onlined >=20 > s/Consecuently/Consequently/ Thanks. >=20 >> + * (hotplugged memory has no holes and all boot memory is online= ). >> + * This allows to simplify the onlining/offlining code quite a l= ot. >> + */ >=20 > The last sentence of this comment makes sense in the context of this > patch, but I don't think it stands by itself in the code base after > the fact. The person reading the comment can't see the simplifications > because the code is already gone. I'd clarify it to talk about why it > is safe to not mess around with PG_Reserved in the hotplug path > because of this check. I'll think of something. It's not just the PG_reserved handling but the=20 whole pfn_valid()/walk_system_ram_range() handling that can be simplified. >=20 > After those clarifications you can add: >=20 > Reviewed-by: Dan Williams >=20 Thanks! --=20 Thanks, David / dhildenb 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=-8.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 E02DDC49EAB for ; Tue, 5 Nov 2019 09:32:40 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 ACC4D214D8 for ; Tue, 5 Nov 2019 09:32:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="AXmgNMX2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ACC4D214D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iRvCK-0001iS-80; Tue, 05 Nov 2019 09:32:24 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iRvCJ-0001iL-0i for xen-devel@lists.xenproject.org; Tue, 05 Nov 2019 09:32:23 +0000 X-Inumbo-ID: 2a6456c6-ffaf-11e9-9631-bc764e2007e4 Received: from us-smtp-1.mimecast.com (unknown [205.139.110.61]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 2a6456c6-ffaf-11e9-9631-bc764e2007e4; Tue, 05 Nov 2019 09:32:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572946340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BCW2yumpyeD0QRpINarfqjy396nJ9BgD2PKUzKr6dO4=; b=AXmgNMX2o1KmNaUCrbEKKkL2XGl2fppMYs1YVRfvtnhxWFbSwy550oACW2g3ga8FGhimcL pGrG11mUYjOnnfg9CF41kuseW0v2rbQj3GUROyQ4GeJrCJqWO0BcO04E6R9dNb6Bll6xhM tbNx3Su9UMPIpYT+tKJmg9u5jlSKIVY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-152-p8eCh0xjOsiLVOoP95CF-Q-1; Tue, 05 Nov 2019 04:32:14 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0D653107ACC2; Tue, 5 Nov 2019 09:32:08 +0000 (UTC) Received: from [10.36.117.253] (ovpn-117-253.ams2.redhat.com [10.36.117.253]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E80C60FC2; Tue, 5 Nov 2019 09:31:37 +0000 (UTC) To: Dan Williams References: <20191024120938.11237-1-david@redhat.com> <20191024120938.11237-2-david@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Tue, 5 Nov 2019 10:31:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: p8eCh0xjOsiLVOoP95CF-Q-1 X-Mimecast-Spam-Score: 0 Subject: Re: [Xen-devel] [PATCH v1 01/10] mm/memory_hotplug: Don't allow to online/offline memory blocks with holes X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: linux-hyperv@vger.kernel.org, Michal Hocko , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , KVM list , Pavel Tatashin , KarimAllah Ahmed , Benjamin Herrenschmidt , Dave Hansen , Alexander Duyck , Michal Hocko , Paul Mackerras , Linux MM , Paul Mackerras , Michael Ellerman , "H. Peter Anvin" , Wanpeng Li , Alexander Duyck , "K. Y. Srinivasan" , Thomas Gleixner , Kees Cook , devel@driverdev.osuosl.org, Stefano Stabellini , Stephen Hemminger , "Aneesh Kumar K.V" , Joerg Roedel , X86 ML , YueHaibing , "Matthew Wilcox \(Oracle\)" , Mike Rapoport , Peter Zijlstra , Ingo Molnar , Vlastimil Babka , Anthony Yznaga , Oscar Salvador , "Isaac J. Manjarres" , Matt Sickler , Juergen Gross , Anshuman Khandual , Haiyang Zhang , Sasha Levin , kvm-ppc@vger.kernel.org, Qian Cai , Alex Williamson , Mike Rapoport , Borislav Petkov , Nicholas Piggin , Andy Lutomirski , xen-devel , Boris Ostrovsky , Vitaly Kuznetsov , Allison Randal , Jim Mattson , Christophe Leroy , Mel Gorman , Cornelia Huck , Pavel Tatashin , Linux Kernel Mailing List , Sean Christopherson , Johannes Weiner , Paolo Bonzini , Andrew Morton , linuxppc-dev Content-Transfer-Encoding: base64 Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" T24gMDUuMTEuMTkgMDI6MzAsIERhbiBXaWxsaWFtcyB3cm90ZToKPiBPbiBUaHUsIE9jdCAyNCwg MjAxOSBhdCA1OjEwIEFNIERhdmlkIEhpbGRlbmJyYW5kIDxkYXZpZEByZWRoYXQuY29tPiB3cm90 ZToKPj4KPj4gT3VyIG9ubGluaW5nL29mZmxpbmluZyBjb2RlIGlzIHVubmVjZXNzYXJpbHkgY29t cGxpY2F0ZWQuIE9ubHkgbWVtb3J5Cj4+IGJsb2NrcyBhZGRlZCBkdXJpbmcgYm9vdCBjYW4gaGF2 ZSBob2xlcyAoYSByYW5nZSB0aGF0IGlzIG5vdAo+PiBJT1JFU09VUkNFX1NZU1RFTV9SQU0pLiBI b3RwbHVnZ2VkIG1lbW9yeSBuZXZlciBoYXMgaG9sZXMgKGUuZy4sIHNlZQo+PiBhZGRfbWVtb3J5 X3Jlc291cmNlKCkpLiBBbGwgYm9vdCBtZW1vcnkgaXMgYWxyZWFkIG9ubGluZS4KPiAKPiBzL2Fs cmVhZC9hbHJlYWR5Lwo+IAoKVGhhbmtzLgoKPiAuLi5hbHNvIHBlcmhhcHMgY2xhcmlmeSAiYWxy ZWFkeSBvbmxpbmUiIGJ5IHdoYXQgcG9pbnQgaW4gdGltZSBhbmQgd2h5Cj4gdGhhdCBpcyByZWxl dmFudC4gRm9yIGV4YW1wbGUgYSBkZXNjcmlwdGlvbiBvZiB0aGUgZGlmZmVyZW5jZSBiZXR3ZWVu Cj4gdGhlIFNldFBhZ2VS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