Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [PATCH 5/8] mm/tests: add cleancache kunit test
       [not found] <20251010011951.2136980-6-surenb@google.com>
@ 2025-10-11  2:57 ` kernel test robot
  2025-10-11 21:47   ` Suren Baghdasaryan
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2025-10-11  2:57 UTC (permalink / raw)
  To: Suren Baghdasaryan, akpm
  Cc: llvm, oe-kbuild-all, david, lorenzo.stoakes, Liam.Howlett, vbabka,
	alexandru.elisei, peterx, sj, rppt, mhocko, corbet, axboe, viro,
	brauner, hch, jack, willy, m.szyprowski, robin.murphy, hannes,
	zhengqi.arch, shakeel.butt, axelrasmussen, yuanchu, weixugc,
	minchan, surenb, linux-mm, linux-doc, linux-kernel

Hi Suren,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 70478cb9da6fc4e7b987219173ba1681d5f7dd3d]

url:    https://github.com/intel-lab-lkp/linux/commits/Suren-Baghdasaryan/mm-implement-cleancache/20251010-134501
base:   70478cb9da6fc4e7b987219173ba1681d5f7dd3d
patch link:    https://lore.kernel.org/r/20251010011951.2136980-6-surenb%40google.com
patch subject: [PATCH 5/8] mm/tests: add cleancache kunit test
config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20251011/202510111059.aKceYLLH-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251011/202510111059.aKceYLLH-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510111059.aKceYLLH-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> mm/tests/cleancache_kunit.c:358:6: warning: variable 'unused' set but not used [-Wunused-but-set-variable]
     358 |         int unused = 0;
         |             ^
   1 warning generated.


vim +/unused +358 mm/tests/cleancache_kunit.c

   353	
   354	static void cleancache_backend_api_test(struct kunit *test)
   355	{
   356		struct folio *folio;
   357		LIST_HEAD(folios);
 > 358		int unused = 0;
   359		int used = 0;
   360	
   361		/* Store inode folios into cleancache */
   362		fill_cleancache(test);
   363	
   364		/* Get all donated folios back */
   365		for (int fidx = 0; fidx < FOLIO_COUNT; fidx++) {
   366			KUNIT_EXPECT_EQ(test, cleancache_backend_get_folio(test_data.pool_id,
   367							test_data.pool_folios[fidx]),  0);
   368			set_page_refcounted(&test_data.pool_folios[fidx]->page);
   369		}
   370	
   371		/* Try putting a refcounted folio */
   372		KUNIT_EXPECT_NE(test, cleancache_backend_put_folio(test_data.pool_id,
   373						test_data.pool_folios[0]), 0);
   374	
   375		/* Put some of the folios back into cleancache */
   376		for (int fidx = 0; fidx < FOLIOS_PER_INODE; fidx++) {
   377			folio_ref_freeze(test_data.pool_folios[fidx], 1);
   378			KUNIT_EXPECT_EQ(test, cleancache_backend_put_folio(test_data.pool_id,
   379							test_data.pool_folios[fidx]), 0);
   380		}
   381	
   382		/* Put the rest back into cleancache but keep half of folios still refcounted */
   383		for (int fidx = FOLIOS_PER_INODE; fidx < FOLIO_COUNT; fidx++) {
   384			if (fidx % 2) {
   385				folio_ref_freeze(test_data.pool_folios[fidx], 1);
   386				unused++;
   387			} else {
   388				used++;
   389			}
   390			list_add(&test_data.pool_folios[fidx]->lru, &folios);
   391		}
   392		KUNIT_EXPECT_NE(test, cleancache_backend_put_folios(test_data.pool_id,
   393						&folios), 0);
   394		/* Used folios should be still in the list */
   395		KUNIT_EXPECT_EQ(test, list_count_nodes(&folios), used);
   396	
   397		/* Release refcounts and put the remaining folios into cleancache */
   398		list_for_each_entry(folio, &folios, lru)
   399			folio_ref_freeze(folio, 1);
   400		KUNIT_EXPECT_EQ(test, cleancache_backend_put_folios(test_data.pool_id,
   401						&folios), 0);
   402		KUNIT_EXPECT_TRUE(test, list_empty(&folios));
   403	}
   404	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 5/8] mm/tests: add cleancache kunit test
  2025-10-11  2:57 ` [PATCH 5/8] mm/tests: add cleancache kunit test kernel test robot
@ 2025-10-11 21:47   ` Suren Baghdasaryan
  0 siblings, 0 replies; 2+ messages in thread
From: Suren Baghdasaryan @ 2025-10-11 21:47 UTC (permalink / raw)
  To: kernel test robot
  Cc: akpm, llvm, oe-kbuild-all, david, lorenzo.stoakes, Liam.Howlett,
	vbabka, alexandru.elisei, peterx, sj, rppt, mhocko, corbet, axboe,
	viro, brauner, hch, jack, willy, m.szyprowski, robin.murphy,
	hannes, zhengqi.arch, shakeel.butt, axelrasmussen, yuanchu,
	weixugc, minchan, linux-mm, linux-doc, linux-kernel

On Fri, Oct 10, 2025 at 7:58 PM kernel test robot <lkp@intel.com> wrote:
>
> Hi Suren,
>
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on 70478cb9da6fc4e7b987219173ba1681d5f7dd3d]
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Suren-Baghdasaryan/mm-implement-cleancache/20251010-134501
> base:   70478cb9da6fc4e7b987219173ba1681d5f7dd3d
> patch link:    https://lore.kernel.org/r/20251010011951.2136980-6-surenb%40google.com
> patch subject: [PATCH 5/8] mm/tests: add cleancache kunit test
> config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20251011/202510111059.aKceYLLH-lkp@intel.com/config)
> compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251011/202510111059.aKceYLLH-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202510111059.aKceYLLH-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
> >> mm/tests/cleancache_kunit.c:358:6: warning: variable 'unused' set but not used [-Wunused-but-set-variable]
>      358 |         int unused = 0;
>          |             ^
>    1 warning generated.

Right, I'll remove it.

>
>
> vim +/unused +358 mm/tests/cleancache_kunit.c
>
>    353
>    354  static void cleancache_backend_api_test(struct kunit *test)
>    355  {
>    356          struct folio *folio;
>    357          LIST_HEAD(folios);
>  > 358          int unused = 0;
>    359          int used = 0;
>    360
>    361          /* Store inode folios into cleancache */
>    362          fill_cleancache(test);
>    363
>    364          /* Get all donated folios back */
>    365          for (int fidx = 0; fidx < FOLIO_COUNT; fidx++) {
>    366                  KUNIT_EXPECT_EQ(test, cleancache_backend_get_folio(test_data.pool_id,
>    367                                                  test_data.pool_folios[fidx]),  0);
>    368                  set_page_refcounted(&test_data.pool_folios[fidx]->page);
>    369          }
>    370
>    371          /* Try putting a refcounted folio */
>    372          KUNIT_EXPECT_NE(test, cleancache_backend_put_folio(test_data.pool_id,
>    373                                          test_data.pool_folios[0]), 0);
>    374
>    375          /* Put some of the folios back into cleancache */
>    376          for (int fidx = 0; fidx < FOLIOS_PER_INODE; fidx++) {
>    377                  folio_ref_freeze(test_data.pool_folios[fidx], 1);
>    378                  KUNIT_EXPECT_EQ(test, cleancache_backend_put_folio(test_data.pool_id,
>    379                                                  test_data.pool_folios[fidx]), 0);
>    380          }
>    381
>    382          /* Put the rest back into cleancache but keep half of folios still refcounted */
>    383          for (int fidx = FOLIOS_PER_INODE; fidx < FOLIO_COUNT; fidx++) {
>    384                  if (fidx % 2) {
>    385                          folio_ref_freeze(test_data.pool_folios[fidx], 1);
>    386                          unused++;
>    387                  } else {
>    388                          used++;
>    389                  }
>    390                  list_add(&test_data.pool_folios[fidx]->lru, &folios);
>    391          }
>    392          KUNIT_EXPECT_NE(test, cleancache_backend_put_folios(test_data.pool_id,
>    393                                          &folios), 0);
>    394          /* Used folios should be still in the list */
>    395          KUNIT_EXPECT_EQ(test, list_count_nodes(&folios), used);
>    396
>    397          /* Release refcounts and put the remaining folios into cleancache */
>    398          list_for_each_entry(folio, &folios, lru)
>    399                  folio_ref_freeze(folio, 1);
>    400          KUNIT_EXPECT_EQ(test, cleancache_backend_put_folios(test_data.pool_id,
>    401                                          &folios), 0);
>    402          KUNIT_EXPECT_TRUE(test, list_empty(&folios));
>    403  }
>    404
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-11 21:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20251010011951.2136980-6-surenb@google.com>
2025-10-11  2:57 ` [PATCH 5/8] mm/tests: add cleancache kunit test kernel test robot
2025-10-11 21:47   ` Suren Baghdasaryan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox