Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp970221ybl; Wed, 14 Aug 2019 08:43:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyshQeLTuZHECuFbOikWewF3J8gWYWbHQXhxtSpKbheQ1ia5LyLyMYDu/2aEcalfrcdmXPt X-Received: by 2002:aa7:93cf:: with SMTP id y15mr534546pff.251.1565797408207; Wed, 14 Aug 2019 08:43:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565797408; cv=none; d=google.com; s=arc-20160816; b=n5g5/HDlBpGB1R5wY53nzcREpcwATLkEbLP0qcufIfe6ha+Ds29RW67ghcRYVBtc2C NCxZuCR16qgjz2D0Vwn9O++9TC3u2SruUtOSz46MSJAopKzut2GT1D4XDj/8frMK9HUl FyvsqCkm4d2WrsYQAIYddy3SqxPcwfb63V3BFxt3EjgA3qieFbUeyo1DOc7cIVZ0U2JQ ULQx2edd1MtDGG4+SlUjcMYHC/LAHKgv/5ECtMFFIw2zOb7//PyWL48JeGHuEWPEPWN3 LgncziWVHHsDn/zxWt/mX9wvgoeS7uH/tS0R4IYm29IXsOPOZXHj58fvObENhmPiZ3TY FWyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=3xlCt+J736z3KHORgjRV4tE8aVyJ+LR1BrTSu2L3Ems=; b=s3a2YBSmjmc/+ExGGngMdxI0GaBLUmXRwGD1CQHTUUW0AaI/FgvKJ9upKN2ThQhUG9 kxDck6sgvODfRkkJ1LknB7mlcY+f+x5adrCRr4Gbo/r1OneL+hd51QeJx1TS4YilJnyb qkZaFtEYnYBy+OOcauTUBXEE+z6HNsTut2wsblGAG5HkXF41GuHpkaE50k+tD/mLb1h2 6v5VDJw7yXo9/yXepmXvh7SQ4pg2LGiz2EBv7XL9aSvIFrzrBl3vmJOFz2DRgqZwjEgw G2d15kvq7RyBAhOf1qardzp8QBIOEyJ/5YCeuJoiWTGDWvT3fhhGg6LksUW69yd7M9wg j4Cw== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j190si63473pge.92.2019.08.14.08.43.12; Wed, 14 Aug 2019 08:43:28 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728053AbfHNPlV (ORCPT + 99 others); Wed, 14 Aug 2019 11:41:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36152 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727791AbfHNPlU (ORCPT ); Wed, 14 Aug 2019 11:41:20 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 540D2C069B52; Wed, 14 Aug 2019 15:41:20 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-49.ams2.redhat.com [10.36.116.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id A720080693; Wed, 14 Aug 2019 15:41:18 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Oscar Salvador , Michal Hocko , Pavel Tatashin , Dan Williams Subject: [PATCH v2 2/5] mm/memory_hotplug: Drop PageReserved() check in online_pages_range() Date: Wed, 14 Aug 2019 17:41:06 +0200 Message-Id: <20190814154109.3448-3-david@redhat.com> In-Reply-To: <20190814154109.3448-1-david@redhat.com> References: <20190814154109.3448-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 14 Aug 2019 15:41:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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