[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YMKacyNstEM9brUD@t490s>
Date: Thu, 10 Jun 2021 19:04:19 -0400
From: Peter Xu <peterx@...hat.com>
To: Alistair Popple <apopple@...dia.com>
Cc: linux-mm@...ck.org, akpm@...ux-foundation.org,
rcampbell@...dia.com, linux-doc@...r.kernel.org,
nouveau@...ts.freedesktop.org, hughd@...gle.com,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
hch@...radead.org, bskeggs@...hat.com, jgg@...dia.com,
shakeelb@...gle.com, jhubbard@...dia.com, willy@...radead.org,
Christoph Hellwig <hch@....de>
Subject: Re: [PATCH v10 07/10] mm: Device exclusive memory access
On Fri, Jun 11, 2021 at 12:21:26AM +1000, Alistair Popple wrote:
> > Hmm, the thing is.. to me FOLL_SPLIT_PMD should have similar effect to explicit
> > call split_huge_pmd_address(), afaict. Since both of them use __split_huge_pmd()
> > internally which will generate that unwanted CLEAR notify.
>
> Agree that gup calls __split_huge_pmd() via split_huge_pmd_address()
> which will always CLEAR. However gup only calls split_huge_pmd_address() if it
> finds a thp pmd. In follow_pmd_mask() we have:
>
> if (likely(!pmd_trans_huge(pmdval)))
> return follow_page_pte(vma, address, pmd, flags, &ctx->pgmap);
>
> So I don't think we have a problem here.
Sorry I didn't follow here.. We do FOLL_SPLIT_PMD after this check, right? I
mean, if it's a thp for the current mm, afaict pmd_trans_huge() should return
true above, so we'll skip follow_page_pte(); then we'll check FOLL_SPLIT_PMD
and do the split, then the CLEAR notify. Hmm.. Did I miss something?
--
Peter Xu
Powered by blists - more mailing lists