All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: David Hildenbrand <david@redhat.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [davidhildenbrand:migration 10/16] mm/migrate.c:191: warning: Function parameter or struct member 'dst' not described in 'migrate_non_folio_page'
Date: Mon, 14 Apr 2025 09:47:02 +0800	[thread overview]
Message-ID: <202504140956.XfOvdbF7-lkp@intel.com> (raw)

tree:   https://github.com/davidhildenbrand/linux migration
head:   07b1b56f4f50e3b2ce6818d9ca0fbdbcd138d66f
commit: a3d0a56997669e386379c8b016a041fa5264fcae [10/16] mm/migrate: factor out non-folio page handling into migrate_non_folio_page()
config: arc-randconfig-001-20250414 (https://download.01.org/0day-ci/archive/20250414/202504140956.XfOvdbF7-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250414/202504140956.XfOvdbF7-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/202504140956.XfOvdbF7-lkp@intel.com/

All warnings (new ones prefixed by >>):

   mm/migrate.c:68: warning: Function parameter or struct member 'mode' not described in 'isolate_non_folio_page'
>> mm/migrate.c:191: warning: Function parameter or struct member 'dst' not described in 'migrate_non_folio_page'
>> mm/migrate.c:191: warning: Function parameter or struct member 'src' not described in 'migrate_non_folio_page'
>> mm/migrate.c:191: warning: Function parameter or struct member 'mode' not described in 'migrate_non_folio_page'
>> mm/migrate.c:191: warning: Excess function parameter 'page' description in 'migrate_non_folio_page'


vim +191 mm/migrate.c

    53	
    54	/**
    55	 * isolate_non_folio_page - isolate a non-folio page for migration
    56	 * @page: The page.
    57	 *
    58	 * Try to isolate a non-folio page for migration. Will fail if the page is
    59	 * not a non-folio page that is movable, including if the page is already
    60	 * isolated or just was released by its owner.
    61	 *
    62	 * Once isolated, the page cannot get freed until it is either putback
    63	 * or migrated.
    64	 *
    65	 * Returns true if isolation succeeded, otherwise false.
    66	 */
    67	bool isolate_non_folio_page(struct page *page, isolate_mode_t mode)
  > 68	{
    69		/*
    70		 * TODO: these pages will not be folios in the future. All
    71		 * folio dependencies will have to be removed.
    72		 */
    73		struct folio *folio = folio_get_nontail_page(page);
    74		const struct movable_operations *mops;
    75	
    76		/*
    77		 * Avoid burning cycles with pages that are yet under __free_pages(),
    78		 * or just got freed under us.
    79		 *
    80		 * In case we 'win' a race for a movable page being freed under us and
    81		 * raise its refcount preventing __free_pages() from doing its job
    82		 * the put_page() at the end of this block will take care of
    83		 * release this page, thus avoiding a nasty leakage.
    84		 */
    85		if (!folio)
    86			goto out;
    87	
    88		/*
    89		 * Check movable flag before taking the page lock because
    90		 * we use non-atomic bitops on newly allocated page flags so
    91		 * unconditionally grabbing the lock ruins page's owner side.
    92		 */
    93		if (unlikely(!__PageMovable(page)))
    94			goto out_putfolio;
    95	
    96		/*
    97		 * As movable pages are not isolated from LRU lists, concurrent
    98		 * compaction threads can race against page migration functions
    99		 * as well as race against the releasing a page.
   100		 *
   101		 * In order to avoid having an already isolated movable page
   102		 * being (wrongly) re-isolated while it is under migration,
   103		 * or to avoid attempting to isolate pages being released,
   104		 * lets be sure we have the page lock
   105		 * before proceeding with the movable page isolation steps.
   106		 */
   107		if (unlikely(!folio_trylock(folio)))
   108			goto out_putfolio;
   109	
   110		if (!PageMovable(page) || PageIsolated(page))
   111			goto out_no_isolated;
   112	
   113		mops = page_movable_ops(page);
   114		if (WARN_ON_ONCE(!mops))
   115			goto out_no_isolated;
   116	
   117		if (!mops->isolate_page(page, mode))
   118			goto out_no_isolated;
   119	
   120		/* Driver shouldn't use the isolated flag */
   121		VM_WARN_ON_ONCE_PAGE(PageIsolated(page), page);
   122		SetPageIsolated(page);
   123		folio_unlock(folio);
   124	
   125		return true;
   126	
   127	out_no_isolated:
   128		folio_unlock(folio);
   129	out_putfolio:
   130		folio_put(folio);
   131	out:
   132		return false;
   133	}
   134	
   135	/**
   136	 * putback_non_folio_page - putback a non-folio page
   137	 * @page: The page.
   138	 *
   139	 * Putback a non-folio page that was previously isolated
   140	 * with isolated_non_folio_page().
   141	 *
   142	 * After the page was putback, it might get freed at any time and must no
   143	 * longer be touched by the caller.
   144	 */
   145	static void putback_non_folio_page(struct page *page)
   146	{
   147		/*
   148		 * TODO: these pages will not be folios in the future. All
   149		 * folio dependencies will have to be removed.
   150		 */
   151		struct folio *folio = page_folio(page);
   152	
   153		VM_WARN_ON_ONCE_PAGE(!PageIsolated(page), page);
   154		folio_lock(folio);
   155		/* If the page was released by it's owner, there is nothing to do. */
   156		if (PageMovable(page))
   157			page_movable_ops(page)->putback_page(page);
   158		ClearPageIsolated(page);
   159		folio_unlock(folio);
   160		folio_put(folio);
   161	}
   162	
   163	/**
   164	 * migrate_non_folio_page - migrate a non-folio page
   165	 * @page: The page.
   166	 *
   167	 * Migrate a non-folio page that was previously isolated with
   168	 * isolated_non_folio_page().
   169	 *
   170	 * If the src page was already released by its owner, the src page is
   171	 * un-isolated and migration succeeds; the migration core will be the
   172	 * owner of both pages.
   173	 *
   174	 * If the src page was not released by its owner and the migration was
   175	 * successful, the owner of the src page and the dst page are swapped and
   176	 * the src page is un-isolated.
   177	 *
   178	 * If migration fails, the ownership stays unmodified and the src page
   179	 * remains isolated: migration may be retried later or the page can be putback.
   180	 *
   181	 * TODO: migration core will treat both pages as folios and lock them before
   182	 * this call to unlock them after this call. Further, the folio refcounts on
   183	 * src and dst are also released by migration core. These pages will not be
   184	 * folios in the future, so that must be reworked.
   185	 *
   186	 * Returns MIGRATEPAGE_SUCCESS on success, otherwise a negative error
   187	 * code.
   188	 */
   189	static int migrate_non_folio_page(struct page *dst, struct page *src,
   190			enum migrate_mode mode)
 > 191	{
   192		int rc = MIGRATEPAGE_SUCCESS;
   193	
   194		VM_WARN_ON_ONCE(!PageIsolated(src));
   195		/* If the page was released by it's owner, there is nothing to do. */
   196		if (PageMovable(src))
   197			rc = page_movable_ops(src)->migrate_page(dst, src, mode);
   198		if (rc == MIGRATEPAGE_SUCCESS)
   199			ClearPageIsolated(src);
   200		return rc;
   201	}
   202	

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

                 reply	other threads:[~2025-04-14  1:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202504140956.XfOvdbF7-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=david@redhat.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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.