On Mon, Dec 21, 2020 at 9:44 PM Oscar Salvador <osalva...@suse.de> wrote:
>
> On Mon, Dec 21, 2020 at 07:25:15PM +0800, Muchun Song wrote:
>
> > Should we add a BUG_ON in vmemmap_remap_free() for now?
> >
> >         BUG_ON(reuse != start + PAGE_SIZE);
>
> I do not think we have to, plus we would be BUG_ing for some specific use
> case in "generic" function.

The vmemmap_remap_range() walks page table range [start, end),
if reuse is equal to (start + PAGE_SIZE), the range can adjust to
[start - PAGE_SIZE, end). But if not, we need some work to
implement the "generic" function.

  - adjust range to [min(start, reuse), end) and call
    vmemmap_remap_rangeand which skip the hole
    which is [reuse + PAGE_SIZE, start) or [end, reuse).
  - call vmemmap_remap_range(reuse, reuse + PAGE_SIZE)
    to get the reuse page.Then, call vmemmap_remap_range(start, end)
    again to remap.

Which one do you prefer?

> Maybe others think different though.
>
> --
> Oscar Salvador
> SUSE L3



--
Yours,
Muchun

Reply via email to