All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Zi Yan <ziy@nvidia.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC PATCH 3/5] mm/migrate: add migrate_folios_batch_move to batch the folio move operations
Date: Sat, 4 Jan 2025 12:19:41 +0800	[thread overview]
Message-ID: <202501041206.9cE8Qd8b-lkp@intel.com> (raw)
In-Reply-To: <20250103172419.4148674-4-ziy@nvidia.com>

Hi Zi,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on linus/master sysctl/sysctl-next v6.13-rc5 next-20241220]
[cannot apply to mcgrof/sysctl-next]
[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/Zi-Yan/mm-separate-move-undo-doing-on-folio-list-from-migrate_pages_batch/20250104-012955
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20250103172419.4148674-4-ziy%40nvidia.com
patch subject: [RFC PATCH 3/5] mm/migrate: add migrate_folios_batch_move to batch the folio move operations
config: i386-buildonly-randconfig-004-20250104 (https://download.01.org/0day-ci/archive/20250104/202501041206.9cE8Qd8b-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250104/202501041206.9cE8Qd8b-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/202501041206.9cE8Qd8b-lkp@intel.com/

All warnings (new ones prefixed by >>):

   mm/migrate.c: In function 'migrate_folios_batch_move':
>> mm/migrate.c:1805:14: warning: variable 'is_lru' set but not used [-Wunused-but-set-variable]
    1805 |         bool is_lru;
         |              ^~~~~~


vim +/is_lru +1805 mm/migrate.c

  1791	
  1792	static void migrate_folios_batch_move(struct list_head *src_folios,
  1793			struct list_head *dst_folios,
  1794			free_folio_t put_new_folio, unsigned long private,
  1795			enum migrate_mode mode, int reason,
  1796			struct list_head *ret_folios,
  1797			struct migrate_pages_stats *stats,
  1798			int *retry, int *thp_retry, int *nr_failed,
  1799			int *nr_retry_pages)
  1800	{
  1801		struct folio *folio, *folio2, *dst, *dst2;
  1802		int rc, nr_pages = 0, nr_mig_folios = 0;
  1803		int old_page_state = 0;
  1804		struct anon_vma *anon_vma = NULL;
> 1805		bool is_lru;
  1806		int is_thp = 0;
  1807		LIST_HEAD(err_src);
  1808		LIST_HEAD(err_dst);
  1809	
  1810		if (mode != MIGRATE_ASYNC) {
  1811			*retry += 1;
  1812			return;
  1813		}
  1814	
  1815		/*
  1816		 * Iterate over the list of locked src/dst folios to copy the metadata
  1817		 */
  1818		dst = list_first_entry(dst_folios, struct folio, lru);
  1819		dst2 = list_next_entry(dst, lru);
  1820		list_for_each_entry_safe(folio, folio2, src_folios, lru) {
  1821			is_thp = folio_test_large(folio) && folio_test_pmd_mappable(folio);
  1822			nr_pages = folio_nr_pages(folio);
  1823			is_lru = !__folio_test_movable(folio);
  1824	
  1825			/*
  1826			 * dst->private is not cleared here. It is cleared and moved to
  1827			 * src->private in __migrate_folio().
  1828			 */
  1829			__migrate_folio_read(dst, &old_page_state, &anon_vma);
  1830	
  1831			/*
  1832			 * Use MIGRATE_NO_COPY mode in migrate_folio family functions
  1833			 * to copy the flags, mapping and some other ancillary information.
  1834			 * This does everything except the page copy. The actual page copy
  1835			 * is handled later in a batch manner.
  1836			 */
  1837			rc = _move_to_new_folio_prep(dst, folio, MIGRATE_NO_COPY);
  1838	
  1839			/*
  1840			 * -EAGAIN: Move src/dst folios to tmp lists for retry
  1841			 * Other Errno: Put src folio on ret_folios list, remove the dst folio
  1842			 * Success: Copy the folio bytes, restoring working pte, unlock and
  1843			 *	    decrement refcounter
  1844			 */
  1845			if (rc == -EAGAIN) {
  1846				*retry += 1;
  1847				*thp_retry += is_thp;
  1848				*nr_retry_pages += nr_pages;
  1849	
  1850				list_move_tail(&folio->lru, &err_src);
  1851				list_move_tail(&dst->lru, &err_dst);
  1852				__migrate_folio_record(dst, old_page_state, anon_vma);
  1853			} else if (rc != MIGRATEPAGE_SUCCESS) {
  1854				*nr_failed += 1;
  1855				stats->nr_thp_failed += is_thp;
  1856				stats->nr_failed_pages += nr_pages;
  1857	
  1858				list_del(&dst->lru);
  1859				migrate_folio_undo_src(folio, old_page_state & PAGE_WAS_MAPPED,
  1860						anon_vma, true, ret_folios);
  1861				migrate_folio_undo_dst(dst, true, put_new_folio, private);
  1862			} else /* MIGRATEPAGE_SUCCESS */
  1863				nr_mig_folios++;
  1864	
  1865			dst = dst2;
  1866			dst2 = list_next_entry(dst, lru);
  1867		}
  1868	
  1869		/* Exit if folio list for batch migration is empty */
  1870		if (!nr_mig_folios)
  1871			goto out;
  1872	
  1873		/* Batch copy the folios */
  1874		{
  1875			dst = list_first_entry(dst_folios, struct folio, lru);
  1876			dst2 = list_next_entry(dst, lru);
  1877			list_for_each_entry_safe(folio, folio2, src_folios, lru) {
  1878				is_thp = folio_test_large(folio) &&
  1879					 folio_test_pmd_mappable(folio);
  1880				nr_pages = folio_nr_pages(folio);
  1881				rc = folio_mc_copy(dst, folio);
  1882	
  1883				if (rc) {
  1884					int old_page_state = 0;
  1885					struct anon_vma *anon_vma = NULL;
  1886	
  1887					/*
  1888					 * dst->private is moved to src->private in
  1889					 * __migrate_folio(), so page state and anon_vma
  1890					 * values can be extracted from (src) folio.
  1891					 */
  1892					__migrate_folio_extract(folio, &old_page_state,
  1893							&anon_vma);
  1894					migrate_folio_undo_src(folio,
  1895							old_page_state & PAGE_WAS_MAPPED,
  1896							anon_vma, true, ret_folios);
  1897					list_del(&dst->lru);
  1898					migrate_folio_undo_dst(dst, true, put_new_folio,
  1899							private);
  1900				}
  1901	
  1902				switch (rc) {
  1903				case MIGRATEPAGE_SUCCESS:
  1904					stats->nr_succeeded += nr_pages;
  1905					stats->nr_thp_succeeded += is_thp;
  1906					break;
  1907				default:
  1908					*nr_failed += 1;
  1909					stats->nr_thp_failed += is_thp;
  1910					stats->nr_failed_pages += nr_pages;
  1911					break;
  1912				}
  1913	
  1914				dst = dst2;
  1915				dst2 = list_next_entry(dst, lru);
  1916			}
  1917		}
  1918	
  1919		/*
  1920		 * Iterate the folio lists to remove migration pte and restore them
  1921		 * as working pte. Unlock the folios, add/remove them to LRU lists (if
  1922		 * applicable) and release the src folios.
  1923		 */
  1924		dst = list_first_entry(dst_folios, struct folio, lru);
  1925		dst2 = list_next_entry(dst, lru);
  1926		list_for_each_entry_safe(folio, folio2, src_folios, lru) {
  1927			is_thp = folio_test_large(folio) && folio_test_pmd_mappable(folio);
  1928			nr_pages = folio_nr_pages(folio);
  1929			/*
  1930			 * dst->private is moved to src->private in __migrate_folio(),
  1931			 * so page state and anon_vma values can be extracted from
  1932			 * (src) folio.
  1933			 */
  1934			__migrate_folio_extract(folio, &old_page_state, &anon_vma);
  1935			list_del(&dst->lru);
  1936	
  1937			_move_to_new_folio_finalize(dst, folio, MIGRATEPAGE_SUCCESS);
  1938	
  1939			/*
  1940			 * Below few steps are only applicable for lru pages which is
  1941			 * ensured as we have removed the non-lru pages from our list.
  1942			 */
  1943			_migrate_folio_move_finalize1(folio, dst, old_page_state);
  1944	
  1945			_migrate_folio_move_finalize2(folio, dst, reason, anon_vma);
  1946	
  1947			/* Page migration successful, increase stat counter */
  1948			stats->nr_succeeded += nr_pages;
  1949			stats->nr_thp_succeeded += is_thp;
  1950	
  1951			dst = dst2;
  1952			dst2 = list_next_entry(dst, lru);
  1953		}
  1954	out:
  1955		/* Add tmp folios back to the list to let CPU re-attempt migration. */
  1956		list_splice(&err_src, src_folios);
  1957		list_splice(&err_dst, dst_folios);
  1958	}
  1959	

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

  reply	other threads:[~2025-01-04  4:19 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-03 17:24 [RFC PATCH 0/5] Accelerate page migration with batching and multi threads Zi Yan
2025-01-03 17:24 ` [RFC PATCH 1/5] mm: separate move/undo doing on folio list from migrate_pages_batch() Zi Yan
2025-01-03 17:24 ` [RFC PATCH 2/5] mm/migrate: factor out code in move_to_new_folio() and migrate_folio_move() Zi Yan
2025-01-03 17:24 ` [RFC PATCH 3/5] mm/migrate: add migrate_folios_batch_move to batch the folio move operations Zi Yan
2025-01-04  4:19   ` kernel test robot [this message]
2025-01-09 11:47   ` Shivank Garg
2025-01-09 14:08     ` Zi Yan
2025-01-03 17:24 ` [RFC PATCH 4/5] mm/migrate: introduce multi-threaded page copy routine Zi Yan
2025-01-06  1:18   ` Hyeonggon Yoo
2025-01-06  2:01     ` Zi Yan
2025-02-13 12:44   ` Byungchul Park
2025-02-13 15:34     ` Zi Yan
2025-02-13 21:34       ` Byungchul Park
2025-01-03 17:24 ` [RFC PATCH 5/5] test: add sysctl for folio copy tests and adjust NR_MAX_BATCHED_MIGRATION Zi Yan
2025-01-03 22:21   ` Gregory Price
2025-01-03 22:56     ` Zi Yan
2025-01-04  4:51   ` kernel test robot
2025-01-04  5:24   ` kernel test robot
2025-01-03 19:17 ` [RFC PATCH 0/5] Accelerate page migration with batching and multi threads Gregory Price
2025-01-03 19:32   ` Zi Yan
2025-01-03 22:09 ` Yang Shi
2025-01-06  2:33   ` Zi Yan
2025-01-09 11:47 ` Shivank Garg
2025-01-09 15:04   ` Zi Yan
2025-01-09 18:03     ` Shivank Garg
2025-01-09 19:32       ` Zi Yan
2025-01-10 17:05         ` Zi Yan
2025-01-10 19:51           ` Zi Yan
2025-01-16  4:57             ` Shivank Garg
2025-01-21  6:15               ` Shivank Garg
2025-02-13  8:17 ` Byungchul Park
2025-02-13 15:36   ` Zi Yan

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=202501041206.9cE8Qd8b-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=ziy@nvidia.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.