linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vishal Moola <vishal.moola@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
	muchun.song@linux.dev,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Convert __unmap_hugepage_range() to folios
Date: Tue, 21 May 2024 14:13:44 -0700	[thread overview]
Message-ID: <CAOzc2px9sWGUPbCM+pHuqt8eAUONrDcKnEybvM6k6ot2ftpmmg@mail.gmail.com> (raw)
In-Reply-To: <ZkvErLsj8Ngj4qM3@casper.infradead.org>

On Mon, May 20, 2024 at 2:46 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Mon, May 20, 2024 at 12:47:49PM -0700, Vishal Moola (Oracle) wrote:
> > Replaces 4 calls to compound_head() with one. Also converts
> > unmap_hugepage_range() and unmap_ref_private() to take in folios.
>
> This is great!
>
> >  void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
> >                           unsigned long start, unsigned long end,
> > -                         struct page *ref_page, zap_flags_t zap_flags)
> > +                         struct folio *ref_folio, zap_flags_t zap_flags)
> >  {
> >       struct mm_struct *mm = vma->vm_mm;
> >       unsigned long address;
> >       pte_t *ptep;
> >       pte_t pte;
> >       spinlock_t *ptl;
> > -     struct page *page;
> > +     struct folio *folio;
> >       struct hstate *h = hstate_vma(vma);
> >       unsigned long sz = huge_page_size(h);
>
> I would appreciate some further cleanup ...
>
>         size_t sz = folio_size(folio);
>
> I think there are further cleanups along those lines, eg
> pages_per_huge_page(), hugetlb_mask_last_page(), huge_page_mask().
>

Gotcha, I'll look into those and change them in v2.


  reply	other threads:[~2024-05-21 21:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-20 19:47 Vishal Moola (Oracle)
2024-05-20 21:46 ` Matthew Wilcox
2024-05-21 21:13   ` Vishal Moola [this message]
2024-06-03 19:38     ` Vishal Moola

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=CAOzc2px9sWGUPbCM+pHuqt8eAUONrDcKnEybvM6k6ot2ftpmmg@mail.gmail.com \
    --to=vishal.moola@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=muchun.song@linux.dev \
    --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