Commit 45dbef4c authored by Ma Wupeng's avatar Ma Wupeng Committed by Wupeng Ma
Browse files

mm: page_eject: Add mc support during offline page

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8K5CO



--------------------------------

During offline page in page ejection, page is copied in kernel space
in migrate page, set PF_MCS to task flags which will call
migrate_page_mc_extra to support mc.

Signed-off-by: default avatarMa Wupeng <mawupeng1@huawei.com>
parent b7f5b9ef
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -77,8 +77,13 @@ static int page_eject_offline_page(unsigned long pfn)
	 * if soft_offline_page return 0 because PageHWPoison, this pfn
	 * will add to list and this add will be removed during online
	 * since it is poisoned.
	 *
	 * Update task flag with PF_MCS to enable mc support during page
	 * migration.
	 */
	current->flags |= PF_MCS;
	ret = soft_offline_page(pfn, 0);
	current->flags &= ~PF_MCS;
	if (ret) {
		pr_err("page fail to be offlined, soft_offline_page failed(%d), pfn=%#lx\n",
		       ret, pfn);
+6 −0
Original line number Diff line number Diff line
@@ -738,6 +738,12 @@ int migrate_page_extra(struct address_space *mapping,

	BUG_ON(PageWriteback(page));	/* Writeback must be complete */

	if (unlikely(IS_ENABLED(CONFIG_ARCH_HAS_COPY_MC) &&
		     (current->flags & PF_MCS) &&
		     (mode != MIGRATE_SYNC_NO_COPY)))
		return migrate_page_mc_extra(mapping, newpage, page, mode,
					     extra_count);

	rc = migrate_page_move_mapping(mapping, newpage, page, extra_count);

	if (rc != MIGRATEPAGE_SUCCESS)