Hi Nhat, Thank you for the patch! Yet something to improve: [auto build test ERROR on akpm-mm/mm-everything] [also build test ERROR on linus/master v6.1-rc2 next-20221027] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Nhat-Pham/Implement-writeback-for-zsmalloc/20221027-040711 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20221026200613.1031261-6-nphamcs%40gmail.com patch subject: [PATCH 5/5] zsmalloc: Implement writeback mechanism for zsmalloc config: csky-randconfig-r035-20221026 compiler: csky-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/2a23b8adb2a4ca453bb39a7991c93a803899c102 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Nhat-Pham/Implement-writeback-for-zsmalloc/20221027-040711 git checkout 2a23b8adb2a4ca453bb39a7991c93a803899c102 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=csky SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All errors (new ones prefixed by >>): mm/zsmalloc.c: In function 'zs_reclaim_page': >> mm/zsmalloc.c:2462:18: error: 'struct zs_pool' has no member named 'ops' 2462 | if (!pool->ops || !pool->ops->evict || list_empty(&pool->lru) || | ^~ mm/zsmalloc.c:2462:32: error: 'struct zs_pool' has no member named 'ops' 2462 | if (!pool->ops || !pool->ops->evict || list_empty(&pool->lru) || | ^~ mm/zsmalloc.c:2511:35: error: 'struct zs_pool' has no member named 'ops' 2511 | ret = pool->ops->evict(pool, handle); | ^~ mm/zsmalloc.c: At top level: mm/zsmalloc.c:2452:12: warning: 'zs_reclaim_page' defined but not used [-Wunused-function] 2452 | static int zs_reclaim_page(struct zs_pool *pool, unsigned int retries) | ^~~~~~~~~~~~~~~ vim +2462 mm/zsmalloc.c 2451 2452 static int zs_reclaim_page(struct zs_pool *pool, unsigned int retries) 2453 { 2454 int i, obj_idx, ret = 0; 2455 unsigned long handle; 2456 struct zspage *zspage; 2457 struct page *page; 2458 enum fullness_group fullness; 2459 2460 /* Lock LRU and fullness list */ 2461 spin_lock(&pool->lock); > 2462 if (!pool->ops || !pool->ops->evict || list_empty(&pool->lru) || 2463 retries == 0) { 2464 spin_unlock(&pool->lock); 2465 return -EINVAL; 2466 } 2467 2468 for (i = 0; i < retries; i++) { 2469 struct size_class *class; 2470 2471 zspage = list_last_entry(&pool->lru, struct zspage, lru); 2472 list_del(&zspage->lru); 2473 2474 /* zs_free may free objects, but not the zspage and handles */ 2475 zspage->under_reclaim = true; 2476 2477 /* Lock backing pages into place */ 2478 lock_zspage(zspage); 2479 2480 class = zspage_class(pool, zspage); 2481 fullness = get_fullness_group(class, zspage); 2482 2483 /* Lock out object allocations and object compaction */ 2484 remove_zspage(class, zspage, fullness); 2485 2486 spin_unlock(&pool->lock); 2487 2488 obj_idx = 0; 2489 page = zspage->first_page; 2490 while (1) { 2491 handle = find_alloced_obj(class, page, &obj_idx); 2492 if (!handle) { 2493 page = get_next_page(page); 2494 if (!page) 2495 break; 2496 obj_idx = 0; 2497 continue; 2498 } 2499 2500 /* 2501 * This will write the object and call 2502 * zs_free. 2503 * 2504 * zs_free will free the object, but the 2505 * under_reclaim flag prevents it from freeing 2506 * the zspage altogether. This is necessary so 2507 * that we can continue working with the 2508 * zspage potentially after the last object 2509 * has been freed. 2510 */ 2511 ret = pool->ops->evict(pool, handle); 2512 if (ret) 2513 goto next; 2514 2515 obj_idx++; 2516 } 2517 2518 next: 2519 /* For freeing the zspage, or putting it back in the pool and LRU list. */ 2520 spin_lock(&pool->lock); 2521 zspage->under_reclaim = false; 2522 2523 if (!get_zspage_inuse(zspage)) { 2524 /* 2525 * Fullness went stale as zs_free() won't touch it 2526 * while the page is removed from the pool. Fix it 2527 * up for the check in __free_zspage(). 2528 */ 2529 zspage->fullness = ZS_EMPTY; 2530 2531 __free_zspage(pool, class, zspage); 2532 spin_unlock(&pool->lock); 2533 return 0; 2534 } 2535 2536 putback_zspage(class, zspage); 2537 list_add(&zspage->lru, &pool->lru); 2538 unlock_zspage(zspage); 2539 } 2540 2541 spin_unlock(&pool->lock); 2542 return -EAGAIN; 2543 } 2544 -- 0-DAY CI Kernel Test Service https://01.org/lkp