From: kernel test robot <lkp@intel.com>
To: Jonghyeon Kim <tome01@ajou.ac.kr>, dan.j.williams@intel.com
Cc: kbuild-all@lists.01.org, vishal.l.verma@intel.com,
dave.jiang@intel.com, akpm@linux-foundation.org,
nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, Jonghyeon Kim <tome01@ajou.ac.kr>
Subject: Re: [PATCH 2/2] dax/kmem: Update spanned page stat of origin device node
Date: Thu, 27 Jan 2022 08:29:34 +0800 [thread overview]
Message-ID: <202201270836.H8feaOM9-lkp@intel.com> (raw)
In-Reply-To: <20220126170002.19754-2-tome01@ajou.ac.kr>
Hi Jonghyeon,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on hnaz-mm/master]
url: https://github.com/0day-ci/linux/commits/Jonghyeon-Kim/mm-memory_hotplug-Export-shrink-span-functions-for-zone-and-node/20220127-010219
base: https://github.com/hnaz/linux-mm master
config: x86_64-randconfig-a002-20220124 (https://download.01.org/0day-ci/archive/20220127/202201270836.H8feaOM9-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/ef33cc7f7380ddd07a3fedb42f35c1f81de401a4
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jonghyeon-Kim/mm-memory_hotplug-Export-shrink-span-functions-for-zone-and-node/20220127-010219
git checkout ef33cc7f7380ddd07a3fedb42f35c1f81de401a4
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/dax/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/dax/kmem.c: In function 'dev_dax_kmem_probe':
>> drivers/dax/kmem.c:156:42: error: 'ZONE_DEVICE' undeclared (first use in this function)
156 | struct zone *zone = &pgdat->node_zones[ZONE_DEVICE];
| ^~~~~~~~~~~
drivers/dax/kmem.c:156:42: note: each undeclared identifier is reported only once for each function it appears in
vim +/ZONE_DEVICE +156 drivers/dax/kmem.c
44
45 static int dev_dax_kmem_probe(struct dev_dax *dev_dax)
46 {
47 struct device *dev = &dev_dax->dev;
48 unsigned long total_len = 0;
49 struct dax_kmem_data *data;
50 int i, rc, mapped = 0;
51 int numa_node;
52 int dev_node;
53
54 /*
55 * Ensure good NUMA information for the persistent memory.
56 * Without this check, there is a risk that slow memory
57 * could be mixed in a node with faster memory, causing
58 * unavoidable performance issues.
59 */
60 numa_node = dev_dax->target_node;
61 if (numa_node < 0) {
62 dev_warn(dev, "rejecting DAX region with invalid node: %d\n",
63 numa_node);
64 return -EINVAL;
65 }
66
67 for (i = 0; i < dev_dax->nr_range; i++) {
68 struct range range;
69
70 rc = dax_kmem_range(dev_dax, i, &range);
71 if (rc) {
72 dev_info(dev, "mapping%d: %#llx-%#llx too small after alignment\n",
73 i, range.start, range.end);
74 continue;
75 }
76 total_len += range_len(&range);
77 }
78
79 if (!total_len) {
80 dev_warn(dev, "rejecting DAX region without any memory after alignment\n");
81 return -EINVAL;
82 }
83
84 data = kzalloc(struct_size(data, res, dev_dax->nr_range), GFP_KERNEL);
85 if (!data)
86 return -ENOMEM;
87
88 rc = -ENOMEM;
89 data->res_name = kstrdup(dev_name(dev), GFP_KERNEL);
90 if (!data->res_name)
91 goto err_res_name;
92
93 rc = memory_group_register_static(numa_node, total_len);
94 if (rc < 0)
95 goto err_reg_mgid;
96 data->mgid = rc;
97
98 for (i = 0; i < dev_dax->nr_range; i++) {
99 struct resource *res;
100 struct range range;
101
102 rc = dax_kmem_range(dev_dax, i, &range);
103 if (rc)
104 continue;
105
106 /* Region is permanently reserved if hotremove fails. */
107 res = request_mem_region(range.start, range_len(&range), data->res_name);
108 if (!res) {
109 dev_warn(dev, "mapping%d: %#llx-%#llx could not reserve region\n",
110 i, range.start, range.end);
111 /*
112 * Once some memory has been onlined we can't
113 * assume that it can be un-onlined safely.
114 */
115 if (mapped)
116 continue;
117 rc = -EBUSY;
118 goto err_request_mem;
119 }
120 data->res[i] = res;
121
122 /*
123 * Set flags appropriate for System RAM. Leave ..._BUSY clear
124 * so that add_memory() can add a child resource. Do not
125 * inherit flags from the parent since it may set new flags
126 * unknown to us that will break add_memory() below.
127 */
128 res->flags = IORESOURCE_SYSTEM_RAM;
129
130 /*
131 * Ensure that future kexec'd kernels will not treat
132 * this as RAM automatically.
133 */
134 rc = add_memory_driver_managed(data->mgid, range.start,
135 range_len(&range), kmem_name, MHP_NID_IS_MGID);
136
137 if (rc) {
138 dev_warn(dev, "mapping%d: %#llx-%#llx memory add failed\n",
139 i, range.start, range.end);
140 release_resource(res);
141 kfree(res);
142 data->res[i] = NULL;
143 if (mapped)
144 continue;
145 goto err_request_mem;
146 }
147 mapped++;
148 }
149
150 dev_set_drvdata(dev, data);
151
152 /* Update spanned_pages of the device numa node */
153 dev_node = dev_to_node(dev);
154 if (dev_node != numa_node && dev_node < numa_node) {
155 struct pglist_data *pgdat = NODE_DATA(dev_node);
> 156 struct zone *zone = &pgdat->node_zones[ZONE_DEVICE];
157 unsigned long start_pfn = zone->zone_start_pfn;
158 unsigned long nr_pages = NODE_DATA(numa_node)->node_spanned_pages;
159
160 shrink_zone_span(zone, start_pfn, start_pfn + nr_pages);
161 update_pgdat_span(pgdat);
162 }
163
164 return 0;
165
166 err_request_mem:
167 memory_group_unregister(data->mgid);
168 err_reg_mgid:
169 kfree(data->res_name);
170 err_res_name:
171 kfree(data);
172 return rc;
173 }
174
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH 2/2] dax/kmem: Update spanned page stat of origin device node
Date: Thu, 27 Jan 2022 08:29:34 +0800 [thread overview]
Message-ID: <202201270836.H8feaOM9-lkp@intel.com> (raw)
In-Reply-To: <20220126170002.19754-2-tome01@ajou.ac.kr>
[-- Attachment #1: Type: text/plain, Size: 6111 bytes --]
Hi Jonghyeon,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on hnaz-mm/master]
url: https://github.com/0day-ci/linux/commits/Jonghyeon-Kim/mm-memory_hotplug-Export-shrink-span-functions-for-zone-and-node/20220127-010219
base: https://github.com/hnaz/linux-mm master
config: x86_64-randconfig-a002-20220124 (https://download.01.org/0day-ci/archive/20220127/202201270836.H8feaOM9-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/ef33cc7f7380ddd07a3fedb42f35c1f81de401a4
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jonghyeon-Kim/mm-memory_hotplug-Export-shrink-span-functions-for-zone-and-node/20220127-010219
git checkout ef33cc7f7380ddd07a3fedb42f35c1f81de401a4
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/dax/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/dax/kmem.c: In function 'dev_dax_kmem_probe':
>> drivers/dax/kmem.c:156:42: error: 'ZONE_DEVICE' undeclared (first use in this function)
156 | struct zone *zone = &pgdat->node_zones[ZONE_DEVICE];
| ^~~~~~~~~~~
drivers/dax/kmem.c:156:42: note: each undeclared identifier is reported only once for each function it appears in
vim +/ZONE_DEVICE +156 drivers/dax/kmem.c
44
45 static int dev_dax_kmem_probe(struct dev_dax *dev_dax)
46 {
47 struct device *dev = &dev_dax->dev;
48 unsigned long total_len = 0;
49 struct dax_kmem_data *data;
50 int i, rc, mapped = 0;
51 int numa_node;
52 int dev_node;
53
54 /*
55 * Ensure good NUMA information for the persistent memory.
56 * Without this check, there is a risk that slow memory
57 * could be mixed in a node with faster memory, causing
58 * unavoidable performance issues.
59 */
60 numa_node = dev_dax->target_node;
61 if (numa_node < 0) {
62 dev_warn(dev, "rejecting DAX region with invalid node: %d\n",
63 numa_node);
64 return -EINVAL;
65 }
66
67 for (i = 0; i < dev_dax->nr_range; i++) {
68 struct range range;
69
70 rc = dax_kmem_range(dev_dax, i, &range);
71 if (rc) {
72 dev_info(dev, "mapping%d: %#llx-%#llx too small after alignment\n",
73 i, range.start, range.end);
74 continue;
75 }
76 total_len += range_len(&range);
77 }
78
79 if (!total_len) {
80 dev_warn(dev, "rejecting DAX region without any memory after alignment\n");
81 return -EINVAL;
82 }
83
84 data = kzalloc(struct_size(data, res, dev_dax->nr_range), GFP_KERNEL);
85 if (!data)
86 return -ENOMEM;
87
88 rc = -ENOMEM;
89 data->res_name = kstrdup(dev_name(dev), GFP_KERNEL);
90 if (!data->res_name)
91 goto err_res_name;
92
93 rc = memory_group_register_static(numa_node, total_len);
94 if (rc < 0)
95 goto err_reg_mgid;
96 data->mgid = rc;
97
98 for (i = 0; i < dev_dax->nr_range; i++) {
99 struct resource *res;
100 struct range range;
101
102 rc = dax_kmem_range(dev_dax, i, &range);
103 if (rc)
104 continue;
105
106 /* Region is permanently reserved if hotremove fails. */
107 res = request_mem_region(range.start, range_len(&range), data->res_name);
108 if (!res) {
109 dev_warn(dev, "mapping%d: %#llx-%#llx could not reserve region\n",
110 i, range.start, range.end);
111 /*
112 * Once some memory has been onlined we can't
113 * assume that it can be un-onlined safely.
114 */
115 if (mapped)
116 continue;
117 rc = -EBUSY;
118 goto err_request_mem;
119 }
120 data->res[i] = res;
121
122 /*
123 * Set flags appropriate for System RAM. Leave ..._BUSY clear
124 * so that add_memory() can add a child resource. Do not
125 * inherit flags from the parent since it may set new flags
126 * unknown to us that will break add_memory() below.
127 */
128 res->flags = IORESOURCE_SYSTEM_RAM;
129
130 /*
131 * Ensure that future kexec'd kernels will not treat
132 * this as RAM automatically.
133 */
134 rc = add_memory_driver_managed(data->mgid, range.start,
135 range_len(&range), kmem_name, MHP_NID_IS_MGID);
136
137 if (rc) {
138 dev_warn(dev, "mapping%d: %#llx-%#llx memory add failed\n",
139 i, range.start, range.end);
140 release_resource(res);
141 kfree(res);
142 data->res[i] = NULL;
143 if (mapped)
144 continue;
145 goto err_request_mem;
146 }
147 mapped++;
148 }
149
150 dev_set_drvdata(dev, data);
151
152 /* Update spanned_pages of the device numa node */
153 dev_node = dev_to_node(dev);
154 if (dev_node != numa_node && dev_node < numa_node) {
155 struct pglist_data *pgdat = NODE_DATA(dev_node);
> 156 struct zone *zone = &pgdat->node_zones[ZONE_DEVICE];
157 unsigned long start_pfn = zone->zone_start_pfn;
158 unsigned long nr_pages = NODE_DATA(numa_node)->node_spanned_pages;
159
160 shrink_zone_span(zone, start_pfn, start_pfn + nr_pages);
161 update_pgdat_span(pgdat);
162 }
163
164 return 0;
165
166 err_request_mem:
167 memory_group_unregister(data->mgid);
168 err_reg_mgid:
169 kfree(data->res_name);
170 err_res_name:
171 kfree(data);
172 return rc;
173 }
174
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
next prev parent reply other threads:[~2022-01-27 0:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-26 17:00 [PATCH 1/2] mm/memory_hotplug: Export shrink span functions for zone and node Jonghyeon Kim
2022-01-26 17:00 ` [PATCH 2/2] dax/kmem: Update spanned page stat of origin device node Jonghyeon Kim
2022-01-27 0:29 ` kernel test robot [this message]
2022-01-27 0:29 ` kernel test robot
2022-01-27 5:29 ` kernel test robot
2022-01-27 5:29 ` kernel test robot
2022-01-26 17:04 ` [PATCH 1/2] mm/memory_hotplug: Export shrink span functions for zone and node David Hildenbrand
2022-01-27 9:41 ` Jonghyeon Kim
2022-01-27 9:54 ` David Hildenbrand
2022-01-28 4:19 ` Jonghyeon Kim
2022-01-28 8:10 ` David Hildenbrand
2022-02-03 2:22 ` Jonghyeon Kim
2022-02-03 8:19 ` David Hildenbrand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202201270836.H8feaOM9-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nvdimm@lists.linux.dev \
--cc=tome01@ajou.ac.kr \
--cc=vishal.l.verma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.