On Thu, 1 Mar 2018 06:50:58 -0800 Matthew Wilcox <wi...@infradead.org> wrote:
> On Thu, Mar 01, 2018 at 03:44:12PM +0300, Kirill A. Shutemov wrote: > > On Thu, Mar 01, 2018 at 08:17:50AM +0100, Martin Schwidefsky wrote: > > > Yeah, that is a nasty bit of code. On s390 we have 2K page tables (pte) > > > but 4K pages. If we use full pages for the pte tables we waste 2K of > > > memory for each of the tables. So we allocate 4K and split it into two > > > 2K pieces. Now we have to keep track of the pieces to be able to free > > > them again. > > > > Have you considered to use slab for page table allocation instead? > > IIRC some architectures practice this already. > > You're not allowed to do that any more. Look at pgtable_page_ctor(), > or rather ptlock_init(). Oh yes, I forgot about the ptl. This takes up some fields in struct page which the slab/slub cache want to use as well. -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.