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=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, 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 2437EC433E0 for ; Wed, 20 Jan 2021 11:49:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 65A2523139 for ; Wed, 20 Jan 2021 11:49:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65A2523139 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 532FC6B0005; Wed, 20 Jan 2021 06:49:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4BC2E6B0006; Wed, 20 Jan 2021 06:49:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 35D426B0007; Wed, 20 Jan 2021 06:49:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0079.hostedemail.com [216.40.44.79]) by kanga.kvack.org (Postfix) with ESMTP id 1C2A26B0005 for ; Wed, 20 Jan 2021 06:49:23 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id CB79B3641 for ; Wed, 20 Jan 2021 11:49:22 +0000 (UTC) X-FDA: 77725982964.11.salt08_1202f762755a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id AE307180F8B81 for ; Wed, 20 Jan 2021 11:49:22 +0000 (UTC) X-HE-Tag: salt08_1202f762755a X-Filterd-Recvd-Size: 4492 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Wed, 20 Jan 2021 11:49:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611143361; 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=OD2lUZozrmHh/TMRDJwTqK7EFoWr5oPmhv7mmtz2rSE=; b=LFnwp5f9eyRKFts4ff02M6+66GVIp3QVYNvUtGPhBUf+9j9E17WYyItX0BPD2eeaY6IzA9 kF8CwnjLGjTjnc2wv1gGa7b0ZXXMrJwpYdfwJXtE3wtZygsn/o1U2FBzwMdt/9HAA/2V9R I8GAY/HgzVy8g9HphwG9nZZ+Pll6J1A= 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-146-Yl6EbHDlPIW_9qmAUMggdA-1; Wed, 20 Jan 2021 06:49:17 -0500 X-MC-Unique: Yl6EbHDlPIW_9qmAUMggdA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 47A1CB8122; Wed, 20 Jan 2021 11:49:16 +0000 (UTC) Received: from [10.36.115.161] (ovpn-115-161.ams2.redhat.com [10.36.115.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0015227C3D; Wed, 20 Jan 2021 11:49:14 +0000 (UTC) Subject: Re: [PATCH] mm: Fix ZONE_DEVICE usage in move_pfn_range_to_zone() To: Dan Williams , akpm@linux-foundation.org Cc: Randy Dunlap , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <161111619868.2787408.1710192276369197040.stgit@dwillia2-desk3.amr.corp.intel.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Wed, 20 Jan 2021 12:49:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <161111619868.2787408.1710192276369197040.stgit@dwillia2-desk3.amr.corp.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 20.01.21 05:16, Dan Williams wrote: > Randy reports the build breaks with recent additions of > section_taint_zone_device() in move_pfn_range_to_zone(). Fix that by > including a conditionally stubbed out zone_is_zone_device() helper. > > Reported-by: Randy Dunlap > Signed-off-by: Dan Williams > --- > Andrew, apologies for the thrash. Please fold this into: > > mm-teach-pfn_to_online_page-about-zone_device-section-collisions.patch > > include/linux/mmzone.h | 12 ++++++++++++ > mm/memory_hotplug.c | 2 +- > 2 files changed, 13 insertions(+), 1 deletion(-) > > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 0b5c44f730b4..66ba38dae9ba 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -885,6 +885,18 @@ static inline int local_memory_node(int node_id) { return node_id; }; > */ > #define zone_idx(zone) ((zone) - (zone)->zone_pgdat->node_zones) > > +#ifdef CONFIG_ZONE_DEVICE > +static inline bool zone_is_zone_device(struct zone *zone) > +{ > + return zone_idx(zone) == ZONE_DEVICE; > +} > +#else > +static inline bool zone_is_zone_device(struct zone *zone) > +{ > + return false; > +} > +#endif > + > /* > * Returns true if a zone has pages managed by the buddy allocator. > * All the reclaim decisions have to use this function rather than > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index c78a1bef561b..710e469fb3a1 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -769,7 +769,7 @@ void __ref move_pfn_range_to_zone(struct zone *zone, unsigned long start_pfn, > * ZONE_DEVICE pages in an otherwise ZONE_{NORMAL,MOVABLE} > * section. > */ > - if (zone_idx(zone) == ZONE_DEVICE) { > + if (zone_is_zone_device(zone)) { > if (!IS_ALIGNED(start_pfn, PAGES_PER_SECTION)) > section_taint_zone_device(start_pfn); > if (!IS_ALIGNED(start_pfn + nr_pages, PAGES_PER_SECTION)) > > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb