[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220331085341.GA22102@lst.de>
Date: Thu, 31 Mar 2022 10:53:41 +0200
From: Christoph Hellwig <hch@....de>
To: Alex Sierra <alex.sierra@....com>
Cc: jgg@...dia.com, david@...hat.com, Felix.Kuehling@....com,
linux-mm@...ck.org, rcampbell@...dia.com,
linux-ext4@...r.kernel.org, linux-xfs@...r.kernel.org,
amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
hch@....de, jglisse@...hat.com, apopple@...dia.com,
willy@...radead.org, akpm@...ux-foundation.org
Subject: Re: [PATCH v2 1/3] mm: add vm_normal_lru_pages for LRU handled
pages only
> - page = vm_normal_page(vma, addr, pte);
> + page = vm_normal_lru_page(vma, addr, pte);
Why can't this deal with ZONE_DEVICE pages? It certainly has
nothing do with a LRU I think. In fact being able to have
stats that count say the number of device pages here would
probably be useful at some point.
In general I find the vm_normal_lru_page vs vm_normal_page
API highly confusing. An explicit check for zone device pages
in the dozen or so spots that care has a much better documentation
value, especially if accompanied by comments where it isn't entirely
obvious.
> page = follow_page(vma, addr,
> - FOLL_GET | FOLL_MIGRATION | FOLL_REMOTE);
> + FOLL_GET | FOLL_MIGRATION | FOLL_REMOTE | FOLL_LRU);
Overly long line here.
> +/*
> + * NOTE: Technically this should goto check_pfn label. However, page->_mapcount
> + * is never incremented for device pages that are mmap through DAX mechanism
> + * using pmem driver mounted into ext4 filesystem. When these pages are unmap,
> + * zap_pte_range is called and vm_normal_page return a valid page with
> + * page_mapcount() = 0, before page_remove_rmap is called.
> + */
Please properly indent comments.
> + * zone, as long as the pte's are present and vm_normal_lru_page() succeeds. These
> * pages also get pinned.
Another overly long line here.
Powered by blists - more mailing lists