Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp284886ybv; Wed, 5 Feb 2020 05:36:23 -0800 (PST) X-Google-Smtp-Source: APXvYqz/cd3uxMZviP6sT/79f8RdOwkCmu1qJq3+FdC8A84I8iAk2T21GRJVRYPb+DAcLk5VhPRt X-Received: by 2002:a9d:22:: with SMTP id 31mr24625137ota.173.1580909783291; Wed, 05 Feb 2020 05:36:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580909783; cv=none; d=google.com; s=arc-20160816; b=sT3z+uYOvzJ4g51fNnBvX+SShXegFsp91tZUvIQX8Y/k4aPeFsP5FLeMwC1CyiK0mb aGEl1pElRUMLeIGxIxdVbO8QX57MAYIm3l+55HA1DO8eB/QSQ5+CwIpO6o96BpQgaM00 cjF3+tA8s9u6xw+IRbqUrnf0tGqOBhOF8dAX/gT1aXuzB8q6XhhfK8FsJlyc+rSENhVe ++u1xRxlALC0H8MdBfftEJI6EkFVXem/x0wPXyt6oLx0EbCeMEn+Ueoa1USjfnq9mwsh KiDKU2O0E/QZG3v487DfgrrIoYftGoHujuhnoV0tKGq49EcjZ4rMnsM4rWKq/TdeTdw1 A/Hg== 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:dkim-signature; bh=u91ZEwgoTZ1sl1C4tF6hrADVy2LlA7x8q+fzwZZauas=; b=baAEmP+9rOPcqXQQwkKmiVW+wzu+M/+aDun27epTV3e7FY51N+e/I9YCRAUi5QPNWX s2VYc32Z7/jovpQ7lqCupod+65vGz5yO4KvAoAAnoCsXKcC0YBRDId8iiSawsPF52LTD RqGeNfbutygtVs31e/x0DYmcmsLJlzygGk76nsSraH6vhrrWlRQHQfxu0qVvUd/9x230 KjsdclF3rQ3Nvpzm1qJoxDLyyf6RfxfyKqOb0Gfb2xWNmHX9S/dRk3g0A990S+xHr5UX gqeuj8fxdj+l1mM3DNpaMB9O+MIVv/tlWq6WrPihzi4fb/gTSHZxj0SzsX3i/DAEHzNb +Dvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TJXjHfjK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e5si10879564oii.32.2020.02.05.05.36.10; Wed, 05 Feb 2020 05:36:23 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TJXjHfjK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728062AbgBENe7 (ORCPT + 99 others); Wed, 5 Feb 2020 08:34:59 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:49999 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727109AbgBENe6 (ORCPT ); Wed, 5 Feb 2020 08:34:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580909698; 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: in-reply-to:in-reply-to:references:references; bh=u91ZEwgoTZ1sl1C4tF6hrADVy2LlA7x8q+fzwZZauas=; b=TJXjHfjKx2yiy5qWLtCve2F0F/mfhQzTLo1psiKmEEK63O5lwdE4gc/KlXO+QJgPwmMJv0 p7tnYFpGxGJxuoKlE0CNF60KQq+TNDHMBzPTSXaftBUKbWDOMbcBNgsYad4nDmB3I/+IGZ q65UDWDJWUuox7r9DQDnpwAuXm6AlIE= 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-348-zh-m8MZxM7-EvXc2VHf3tA-1; Wed, 05 Feb 2020 08:34:53 -0500 X-MC-Unique: zh-m8MZxM7-EvXc2VHf3tA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D1C3C8018A6; Wed, 5 Feb 2020 13:34:50 +0000 (UTC) Received: from localhost (ovpn-12-97.pek2.redhat.com [10.72.12.97]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6566C101D481; Wed, 5 Feb 2020 13:34:45 +0000 (UTC) Date: Wed, 5 Feb 2020 21:34:42 +0800 From: Baoquan He 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, Andrew Morton , Oscar Salvador , Michal Hocko , Pavel Tatashin , Dan Williams , Wei Yang Subject: Re: [PATCH v6 08/10] mm/memory_hotplug: Don't check for "all holes" in shrink_zone_span() Message-ID: <20200205133442.GC8965@MiWiFi-R3L-srv> References: <20191006085646.5768-1-david@redhat.com> <20191006085646.5768-9-david@redhat.com> <20200204142516.GD26758@MiWiFi-R3L-srv> <20200205124329.GE26758@MiWiFi-R3L-srv> 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) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/05/20 at 02:20pm, David Hildenbrand wrote: > On 05.02.20 13:43, Baoquan He wrote: > > On 02/04/20 at 03:42pm, David Hildenbrand wrote: > >> On 04.02.20 15:25, Baoquan He wrote: > >>> On 10/06/19 at 10:56am, David Hildenbrand wrote: > >>>> If we have holes, the holes will automatically get detected and removed > >>>> once we remove the next bigger/smaller section. The extra checks can > >>>> go. > >>>> > >>>> Cc: Andrew Morton > >>>> Cc: Oscar Salvador > >>>> Cc: Michal Hocko > >>>> Cc: David Hildenbrand > >>>> Cc: Pavel Tatashin > >>>> Cc: Dan Williams > >>>> Cc: Wei Yang > >>>> Signed-off-by: David Hildenbrand > >>>> --- > >>>> mm/memory_hotplug.c | 34 +++++++--------------------------- > >>>> 1 file changed, 7 insertions(+), 27 deletions(-) > >>>> > >>>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > >>>> index f294918f7211..8dafa1ba8d9f 100644 > >>>> --- a/mm/memory_hotplug.c > >>>> +++ b/mm/memory_hotplug.c > >>>> @@ -393,6 +393,9 @@ static void shrink_zone_span(struct zone *zone, unsigned long start_pfn, > >>>> if (pfn) { > >>>> zone->zone_start_pfn = pfn; > >>>> zone->spanned_pages = zone_end_pfn - pfn; > >>>> + } else { > >>>> + zone->zone_start_pfn = 0; > >>>> + zone->spanned_pages = 0; > >>>> } > >>>> } else if (zone_end_pfn == end_pfn) { > >>>> /* > >>>> @@ -405,34 +408,11 @@ static void shrink_zone_span(struct zone *zone, unsigned long start_pfn, > >>>> start_pfn); > >>>> if (pfn) > >>>> zone->spanned_pages = pfn - zone_start_pfn + 1; > >>>> + else { > >>>> + zone->zone_start_pfn = 0; > >>>> + zone->spanned_pages = 0; > >>> > >>> Thinking in which case (zone_start_pfn != start_pfn) and it comes here. > >> > >> Could only happen in case the zone_start_pfn would have been "out of the > >> zone already". If you ask me: unlikely :) > > > > Yeah, I also think it's unlikely to come here. > > > > The 'if (zone_start_pfn == start_pfn)' checking also covers the case > > (zone_start_pfn == start_pfn && zone_end_pfn == end_pfn). So this > > zone_start_pfn/spanned_pages resetting can be removed to avoid > > confusion. > > At least I would find it more confusing without it (or want a comment > explaining why this does not have to be handled and why the !pfn case is > not possible). I don't get why being w/o it will be more confusing, but it's OK since it doesn't impact anything. > > Anyhow, that patch is already upstream and I don't consider this high > priority. Thanks :) Yeah, noticed you told Wei the status in another patch thread, I am fine with it, just leave it to you to decide. Thanks.