[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231127034135.6754-1-v-songbaohua@oppo.com>
Date: Mon, 27 Nov 2023 16:41:35 +1300
From: Barry Song <21cnbao@...il.com>
To: ryan.roberts@....com
Cc: akpm@...ux-foundation.org, anshuman.khandual@....com,
catalin.marinas@....com, david@...hat.com, fengwei.yin@...el.com,
hughd@...gle.com, itaru.kitayama@...il.com, jhubbard@...dia.com,
kirill.shutemov@...ux.intel.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, mcgrof@...nel.org, rientjes@...gle.com,
shy828301@...il.com, vbabka@...e.cz, wangkefeng.wang@...wei.com,
willy@...radead.org, ying.huang@...el.com, yuzhao@...gle.com,
ziy@...dia.com
Subject: Re: [RESEND PATCH v7 04/10] mm: thp: Support allocation of anonymous small-sized THP
> + if ((nr_pages == 1 && vmf_pte_changed(vmf)) ||
> + (nr_pages > 1 && !pte_range_none(vmf->pte, nr_pages))) {
> + for (i = 0; i < nr_pages; i++)
> + update_mmu_tlb(vma, addr + PAGE_SIZE * i, vmf->pte + i);
> goto release;
> }
Hi Ryan,
what has stopped nr_pages == 1 from using !pte_range_none(vmf->pte, 1)
directly, then the code can become,
+ if (!pte_range_none(vmf->pte, nr_pages)) {
+ for (i = 0; i < nr_pages; i++)
+ update_mmu_tlb(vma, addr + PAGE_SIZE * i, vmf->pte + i);
goto release;
}
for both 1 and > 1 cases?
Thanks
Barry
Powered by blists - more mailing lists