Thread (78 messages) 78 messages, 7 authors, 2021-08-25

Re: [PATCH v3 13/14] mm/gup: grab head page refcount once for group of subpages

From: Joao Martins <hidden>
Date: 2021-08-25 19:26:42
Also in: linux-mm, nvdimm


On 8/25/21 8:15 PM, Matthew Wilcox wrote:
On Wed, Aug 25, 2021 at 08:10:39PM +0100, Joao Martins wrote:
quoted
@@ -2273,8 +2273,7 @@ static int __gup_device_huge(unsigned long pfn, unsigned long addr,
                refs = record_subpages(page, addr, next, pages + *nr);

                SetPageReferenced(head);
-               pinned_head = try_grab_compound_head(head, refs, flags);
-               if (unlikely(!pinned_head)) {
+               if (unlikely(!try_grab_compound_head(head, refs, flags))) {
                        if (PageCompound(head))
BTW, you can just check PageHead(head).  We know it can't be PageTail ...
Ugh, yes. Your comment is also applicable to the other PageCompound() added before, as
it's done on the compound head. I've fixed it on both, thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help