Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2219960/?format=api
{ "id": 2219960, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2219960/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260405125240.2558577-36-songmuchun@bytedance.com/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/1.2/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<20260405125240.2558577-36-songmuchun@bytedance.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20260405125240.2558577-36-songmuchun@bytedance.com/", "date": "2026-04-05T12:52:26", "name": "[35/49] mm/sparse-vmemmap: introduce section zone to struct mem_section", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "2370838ee820cd002b505714efeac79bf0405ced", "submitter": { "id": 78930, "url": "http://patchwork.ozlabs.org/api/1.2/people/78930/?format=api", "name": "Muchun Song", "email": "songmuchun@bytedance.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260405125240.2558577-36-songmuchun@bytedance.com/mbox/", "series": [ { "id": 498783, "url": "http://patchwork.ozlabs.org/api/1.2/series/498783/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=498783", "date": "2026-04-05T12:51:51", "name": "mm: Generalize vmemmap optimization for DAX and HugeTLB", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498783/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2219960/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2219960/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linuxppc-dev+bounces-19365-incoming=patchwork.ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=bytedance.com header.i=@bytedance.com\n header.a=rsa-sha256 header.s=google header.b=Iduxrj5H;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:21b9:f100::1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-19365-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)", "lists.ozlabs.org;\n arc=none smtp.remote-ip=\"2607:f8b0:4864:20::1036\"", "lists.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=bytedance.com", "lists.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=bytedance.com header.i=@bytedance.com\n header.a=rsa-sha256 header.s=google header.b=Iduxrj5H;\n\tdkim-atps=neutral", "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=bytedance.com\n (client-ip=2607:f8b0:4864:20::1036; helo=mail-pj1-x1036.google.com;\n envelope-from=songmuchun@bytedance.com; receiver=lists.ozlabs.org)" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:21b9:f100::1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fpXYP0DnYz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 05 Apr 2026 22:57:29 +1000 (AEST)", "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4fpXY50GXZz3f12;\n\tSun, 05 Apr 2026 22:57:13 +1000 (AEST)", "from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com\n [IPv6:2607:f8b0:4864:20::1036])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4fpXY40NZwz2yvW\n\tfor <linuxppc-dev@lists.ozlabs.org>; Sun, 05 Apr 2026 22:57:11 +1000 (AEST)", "by mail-pj1-x1036.google.com with SMTP id\n 98e67ed59e1d1-35d965648a2so2429796a91.0\n for <linuxppc-dev@lists.ozlabs.org>;\n Sun, 05 Apr 2026 05:57:11 -0700 (PDT)", "from n232-176-004.byted.org ([36.110.163.97])\n by smtp.gmail.com with ESMTPSA id\n 98e67ed59e1d1-35de66b4808sm3748505a91.2.2026.04.05.05.57.04\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 05 Apr 2026 05:57:09 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1775393832;\n\tcv=none;\n b=ShReN/H+9iD5qcrVMZLd212ZMoS3G+rc4/ZcxIzZjjBxRMEOVoJATJSDvkq4iq2IvQ+ICoJqYG6WPAGsvEn1MKhzDc8VIbrKoq0y8vsEb5SlH6AH2q4zX4lhnVS7vHKXLpmP0WYvm2lSMBGBK2e7VDqpWkPATi9WYz+Bbdu4Vgl1UukMyNYnyQnPz+N9TDvFG5sN4MAbKDJv44IXODncx30ay9tgBol353si5XKutK5F9f1MI7OXFARASYhVUwU7BA9BykdFJQkpiZBn3vMrmAtpuYLpD65HIP/1qOYkbp4WVki+aSOHrdol4r1i5BGAEJYJAoHeint8gl4XO/oi5A==", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1775393832; c=relaxed/relaxed;\n\tbh=wYLFkhjHZeMhg1MIWamwRyHzBSmpgXxo2vlP0IB+Kzg=;\n\th=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:\n\t MIME-Version;\n b=S8uEx794eJwA0VquwtKSWGypCqalo6vnIbdDEdlUNZ+enMyPNW4DMIXmXM72x01z5EUXpaSslGsvcZtzHQHDN1FU6/lF97gn5RdDYYNcNCmvBs8zsqXib9hT11uw9+AQE/L2znU+XxJuVDtMoBtVDdz8idl1gtnx6+VphkadhrKddlAOp6H8cbATxH57vLqEs0c/xLakM1B29+0rMC+T7hKa+dkez2GWpVSJI1klw2W+fk4miKyjdkkEr1mKYoxxH4p5yxU5KclOaH5xg36gzoIqp73KomAM0aFYnfVQGzlkeElfQDh45i72+utV2ZHKFFzOki9JLNQQDfXwYIqbgQ==", "ARC-Authentication-Results": "i=1; lists.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=bytedance.com;\n dkim=pass (2048-bit key;\n unprotected) header.d=bytedance.com header.i=@bytedance.com\n header.a=rsa-sha256 header.s=google header.b=Iduxrj5H; dkim-atps=neutral;\n spf=pass (client-ip=2607:f8b0:4864:20::1036; helo=mail-pj1-x1036.google.com;\n envelope-from=songmuchun@bytedance.com;\n receiver=lists.ozlabs.org) smtp.mailfrom=bytedance.com", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=bytedance.com; s=google; t=1775393830; x=1775998630;\n darn=lists.ozlabs.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=wYLFkhjHZeMhg1MIWamwRyHzBSmpgXxo2vlP0IB+Kzg=;\n b=Iduxrj5H7MwarRLQbAri7ePLBu9NMED67k/KoYwK+InmAb/63nraJtGaSUq60EtU0I\n J2fXPAMGL23cuMTAWqWNn+U1QZYH54H98sq/PxwHGpsxcS9p9YM+8AqHFokFwveyY75e\n fUWmDhjkMDEzmpJfKzAAmh6y7PKZ3hWdr3eMi1rfkx3TuAxX9eA/hMGOLvMF/5i8fpi+\n wLrO447mTgH9EPZnChR7RPJSMScZg5MtnWvePSoH8/a6niq8u0rkpC+37mesZ6bUZyHf\n 0iU06OeVvfv5rdnPnqErL6hKydXdDb1AgTzdcSRQw+SbOiKGbSddYq+Dar3GbihZ3z4H\n SbQg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775393830; x=1775998630;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=wYLFkhjHZeMhg1MIWamwRyHzBSmpgXxo2vlP0IB+Kzg=;\n b=ZjlMFudttQjmMY4Np2N3zhQyG3h6DdSZAFa7RqEsAIp8prGTCYbs4CwNxqVPBBLZl7\n +D2xp/i5jduX/A1Sh0Q23VvE6+DvGjCxugoWcU+D9sK5uLzhApZ7HiwIiAbSm3hcGJQO\n NKzrwI/Amu+Ge0bUqWyNTR7IcTKUllnDEez0X0v5OxFHNdueKmhLbuKArjcI767HvT1W\n UtdsTDWxAKDwSuQmS2R5Za4nSdYf21NDPdMJNOSg4WgtE1e5KrwsBLU7cpgiyyqHzz8i\n RI9zPCudTYpXpyrpu1UKIHglnA6G8VgiSaKGgWUS7u9E8/aHof4a8bEqmSLum3vUhzQB\n JtoA==", "X-Forwarded-Encrypted": "i=1;\n AJvYcCXjK7Nk1yWwn7B8YcA9/eLGHKsElHPyIFOKxqqa/0WhmG1PnvT6l9BwsEDWpm+2tvR5luoPzq56kYCh4J4=@lists.ozlabs.org", "X-Gm-Message-State": "AOJu0YxkWQQrrNW0+BwACTKkLZmMqSlQ0DIHCsQ+7OLbawdOTwZcgsiU\n\t0OXoGL3JsZfkz8lQEYHJA1wOitBYRCZnwaaqjt0LKq0cKq3W7XC8k50RSQk5OYVk1Y8=", "X-Gm-Gg": "AeBDietYTx1VsLQNSjYN4GGd4U7co2C9NMKrqXUUJNtkVLjN8dOlzMMUSXcztDrQnS2\n\tt0iT/fPD5UQcUjflntrp4gxH5nY3SZEgODEp76b0D72Dz8/utq768biXGRktXRn+GvSPKTclG/x\n\t6gDi6pt+ZUQH7zNNDYQkJIzvotujpOpX5gRy5uZb73uk/7rahCvuLP7Cf12Jr53IwbyBSLRVo5z\n\teZ4wMZLrXhtaBrgsT6BLNJebjSxdnVFh7Lix3TtcJeANmxCjIk0CXfFzv45sHzNbftHMQaDRl5H\n\tJswBRbAHqx+kbilwAqsEv3OXP9+kRzV6AyweXmMD45CU4K2/HAdNL7rL2xR3dbxCO1tAb01Hm+D\n\tps58c4QzCrVh7PoYqqAw2hS6B8rDVj32oHjdzK0XWZ8qDz7tYJLe4nskmwPiBSUzpPNqpJJhTxa\n\tme8u1Fo2syGeZ7QGtAJNOiAsv0CuasFuVUYmEpP6VBPz4=", "X-Received": "by 2002:a17:90a:d005:b0:35d:9d28:e897 with SMTP id\n 98e67ed59e1d1-35de699f483mr8495535a91.28.1775393830042;\n Sun, 05 Apr 2026 05:57:10 -0700 (PDT)", "From": "Muchun Song <songmuchun@bytedance.com>", "To": "Andrew Morton <akpm@linux-foundation.org>,\n\tDavid Hildenbrand <david@kernel.org>,\n\tMuchun Song <muchun.song@linux.dev>,\n\tOscar Salvador <osalvador@suse.de>,\n\tMichael Ellerman <mpe@ellerman.id.au>,\n\tMadhavan Srinivasan <maddy@linux.ibm.com>", "Cc": "Lorenzo Stoakes <ljs@kernel.org>,\n\t\"Liam R . Howlett\" <Liam.Howlett@oracle.com>,\n\tVlastimil Babka <vbabka@kernel.org>,\n\tMike Rapoport <rppt@kernel.org>,\n\tSuren Baghdasaryan <surenb@google.com>,\n\tMichal Hocko <mhocko@suse.com>,\n\tNicholas Piggin <npiggin@gmail.com>,\n\tChristophe Leroy <chleroy@kernel.org>,\n\taneesh.kumar@linux.ibm.com,\n\tjoao.m.martins@oracle.com,\n\tlinux-mm@kvack.org,\n\tlinuxppc-dev@lists.ozlabs.org,\n\tlinux-kernel@vger.kernel.org,\n\tMuchun Song <songmuchun@bytedance.com>", "Subject": "[PATCH 35/49] mm/sparse-vmemmap: introduce section zone to struct\n mem_section", "Date": "Sun, 5 Apr 2026 20:52:26 +0800", "Message-Id": "<20260405125240.2558577-36-songmuchun@bytedance.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20260405125240.2558577-1-songmuchun@bytedance.com>", "References": "<20260405125240.2558577-1-songmuchun@bytedance.com>", "X-Mailing-List": "linuxppc-dev@lists.ozlabs.org", "List-Id": "<linuxppc-dev.lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev+help@lists.ozlabs.org>", "List-Owner": "<mailto:linuxppc-dev+owner@lists.ozlabs.org>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Archive": "<https://lore.kernel.org/linuxppc-dev/>,\n <https://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Subscribe": "<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>", "List-Unsubscribe": "<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>", "Precedence": "list", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Spam-Status": "No, score=-0.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,\n\tDKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS\n\tautolearn=disabled version=4.0.1 OzLabs 8", "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org" }, "content": "Currently, HugeTLB obtains zone information for vmemmap optimization\nthrough early pfn_to_zone(). However, ZONE_DEVICE cannot utilize this\napproach because its zone information is updated after vmemmap population.\n\nTo pave the way for unifying DAX and HugeTLB vmemmap optimization,\nthis patch introduces the 'zone' member to struct mem_section. This\nallows both DAX and HugeTLB to reliably obtain zone information\ndirectly from the memory section.\n\nSigned-off-by: Muchun Song <songmuchun@bytedance.com>\n---\n include/linux/mmzone.h | 31 +++++++++++++++++++++++++++----\n mm/hugetlb.c | 2 +-\n mm/hugetlb_vmemmap.c | 4 +++-\n mm/sparse-vmemmap.c | 19 +++++++++++++------\n 4 files changed, 44 insertions(+), 12 deletions(-)", "diff": "diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h\nindex 6edcb0cc46c4..846a7ee1334f 100644\n--- a/include/linux/mmzone.h\n+++ b/include/linux/mmzone.h\n@@ -2022,6 +2022,7 @@ struct mem_section {\n \t * multiple sections.\n \t */\n \tunsigned int order;\n+\tenum zone_type zone;\n #endif\n };\n \n@@ -2214,32 +2215,54 @@ static inline void section_set_order(struct mem_section *section, unsigned int o\n \tsection->order = order;\n }\n \n+static inline void section_set_zone(struct mem_section *section, enum zone_type zone)\n+{\n+\tsection->zone = zone;\n+}\n+\n static inline unsigned int section_order(const struct mem_section *section)\n {\n \treturn section->order;\n }\n+\n+static inline enum zone_type section_zone(const struct mem_section *section)\n+{\n+\treturn section->zone;\n+}\n #else\n static inline void section_set_order(struct mem_section *section, unsigned int order)\n {\n }\n \n+static inline void section_set_zone(struct mem_section *section, enum zone_type zone)\n+{\n+}\n+\n static inline unsigned int section_order(const struct mem_section *section)\n {\n \treturn 0;\n }\n+\n+static inline enum zone_type section_zone(const struct mem_section *section)\n+{\n+\treturn 0;\n+}\n #endif\n \n-static inline void section_set_order_pfn_range(unsigned long pfn,\n-\t\t\t\t\t unsigned long nr_pages,\n-\t\t\t\t\t unsigned int order)\n+static inline void section_set_compound_range(unsigned long pfn,\n+\t\t\t\t\t unsigned long nr_pages,\n+\t\t\t\t\t unsigned int order,\n+\t\t\t\t\t enum zone_type zone)\n {\n \tunsigned long section_nr = pfn_to_section_nr(pfn);\n \n \tif (!IS_ALIGNED(pfn | nr_pages, PAGES_PER_SECTION))\n \t\treturn;\n \n-\tfor (int i = 0; i < nr_pages / PAGES_PER_SECTION; i++)\n+\tfor (int i = 0; i < nr_pages / PAGES_PER_SECTION; i++) {\n \t\tsection_set_order(__nr_to_section(section_nr + i), order);\n+\t\tsection_set_zone(__nr_to_section(section_nr + i), zone);\n+\t}\n }\n \n static inline bool section_vmemmap_optimizable(const struct mem_section *section)\ndiff --git a/mm/hugetlb.c b/mm/hugetlb.c\nindex 59728e942384..ce5a58aab5c3 100644\n--- a/mm/hugetlb.c\n+++ b/mm/hugetlb.c\n@@ -3281,7 +3281,7 @@ static void __init gather_bootmem_prealloc_node(unsigned long nid)\n \n \t\tif (section_vmemmap_optimizable(__pfn_to_section(folio_pfn(folio))))\n \t\t\tfolio_set_hugetlb_vmemmap_optimized(folio);\n-\t\tsection_set_order_pfn_range(folio_pfn(folio), folio_nr_pages(folio), 0);\n+\t\tsection_set_compound_range(folio_pfn(folio), folio_nr_pages(folio), 0, 0);\n \n \t\tif (hugetlb_bootmem_page_earlycma(m))\n \t\t\tfolio_set_hugetlb_cma(folio);\ndiff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c\nindex a7ea98fcc18e..92c95ebdbb9a 100644\n--- a/mm/hugetlb_vmemmap.c\n+++ b/mm/hugetlb_vmemmap.c\n@@ -681,11 +681,13 @@ void __init hugetlb_vmemmap_optimize_bootmem_page(struct huge_bootmem_page *m)\n {\n \tstruct hstate *h = m->hstate;\n \tunsigned long pfn = PHYS_PFN(virt_to_phys(m));\n+\tint nid = early_pfn_to_nid(PHYS_PFN(__pa(m)));\n \n \tif (!READ_ONCE(vmemmap_optimize_enabled))\n \t\treturn;\n \n-\tsection_set_order_pfn_range(pfn, pages_per_huge_page(h), huge_page_order(h));\n+\tsection_set_compound_range(pfn, pages_per_huge_page(h), huge_page_order(h),\n+\t\t\t\t zone_idx(pfn_to_zone(pfn, nid)));\n }\n \n static const struct ctl_table hugetlb_vmemmap_sysctls[] = {\ndiff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c\nindex 6f959a999d5b..1867b5dcc73c 100644\n--- a/mm/sparse-vmemmap.c\n+++ b/mm/sparse-vmemmap.c\n@@ -143,6 +143,11 @@ void __meminit vmemmap_verify(pte_t *pte, int node,\n \t\t\tstart, end - 1);\n }\n \n+static inline struct zone *section_to_zone(const struct mem_section *ms, int nid)\n+{\n+\treturn &NODE_DATA(nid)->node_zones[section_zone(ms)];\n+}\n+\n static pte_t * __meminit vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node,\n \t\t\t\t\t struct vmem_altmap *altmap,\n \t\t\t\t\t unsigned long ptpfn)\n@@ -159,7 +164,7 @@ static pte_t * __meminit vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, in\n \t\t\tconst struct mem_section *ms = __pfn_to_section(pfn);\n \n \t\t\tpage = vmemmap_shared_tail_page(section_order(ms),\n-\t\t\t\t\t\t\tpfn_to_zone(pfn, node));\n+\t\t\t\t\t\t\tsection_to_zone(ms, node));\n \t\t\tif (!page)\n \t\t\t\treturn NULL;\n \t\t\tptpfn = page_to_pfn(page);\n@@ -471,16 +476,14 @@ static int __meminit vmemmap_populate_compound_pages(unsigned long start,\n \tint rc;\n \tunsigned long start_pfn = page_to_pfn((struct page *)start);\n \tconst struct mem_section *ms = __pfn_to_section(start_pfn);\n-\tstruct page *tail = NULL;\n+\tstruct page *tail;\n \n \t/* This may occur in sub-section scenarios. */\n \tif (!section_vmemmap_optimizable(ms))\n \t\treturn vmemmap_populate_range(start, end, node, NULL, -1);\n \n-#ifdef CONFIG_ZONE_DEVICE\n \ttail = vmemmap_shared_tail_page(section_order(ms),\n-\t\t\t\t\t&NODE_DATA(node)->node_zones[ZONE_DEVICE]);\n-#endif\n+\t\t\t\t\tsection_to_zone(ms, node));\n \tif (!tail)\n \t\treturn -ENOMEM;\n \n@@ -834,8 +837,12 @@ int __meminit sparse_add_section(int nid, unsigned long start_pfn,\n \t\treturn ret;\n \n \tms = __nr_to_section(section_nr);\n-\tif (vmemmap_can_optimize(altmap, pgmap) && nr_pages == PAGES_PER_SECTION)\n+\tif (vmemmap_can_optimize(altmap, pgmap) && nr_pages == PAGES_PER_SECTION) {\n \t\tsection_set_order(ms, pgmap->vmemmap_shift);\n+#ifdef CONFIG_ZONE_DEVICE\n+\t\tsection_set_zone(ms, ZONE_DEVICE);\n+#endif\n+\t}\n \tmemmap = section_activate(nid, start_pfn, nr_pages, altmap, pgmap);\n \tif (IS_ERR(memmap))\n \t\treturn PTR_ERR(memmap);\n", "prefixes": [ "35/49" ] }