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=-16.1 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,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 AA411C433EF for ; Fri, 17 Sep 2021 12:17:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 745DE61041 for ; Fri, 17 Sep 2021 12:17:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236384AbhIQMTE (ORCPT ); Fri, 17 Sep 2021 08:19:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:53014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230031AbhIQMTE (ORCPT ); Fri, 17 Sep 2021 08:19:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D2B1660F9C; Fri, 17 Sep 2021 12:17:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631881062; bh=fv8H9hS4ToB7OovAJem7g/i6KTXih4K64jSGFxkHiBY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BLPiHZrm7pdK+xX8QCNJKxCkgJCg5DF5Ng/wUue96tErLXwq6obgqiVJPpxEo72MR 7JfE6W9mS7V9/ZLtE3z1sx8h0fsorcgbOgIhkTv8qXoEd+AGbCczgonCUwSHxylMBf y/3zFszpOwTAtq7fm7EU/FwGj0sVQe/vhtpaNrrg= Date: Fri, 17 Sep 2021 14:17:38 +0200 From: Greg KH To: David Hildenbrand Cc: akpm@linux-foundation.org, aneesh.kumar@linux.ibm.com, anshuman.khandual@arm.com, anton@ozlabs.org, ardb@kernel.org, bauerman@linux.ibm.com, benh@kernel.crashing.org, bhe@redhat.com, borntraeger@de.ibm.com, bp@alien8.de, catalin.marinas@arm.com, cheloha@linux.ibm.com, christophe.leroy@c-s.fr, dalias@libc.org, dan.j.williams@intel.com, dave.hansen@linux.intel.com, dave.jiang@intel.com, gor@linux.ibm.com, hca@linux.ibm.com, hpa@zytor.com, jasowang@redhat.com, joe@perches.com, justin.he@arm.com, ldufour@linux.ibm.com, lenb@kernel.org, luto@kernel.org, mhocko@kernel.org, michel@lespinasse.org, mingo@redhat.com, mpe@ellerman.id.au, mst@redhat.com, nathanl@linux.ibm.com, npiggin@gmail.com, osalvador@suse.de, pankaj.gupta.linux@gmail.com, pankaj.gupta@ionos.com, pasha.tatashin@soleen.com, paulus@samba.org, peterz@infradead.org, pmorel@linux.ibm.com, rafael.j.wysocki@intel.com, richard.weiyang@linux.alibaba.com, rjw@rjwysocki.net, rppt@kernel.org, slyfox@gentoo.org, songmuchun@bytedance.com, stable@vger.kernel.org, torvalds@linux-foundation.org, vbabka@suse.cz, vishal.l.verma@intel.com, vkuznets@redhat.com, wangkefeng.wang@huawei.com, will@kernel.org, ysato@users.sourceforge.jp Subject: Re: FAILED: patch "[PATCH] mm/memory_hotplug: use "unsigned long" for PFN in" failed to apply to 4.14-stable tree Message-ID: References: <1631796969176240@kroah.com> <5873f775-a9a8-7d8e-f8a6-a314ad14a6ef@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5873f775-a9a8-7d8e-f8a6-a314ad14a6ef@redhat.com> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Fri, Sep 17, 2021 at 02:06:16PM +0200, David Hildenbrand wrote: > On 16.09.21 14:56, gregkh@linuxfoundation.org wrote: > > > > The patch below does not apply to the 4.14-stable tree. > > If someone wants it applied there, or to any other stable or longterm > > tree, then please email the backport, including the original git commit > > id to . > > > > thanks, > > > > greg k-h > > > > ------------------ original commit in Linus's tree ------------------ > > > > From 7cf209ba8a86410939a24cb1aeb279479a7e0ca6 Mon Sep 17 00:00:00 2001 > > From: David Hildenbrand > > Date: Tue, 7 Sep 2021 19:54:59 -0700 > > Subject: [PATCH] mm/memory_hotplug: use "unsigned long" for PFN in > > zone_for_pfn_range() > > > > Patch series "mm/memory_hotplug: preparatory patches for new online policy and memory" > > > > These are all cleanups and one fix previously sent as part of [1]: > > [PATCH v1 00/12] mm/memory_hotplug: "auto-movable" online policy and memory > > groups. > > > > These patches make sense even without the other series, therefore I pulled > > them out to make the other series easier to digest. > > > > [1] https://lkml.kernel.org/r/20210607195430.48228-1-david@redhat.com > > > > This patch (of 4): > > > > Checkpatch complained on a follow-up patch that we are using "unsigned" > > here, which defaults to "unsigned int" and checkpatch is correct. > > > > As we will search for a fitting zone using the wrong pfn, we might end > > up onlining memory to one of the special kernel zones, such as ZONE_DMA, > > which can end badly as the onlined memory does not satisfy properties of > > these zones. > > > > 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. > > > > Link: https://lkml.kernel.org/r/20210712124052.26491-2-david@redhat.com > > Fixes: e5e689302633 ("mm, memory_hotplug: display allowed zones in the preferred ordering") > > Signed-off-by: David Hildenbrand > > Reviewed-by: Pankaj Gupta > > Reviewed-by: Muchun Song > > Reviewed-by: Oscar Salvador > > Cc: David Hildenbrand > > Cc: Vitaly Kuznetsov > > Cc: "Michael S. Tsirkin" > > Cc: Jason Wang > > Cc: Pankaj Gupta > > Cc: Wei Yang > > Cc: Michal Hocko > > Cc: Dan Williams > > Cc: Anshuman Khandual > > Cc: Dave Hansen > > Cc: Vlastimil Babka > > Cc: Mike Rapoport > > Cc: "Rafael J. Wysocki" > > Cc: Len Brown > > Cc: Pavel Tatashin > > Cc: Heiko Carstens > > Cc: Michael Ellerman > > Cc: Catalin Marinas > > Cc: virtualization@lists.linux-foundation.org > > Cc: Andy Lutomirski > > Cc: "Aneesh Kumar K.V" > > Cc: Anton Blanchard > > Cc: Ard Biesheuvel > > Cc: Baoquan He > > Cc: Benjamin Herrenschmidt > > Cc: Borislav Petkov > > Cc: Christian Borntraeger > > Cc: Christophe Leroy > > Cc: Dave Jiang > > Cc: "H. Peter Anvin" > > Cc: Ingo Molnar > > Cc: Jia He > > Cc: Joe Perches > > Cc: Kefeng Wang > > Cc: Laurent Dufour > > Cc: Michel Lespinasse > > Cc: Nathan Lynch > > Cc: Nicholas Piggin > > Cc: Paul Mackerras > > Cc: Peter Zijlstra > > Cc: Pierre Morel > > Cc: "Rafael J. Wysocki" > > Cc: Rich Felker > > Cc: Scott Cheloha > > Cc: Sergei Trofimovich > > Cc: Thiago Jung Bauermann > > Cc: Thomas Gleixner > > Cc: Vasily Gorbik > > Cc: Vishal Verma > > Cc: Will Deacon > > Cc: Yoshinori Sato > > Cc: > > Signed-off-by: Andrew Morton > > Signed-off-by: Linus Torvalds > > > > 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 f829805fe1ca..fa349acb8810 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); > > > > AFAIKS, there are only contextual differences and they are pretty easy to > sort out. @Greg, I can send a backport if it helps. Please do, thanks!