Re: [PATCH] mm: Convert DAX lock/unlock page to lock/unlock folio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 8/22/2023 4:13 PM, Matthew Wilcox (Oracle) wrote:
[..]
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index a6c3af985554..b81d6eb4e6ff 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1717,16 +1717,11 @@ static int mf_generic_kill_procs(unsigned long long pfn, int flags,
  		struct dev_pagemap *pgmap)
  {
  	struct page *page = pfn_to_page(pfn);

Looks like the above line, that is, the 'page' pointer is no longer needed.

+	struct folio *folio = page_folio(page);
  	LIST_HEAD(to_kill);
  	dax_entry_t cookie;
  	int rc = 0;
- /*
-	 * Pages instantiated by device-dax (not filesystem-dax)
-	 * may be compound pages.
-	 */
-	page = compound_head(page);
-
  	/*
  	 * Prevent the inode from being freed while we are interrogating
  	 * the address_space, typically this would be handled by
@@ -1734,11 +1729,11 @@ static int mf_generic_kill_procs(unsigned long long pfn, int flags,
  	 * also prevents changes to the mapping of this pfn until
  	 * poison signaling is complete.
  	 */
-	cookie = dax_lock_page(page);
+	cookie = dax_lock_folio(folio);
  	if (!cookie)
  		return -EBUSY;
- if (hwpoison_filter(page)) {
+	if (hwpoison_filter(&folio->page)) {
  		rc = -EOPNOTSUPP;
  		goto unlock;
  	}
@@ -1760,7 +1755,7 @@ static int mf_generic_kill_procs(unsigned long long pfn, int flags,
  	 * Use this flag as an indication that the dax page has been
  	 * remapped UC to prevent speculative consumption of poison.
  	 */
-	SetPageHWPoison(page);
+	SetPageHWPoison(&folio->page);
/*
  	 * Unlike System-RAM there is no possibility to swap in a
@@ -1769,11 +1764,11 @@ static int mf_generic_kill_procs(unsigned long long pfn, int flags,
  	 * SIGBUS (i.e. MF_MUST_KILL)
  	 */
  	flags |= MF_ACTION_REQUIRED | MF_MUST_KILL;
-	collect_procs(page, &to_kill, true);
+	collect_procs(&folio->page, &to_kill, true);
- unmap_and_kill(&to_kill, pfn, page->mapping, page->index, flags);
+	unmap_and_kill(&to_kill, pfn, folio->mapping, folio->index, flags);
  unlock:
-	dax_unlock_page(page, cookie);
+	dax_unlock_folio(folio, cookie);
  	return rc;
  }


thanks,
-jane




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux