Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp995722ybl; Wed, 14 Aug 2019 09:06:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+zuv6hHiTtHTbRivnrDF8TtMUEENLMcEIap5tNk6FetSxAyt5od0iBQ9bz6sOcLWQAoK2 X-Received: by 2002:a62:f24b:: with SMTP id y11mr731040pfl.0.1565798805813; Wed, 14 Aug 2019 09:06:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565798805; cv=none; d=google.com; s=arc-20160816; b=UC+fuqXyBlG6LEQGIHuSwly0zjFj6wWugRlnNTP5Mb70kDddn/FxARYBaRA77Dzh7n 3wwzL6fnyE6x37QIjaqaTWkFpayGEPIYjqBLvicH6m37dk3swDODbesL4Neo5aAXmIjP SdS3CIMihbMYuRw/VCwJp0vNJXcyQ4b5wHJik2lgQY1JODr15MixxlcxTSv6flGWC0sH uwlQS/UDPPIIL3xCjsX3sY4dZqYLxW7zMWYL9yfQtZg883AyKisSDli3weLgkCyfYmCa JtjxlW6CWFcaVWkkK3xf1pYcp0GV8gnlVMixXyOfJ9vmZhc5kJg/fE4pcKkxTLIEVm9g /Ysw== 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=QqUwO//AlM9X3Ep2fsyqp+a1j9wN0dr53s4/+JM6eSQ=; b=tJ9IGhyHCVl6pTKwa7E2yy1D1oiJxH19iuQS7PYGmitFhcT+wF9wfgZP4ySDOl2loY i69mDgaMVJKAg2ntOJmOme+aJIekPsKdza26XZOY8pr/nijRQzstAu3ef5WJ6KObOQ++ bmTJV77sW169RXw4SUmvusUabBicknxiQvSVOnrXYi7weCyV5OH5C56VuVaqPE6VwZRX asSKOLHHOhEQtuUt+QDhvj6NOjo7xAks1JVuR6YmQdip6AaEBV1JM/qSgirIUDZOSKCJ LnZxh0bQzJP3r5FBpJM1jnbxcjor1a6quht/QDp+B9JIKvMkgrX1r3ctFZed1+Dy8sl1 Hx5w== 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 28si76638pgk.331.2019.08.14.09.06.29; Wed, 14 Aug 2019 09:06:45 -0700 (PDT) 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 S1728092AbfHNQFC (ORCPT + 99 others); Wed, 14 Aug 2019 12:05:02 -0400 Received: from mx2.suse.de ([195.135.220.15]:37012 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726047AbfHNQFB (ORCPT ); Wed, 14 Aug 2019 12:05:01 -0400 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 01A52AB92; Wed, 14 Aug 2019 16:05:00 +0000 (UTC) Date: Wed, 14 Aug 2019 18:04:58 +0200 From: Michal Hocko To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Oscar Salvador , Pavel Tatashin , Dan Williams Subject: Re: [PATCH v2 2/5] mm/memory_hotplug: Drop PageReserved() check in online_pages_range() Message-ID: <20190814160458.GH17933@dhcp22.suse.cz> References: <20190814154109.3448-1-david@redhat.com> <20190814154109.3448-3-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190814154109.3448-3-david@redhat.com> 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 Wed 14-08-19 17:41:06, David Hildenbrand wrote: > move_pfn_range_to_zone() will set all pages to PG_reserved via > memmap_init_zone(). The only way a page could no longer be reserved > would be if a MEM_GOING_ONLINE notifier would clear PG_reserved - which > is not done (the online_page callback is used for that purpose by > e.g., Hyper-V instead). walk_system_ram_range() will never call > online_pages_range() with duplicate PFNs, so drop the PageReserved() check. > > This seems to be a leftover from ancient times where the memmap was > initialized when adding memory and we wanted to check for already > onlined memory. > > Cc: Andrew Morton > Cc: Oscar Salvador > Cc: Michal Hocko > Cc: Pavel Tatashin > Cc: Dan Williams > Signed-off-by: David Hildenbrand Thanks for spliting that up. Acked-by: Michal Hocko > --- > mm/memory_hotplug.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index 3706a137d880..10ad970f3f14 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -653,9 +653,7 @@ static int online_pages_range(unsigned long start_pfn, unsigned long nr_pages, > { > unsigned long onlined_pages = *(unsigned long *)arg; > > - if (PageReserved(pfn_to_page(start_pfn))) > - onlined_pages += online_pages_blocks(start_pfn, nr_pages); > - > + onlined_pages += online_pages_blocks(start_pfn, nr_pages); > online_mem_sections(start_pfn, start_pfn + nr_pages); > > *(unsigned long *)arg = onlined_pages; > -- > 2.21.0 > -- Michal Hocko SUSE Labs