Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp711829pxv; Wed, 14 Jul 2021 13:43:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVTD3GDbzXgwE8MDAuriX3lly3em+vvlF3G6fgFb8Qd1sbcBs3pTUasknYdJeFwpS7FyGi X-Received: by 2002:aa7:cd5a:: with SMTP id v26mr208060edw.287.1626295395186; Wed, 14 Jul 2021 13:43:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626295395; cv=none; d=google.com; s=arc-20160816; b=L6eS0lJieiD5zaL/+qrQL4RtIiEqMPvmYnJWirhpJrxtCpZBUZIQWdDcAOLqYuxruR Rb48HiyWE3MrxySkxTW/8pGqFjptCEoLoW1BM/b+2sUOH1BLSbKyTQzY6t2mW8FymAFT EIIk1GV6DtskA6U8I9QHqtd2de1TAoa/L6Ks+qYy+5CCMHuhVELRTBph1l/pH/MZKbIB OSrrRXiyN+xC8+o3PIbXZJgwBQPnS7eKwmpDzbLztty9irYFPhXn4JEa6Cmnk91NlOeM 1vqV9PC1zNXt7+2nq6wdyAdRBLjOK0/ixrDrz7YBDcQ5+Wh5w259c617LQILt17BSMCV CMvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=dqcSJ3+RdO5AVQF2XIn7OGZkaQyuAY3R+z4rvhGNyD4=; b=DvPcuFrfb4+ADXjf+2AMOJD2OnC+aV8K07nuye/0UeOw/k+kSwsemAPcZ2lZg3QO+c 89NUOnKDRdARGH3EGCdkBE0MIupHrqmIFUAHtCQhkXOrlQbmf+KMEboZf52LD4SL/2V9 aZ5gIGPg412NqBQuhfqBT28AOVqHWsBI1XXJ34wKh2A1RF10oJeUuttqsiuSFq5f7BF9 jNZ5196DqllJ3KW6w448AzPHlHoA93YEyjNiHbNVPxqJoHWmTfbLkYQv3IsWeafnyTpB 9IB0Xdurxl/fOcwbAk5Il5TDw1MhyUm6zQy7T7+89/56RwBXY3n69GB89Oic86bjA/C6 dHtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pQFLoNaG; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r4si3586145edp.476.2021.07.14.13.42.51; Wed, 14 Jul 2021 13:43:15 -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=@gmail.com header.s=20161025 header.b=pQFLoNaG; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230342AbhGNUoi (ORCPT + 99 others); Wed, 14 Jul 2021 16:44:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229772AbhGNUoh (ORCPT ); Wed, 14 Jul 2021 16:44:37 -0400 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5DCAC06175F; Wed, 14 Jul 2021 13:41:44 -0700 (PDT) Received: by mail-il1-x12d.google.com with SMTP id b14so2902615ilf.7; Wed, 14 Jul 2021 13:41:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dqcSJ3+RdO5AVQF2XIn7OGZkaQyuAY3R+z4rvhGNyD4=; b=pQFLoNaGNyjMVOXUkwfQkEuNRkOc+zygrTlctP5bdT4McvO6Ng4hwvedqUBVQUAkqs wPtowxZDjSKq+yFESIb64yRfq5QLOkJeWEJIwxxbS3HGpJ7k+koBAXbYMYBM4k1jYjB3 GsMCfzBHy5/sr6Bxyf84y4zVzXDAWxCKMfxKpzPTMIYJrKlYiWllALzshoMt++Pd+585 TCgf3rf6QwtRbvM6dXmd6Zxq2nkp//FnnHM+Uq26FcXwqLtTy9zJFJbtZxvkgSNaR6YT UaJavclTVfamQ9KqM6AE4kU0FGN1C2933QfUQ2Bxk8kRlOzwMkCpcAFg1MRfozFmTJME q8ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dqcSJ3+RdO5AVQF2XIn7OGZkaQyuAY3R+z4rvhGNyD4=; b=mJ4sHfsovJ14gzRaKSuKRvM2yZnaFcSxqxcWIixOuvK9tr2i3vV4LMIUiTf/4EGHy7 0E+D8P+b8uRkzH+Fccf64xUc/XxxEQcTjqAB7cA1jph01QqKh80ElHBHoOeBC7+aVBzC 2Hr+hdZiq8dy9ipa6sGlJylpWIEaOEPAiNWG203YzdIAM+6uL7Bt1yN3v928hzgB4Tm5 xooFKhSzq7LOFr8yKMIdVlZBQ5X9CYef9O0YqbGppRa9dLDIxMf+ujC9XSxku5zXCxRB Trh1eXdFvpje+xP7RF9/KCzeB0G4Xnbp7lh4VgjHvgqgb/Ea5cH6JVz5H2g5rIn9Xyjz 56xA== X-Gm-Message-State: AOAM532kaiMVV0f4rnQLhubYU3LNYFB44t47yJxWb3viR24iDbIqDZjG zrspp+BfdhIqNovVlIumfDKwyErp0utp34XIhBY= X-Received: by 2002:a92:a005:: with SMTP id e5mr7701226ili.22.1626295304242; Wed, 14 Jul 2021 13:41:44 -0700 (PDT) MIME-Version: 1.0 References: <20210712124052.26491-1-david@redhat.com> <20210712124052.26491-2-david@redhat.com> In-Reply-To: <20210712124052.26491-2-david@redhat.com> From: Pankaj Gupta Date: Wed, 14 Jul 2021 22:41:33 +0200 Message-ID: Subject: Re: [PATCH v1 1/4] mm/memory_hotplug: use "unsigned long" for PFN in zone_for_pfn_range() To: David Hildenbrand Cc: LKML , Linux MM , Andrew Morton , Vitaly Kuznetsov , "Michael S. Tsirkin" , Jason Wang , 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 Content-Type: text/plain; charset="UTF-8" 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); Reviewed-by: Pankaj Gupta