Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp183611pxb; Wed, 20 Jan 2021 04:35:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJy0OGUsg35vKQ1APFp52D7uS4iuj3CEFhil1QB7MhOlX6RKJ/QN+uqZzBAsmrrjA8gH8foI X-Received: by 2002:aa7:da41:: with SMTP id w1mr7329296eds.24.1611146144088; Wed, 20 Jan 2021 04:35:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611146144; cv=none; d=google.com; s=arc-20160816; b=vTfolkPcEEK5XIjRXcbb0s1Qc5U7Nuv1u6JFR9w+nlgBJor8QjmzW3B5HlX73A+Lbt PLajFUVWCtYOgRezQN5Ds8N7OtsXgFiVJDkgM8wfmQWoF+uh0yE9eugsEPkXAslgGaSO m95LsJKPo2bpD0MNrw4/cXHgX0TDsFawmFz6SW7bqBZNN70yikLc2y4HNinKtmESxsqR Otxz7b8OSp6+NqMMfkLOj8WJucXZ0nnLqUPV5W2lKNi1a77nlTonfnmA3wN7i8Wx9pGI fe5RU6qgk+OxLcBtOy2XXyfsptVDNlFYkuSvg7FbO0W1lNjYUvbIp9QdURV871qI8KeW D/Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=OD2lUZozrmHh/TMRDJwTqK7EFoWr5oPmhv7mmtz2rSE=; b=vdzrW+J+td5z4hJW1Ae6xkinwa+lBMajpugcPRD4fwDIm/5KkTG95cwVnOARgj+Thz Ek9IBFgu5lqf/dPhR2PbZ2ALKuMVR9aWeRMSdRnH60I2P+GB0iGAo8h0Maea89HA+QpJ pWPJ7KvX9nSHTLKp5RMcCslZJOBymoN/l7dYVlduqrLdeMq5Kc0IN1T5vrYNLD58Ls1T Yr2BDYI7BpXA+MbvxPkXLlgtHvO6tRxV1zF0z3y1+fDLlNwGxSG0ZB1Jy4FVENmvG+pX wsyEFz0ITxy1XhMruHuOztoNwH6y6BOck/kjUTHmyrU4ozUArUBPHCqOA4bz4QX5WWo5 kagg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LFnwp5f9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id rl11si662326ejb.33.2021.01.20.04.35.11; Wed, 20 Jan 2021 04:35:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LFnwp5f9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2388641AbhATMRx (ORCPT + 99 others); Wed, 20 Jan 2021 07:17:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:59975 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726439AbhATLvK (ORCPT ); Wed, 20 Jan 2021 06:51:10 -0500 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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