Hi Pingfan, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.19-rc4 next-20180918] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Pingfan-Liu/introduce-a-new-state-isolate-for-memblock-to-split-the-isolation-and-migration-steps/20180919-112650 config: x86_64-randconfig-s0-09191204 (attached as .config) compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): drivers/base/memory.o: In function `store_mem_state': >> drivers/base/memory.c:385: undefined reference to `start_isolate_page_range' >> drivers/base/memory.c:391: undefined reference to `undo_isolate_page_range' vim +385 drivers/base/memory.c 323 324 static ssize_t 325 store_mem_state(struct device *dev, 326 struct device_attribute *attr, const char *buf, size_t count) 327 { 328 struct memory_block *mem = to_memory_block(dev); 329 int ret, online_type; 330 int isolated = 0; 331 unsigned long start_pfn; 332 unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block; 333 334 ret = lock_device_hotplug_sysfs(); 335 if (ret) 336 return ret; 337 338 if (sysfs_streq(buf, "online_kernel")) 339 online_type = MMOP_ONLINE_KERNEL; 340 else if (sysfs_streq(buf, "online_movable")) 341 online_type = MMOP_ONLINE_MOVABLE; 342 else if (sysfs_streq(buf, "online")) 343 online_type = MMOP_ONLINE_KEEP; 344 else if (sysfs_streq(buf, "offline")) 345 online_type = MMOP_OFFLINE; 346 else if (sysfs_streq(buf, "isolate")) { 347 isolated = 1; 348 goto memblock_isolated; 349 } else if (sysfs_streq(buf, "unisolate")) { 350 isolated = -1; 351 goto memblock_isolated; 352 } else { 353 ret = -EINVAL; 354 goto err; 355 } 356 357 /* 358 * Memory hotplug needs to hold mem_hotplug_begin() for probe to find 359 * the correct memory block to online before doing device_online(dev), 360 * which will take dev->mutex. Take the lock early to prevent an 361 * inversion, memory_subsys_online() callbacks will be implemented by 362 * assuming it's already protected. 363 */ 364 mem_hotplug_begin(); 365 366 switch (online_type) { 367 case MMOP_ONLINE_KERNEL: 368 case MMOP_ONLINE_MOVABLE: 369 case MMOP_ONLINE_KEEP: 370 mem->online_type = online_type; 371 ret = device_online(&mem->dev); 372 break; 373 case MMOP_OFFLINE: 374 ret = device_offline(&mem->dev); 375 break; 376 default: 377 ret = -EINVAL; /* should never happen */ 378 } 379 380 mem_hotplug_done(); 381 err: 382 memblock_isolated: 383 if (isolated == 1 && mem->state == MEM_ONLINE) { 384 start_pfn = section_nr_to_pfn(mem->start_section_nr); > 385 ret = start_isolate_page_range(start_pfn, start_pfn + nr_pages, 386 MIGRATE_MOVABLE, true, true); 387 if (!ret) 388 mem->state = MEM_ISOLATED; 389 } else if (isolated == -1 && mem->state == MEM_ISOLATED) { 390 start_pfn = section_nr_to_pfn(mem->start_section_nr); > 391 ret = undo_isolate_page_range(start_pfn, start_pfn + nr_pages, 392 MIGRATE_MOVABLE, true); 393 if (!ret) 394 mem->state = MEM_ONLINE; 395 } 396 unlock_device_hotplug(); 397 398 if (ret < 0) 399 return ret; 400 if (ret) 401 return -EINVAL; 402 403 return count; 404 } 405 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip