[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHbLzkodRFsBWvZ8zZZVeFTNzrwV0PNpT2XmUwFxL1KygPmd4Q@mail.gmail.com>
Date: Fri, 28 Jun 2024 11:27:15 -0700
From: Yang Shi <shy828301@...il.com>
To: Christoph Hellwig <hch@...radead.org>
Cc: Yang Shi <yang@...amperecomputing.com>, peterx@...hat.com, yangge1116@....com,
david@...hat.com, akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [v2 PATCH] mm: gup: do not call try_grab_folio() in slow path
On Thu, Jun 27, 2024 at 11:35 PM Christoph Hellwig <hch@...radead.org> wrote:
>
> > +int __must_check try_grab_folio(struct folio *folio, int refs, unsigned int flags)
>
> Overly long line (same for the external declaration)
>
> > + struct page *page = &folio->page;
>
> Page is only used for is_pci_p2pdma_page and is_zero_page, and for
> the latter a is_zero_folio already exist. Maybe remove the local
> variable, use is_zero_folio and just open code the dereference in the
> is_pci_p2pdma_page call?
Thanks, Christoph. Good point, I think we can use is_zero_folio and
open coeded it in is_pci_p2pdma_page.
And all the format problems will be solved in v3.
>
> > + ret = gup_hugepte(vma, ptep, sz, addr, end, flags, pages, nr, fast);
>
> Overly lone line.
>
> > + folio_ref_add(folio,
> > + refs * (GUP_PIN_COUNTING_BIAS - 1));
>
> Nit: this easily fits onto a single line.
>
> > if (gup_hugepd(NULL, __hugepd(pmd_val(pmd)), addr,
> > - PMD_SHIFT, next, flags, pages, nr) != 1)
> > + PMD_SHIFT, next, flags, pages, nr, true) != 1)
>
> Overly long lin (same in the similar calls below)
>
>
Powered by blists - more mailing lists