Re: [PATCH 1/3] mm/gup: documentation corrections for gup/pup

From
Matthew Wilcox <willy@infradead.org>
Date
2021-08-09 01:41:54
Also in
linux-mm
Reply to
John Hubbard, 2021-08-08
On Sun, Aug 08, 2021 at 04:50:16PM -0700, John Hubbard wrote:
quoted hunk ↗ jump to hunk
@@ -103,8 +103,14 @@ static inline struct page *try_get_compound_head(struct page *page, int refs)
  * same time. (That's true throughout the get_user_pages*() and
  * pin_user_pages*() APIs.) Cases:
  *
- *    FOLL_GET: page's refcount will be incremented by 1.
- *    FOLL_PIN: page's refcount will be incremented by GUP_PIN_COUNTING_BIAS.
+ *    FOLL_GET: page's refcount will be incremented by refs.
I think this would read more clearly if it said @refs (throughout).
quoted hunk ↗ jump to hunk
+ *
+ *    FOLL_PIN on compound pages that are > two pages long: page's refcount will
+ *        be incremented by refs, and page[2].hpage_pinned_refcount will be
+ *        incremented by refs * GUP_PIN_COUNTING_BIAS.
+ *
+ *    FOLL_PIN on normal pages, or compound pages that are two pages long:
+ *        page's refcount will be incremented by refs * GUP_PIN_COUNTING_BIAS.
  *
  * Return: head page (with refcount appropriately incremented) for success, or
  * NULL upon failure. If neither FOLL_GET nor FOLL_PIN was set, that's
Did you run 'make htmldocs' and see how it renders?  I haven't looked,
but this might work better as an rst list?
Thread (11 messages) 11 messages, 3 authors, last reply 2021-08-10
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help