linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Helge Deller <deller@gmx.de>, Daniel Vetter <daniel@ffwll.ch>,
	David Hildenbrand <david@redhat.com>,
	Matthew Wilcox <willy@infradead.org>, <linux-mm@kvack.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: [PATCH 2/4] mm: remove page_maybe_dma_pinned()
Date: Tue, 4 Jun 2024 19:48:20 +0800	[thread overview]
Message-ID: <20240604114822.2089819-3-wangkefeng.wang@huawei.com> (raw)
In-Reply-To: <20240604114822.2089819-1-wangkefeng.wang@huawei.com>

After the last user of page_maybe_dma_pinned() is converted to
folio_maybe_dma_pinned(), remove page_maybe_dma_pinned() and update
the document and comment.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 Documentation/core-api/pin_user_pages.rst | 10 +++++-----
 include/linux/mm.h                        |  9 ++-------
 2 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/Documentation/core-api/pin_user_pages.rst b/Documentation/core-api/pin_user_pages.rst
index 6b5f7e6e7155..532ba8e8381b 100644
--- a/Documentation/core-api/pin_user_pages.rst
+++ b/Documentation/core-api/pin_user_pages.rst
@@ -196,20 +196,20 @@ INCORRECT (uses FOLL_GET calls):
     write to the data within the pages
     put_page()
 
-page_maybe_dma_pinned(): the whole point of pinning
+folio_maybe_dma_pinned(): the whole point of pinning
 ===================================================
 
-The whole point of marking pages as "DMA-pinned" or "gup-pinned" is to be able
-to query, "is this page DMA-pinned?" That allows code such as page_mkclean()
+The whole point of marking folios as "DMA-pinned" or "gup-pinned" is to be able
+to query, "is this folio DMA-pinned?" That allows code such as page_mkclean()
 (and file system writeback code in general) to make informed decisions about
-what to do when a page cannot be unmapped due to such pins.
+what to do when a folio cannot be unmapped due to such pins.
 
 What to do in those cases is the subject of a years-long series of discussions
 and debates (see the References at the end of this document). It's a TODO item
 here: fill in the details once that's worked out. Meanwhile, it's safe to say
 that having this available: ::
 
-        static inline bool page_maybe_dma_pinned(struct page *page)
+        static inline bool folio_maybe_dma_pinned(struct folio *folio)
 
 ...is a prerequisite to solving the long-running gup+DMA problem.
 
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 28c40f68762e..d42497e25d43 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1953,8 +1953,8 @@ static inline struct folio *pfn_folio(unsigned long pfn)
  *
  * For more information, please see Documentation/core-api/pin_user_pages.rst.
  *
- * Return: True, if it is likely that the page has been "dma-pinned".
- * False, if the page is definitely not dma-pinned.
+ * Return: True, if it is likely that the folio has been "dma-pinned".
+ * False, if the folio is definitely not dma-pinned.
  */
 static inline bool folio_maybe_dma_pinned(struct folio *folio)
 {
@@ -1973,11 +1973,6 @@ static inline bool folio_maybe_dma_pinned(struct folio *folio)
 		GUP_PIN_COUNTING_BIAS;
 }
 
-static inline bool page_maybe_dma_pinned(struct page *page)
-{
-	return folio_maybe_dma_pinned(page_folio(page));
-}
-
 /*
  * This should most likely only be called during fork() to see whether we
  * should break the cow immediately for an anon page on the src mm.
-- 
2.27.0



  parent reply	other threads:[~2024-06-04 11:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-04 11:48 [PATCH 0/4] mm: remove page_maybe_dma_pinned() and page_mkclean() Kefeng Wang
2024-06-04 11:48 ` [PATCH 1/4] fs/proc/task_mmu: use folio API in pte_is_pinned() Kefeng Wang
2024-06-04 11:51   ` David Hildenbrand
2024-06-04 14:26     ` Kefeng Wang
     [not found]       ` <f466aae2-9a3e-4081-b2d8-fa5930b8bc29@redhat.com>
2024-06-05  1:30         ` Kefeng Wang
2024-06-25 22:38           ` Andrew Morton
2024-06-26  4:57             ` David Hildenbrand
2024-06-04 11:48 ` Kefeng Wang [this message]
2024-06-04 11:48 ` [PATCH 3/4] fb_defio: use a folio in fb_deferred_io_work() Kefeng Wang
2024-06-04 11:53   ` David Hildenbrand
2024-06-04 11:48 ` [PATCH 4/4] mm: remove page_mkclean() Kefeng Wang
2024-06-07  6:46   ` [PATCH] pin_user_pages: fix underline length Kefeng Wang

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=20240604114822.2089819-3-wangkefeng.wang@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=daniel@ffwll.ch \
    --cc=david@redhat.com \
    --cc=deller@gmx.de \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox