Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2938591pxv; Mon, 12 Jul 2021 05:42:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsrTryMN0afaLobG/huspDFAnpmPky1qOqzlbOlAneRFAd9w6w3RJb7LAuem5MWUUQPfPQ X-Received: by 2002:a6b:da10:: with SMTP id x16mr26958862iob.48.1626093762220; Mon, 12 Jul 2021 05:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626093762; cv=none; d=google.com; s=arc-20160816; b=cT2eDzjiAvyeia0fFpIMyXd1X60+PkDRbgLs9ABaKQE7E1hO0ICTA8qHhoK40SJcoE dohNLosw/+V9V2g1oO0RU2yHmUBhUisR9YUo2WCnLblJuHr7+AkF2rVuFvTi5hsHT94s AGblvPamrRfbV6Ym3QK1o6N+A7zrq/i/CQAcALnEDjw5xKZ2dLgza9J1Az5eOtc+Y/16 jSZQ0AUpIYqM0vgi4zD5nI+gmQlv2JIE4GP8KBGw0+529MdT/W9yczHZgIFiVdhaj5Ky +Kh8xBv3dVUF62FC2jiiN/ftks0lz3ItY5hXC9lIas+1//ild0I0dFVHgfwZ5pzNWdPk aTtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Iimg+qQSgcqxiRNdP92p/YunXPxELvQ8PHwm9CDHrrU=; b=H9cbEfvMCSs3xnSdWTzQjuhFctql+Telq88/7AGjb0AY/5xkHFSwc35RsMV6QosliM 5y7azQdkPCB1xJ+Q4UHpHSEpI6CaldkDD6H1cHJ2ybzECTFH2E/RoHAEZH0/qNc5F53W 88m9czICALUeHj1SbEcwKYMbhMMmgIrcDqo7t8qxXF9aKKksc/Jcd5cN4SqnAnudS0/r aFdTC58po2xYCGfhH1ZRxmOoBxLdzLAAXxKrZ/GuTORFHiv3azHC9Y0Uf8FjdGwkLu1o ogpu4raV0ET2+5dBdwIvMf5+I5fNRciGagyF+/fGe2Y8eOUbHTbxLI9UCFuld/v9C5Ww jS7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gtBeDxcz; 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 j30si2840099ila.56.2021.07.12.05.42.30; Mon, 12 Jul 2021 05:42:42 -0700 (PDT) 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=gtBeDxcz; 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 S233988AbhGLMog (ORCPT + 99 others); Mon, 12 Jul 2021 08:44:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60281 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230361AbhGLMof (ORCPT ); Mon, 12 Jul 2021 08:44:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626093707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Iimg+qQSgcqxiRNdP92p/YunXPxELvQ8PHwm9CDHrrU=; b=gtBeDxczV/yWqKfjr0cVXNyn0kXIwa5ZjKFqoBHHXVWZhgGRrE5lWDpYpWaBjOgpYT/nik A3MssR1Z14mzDKYuiTD9Ev2H3jMZHo4kr5fOXwR9rMRlSO/+R6q2YmOYzZQxNlruN0Jqmn 3s3p/bKKs+ylEjniNrOuOvp93jiiPVM= 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-509-9K5-8dqLPLuDmHE1nn5TOQ-1; Mon, 12 Jul 2021 08:41:45 -0400 X-MC-Unique: 9K5-8dqLPLuDmHE1nn5TOQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D1FDC100CED4; Mon, 12 Jul 2021 12:41:39 +0000 (UTC) Received: from t480s.redhat.com (ovpn-113-111.rdu2.redhat.com [10.10.113.111]) by smtp.corp.redhat.com (Postfix) with ESMTP id E63A15C232; Mon, 12 Jul 2021 12:41:18 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Vitaly Kuznetsov , "Michael S. Tsirkin" , Jason Wang , Pankaj Gupta , Wei Yang , Oscar Salvador , Michal Hocko , Dan Williams , Anshuman Khandual , Dave Hansen , Vlastimil Babka , Mike Rapoport , "Rafael J. Wysocki" , Len Brown , Pavel Tatashin , Heiko Carstens , Michael Ellerman , Catalin Marinas , virtualization@lists.linux-foundation.org, linux-acpi@vger.kernel.org, Andy Lutomirski , "Aneesh Kumar K.V" , Anton Blanchard , Ard Biesheuvel , Baoquan He , Benjamin Herrenschmidt , Borislav Petkov , Christian Borntraeger , Christophe Leroy , Dave Jiang , "H. Peter Anvin" , Ingo Molnar , Jia He , Joe Perches , Kefeng Wang , Laurent Dufour , Michel Lespinasse , Nathan Lynch , Nicholas Piggin , Paul Mackerras , Peter Zijlstra , Pierre Morel , "Rafael J. Wysocki" , Rich Felker , Scott Cheloha , Sergei Trofimovich , Thiago Jung Bauermann , Thomas Gleixner , Vasily Gorbik , Vishal Verma , Will Deacon , Yoshinori Sato Subject: [PATCH v1 1/4] mm/memory_hotplug: use "unsigned long" for PFN in zone_for_pfn_range() Date: Mon, 12 Jul 2021 14:40:49 +0200 Message-Id: <20210712124052.26491-2-david@redhat.com> In-Reply-To: <20210712124052.26491-1-david@redhat.com> References: <20210712124052.26491-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Checkpatch complained on a follow-up patch that we are using "unsigned" here, which defaults to "unsigned int" and checkpatch is correct. Use "unsigned long" instead, just as we do in other places when handling PFNs. This can bite us once we have physical addresses in the range of multiple TB. Fixes: e5e689302633 ("mm, memory_hotplug: display allowed zones in the preferred ordering") Signed-off-by: David Hildenbrand --- include/linux/memory_hotplug.h | 4 ++-- mm/memory_hotplug.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index a7fd2c3ccb77..d01b504ce06f 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h @@ -339,8 +339,8 @@ extern void sparse_remove_section(struct mem_section *ms, unsigned long map_offset, struct vmem_altmap *altmap); extern struct page *sparse_decode_mem_map(unsigned long coded_mem_map, unsigned long pnum); -extern struct zone *zone_for_pfn_range(int online_type, int nid, unsigned start_pfn, - unsigned long nr_pages); +extern struct zone *zone_for_pfn_range(int online_type, int nid, + unsigned long start_pfn, unsigned long nr_pages); extern int arch_create_linear_mapping(int nid, u64 start, u64 size, struct mhp_params *params); void arch_remove_linear_mapping(u64 start, u64 size); diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 8cb75b26ea4f..93b3abaf9828 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -708,8 +708,8 @@ static inline struct zone *default_zone_for_pfn(int nid, unsigned long start_pfn return movable_node_enabled ? movable_zone : kernel_zone; } -struct zone *zone_for_pfn_range(int online_type, int nid, unsigned start_pfn, - unsigned long nr_pages) +struct zone *zone_for_pfn_range(int online_type, int nid, + unsigned long start_pfn, unsigned long nr_pages) { if (online_type == MMOP_ONLINE_KERNEL) return default_kernel_zone_for_pfn(nid, start_pfn, nr_pages); -- 2.31.1