Re: [dm-devel] [PATCH] dm-crypt: allocate compound pages if possible

2023-02-16 Thread Mikulas Patocka
On Thu, 16 Feb 2023, Matthew Wilcox wrote: > > - len = (remaining_size > PAGE_SIZE) ? PAGE_SIZE : remaining_size; > > - > > - bio_add_page(clone, page, len, 0); > > +have_pages: > > + page->compound_order = order; > > No. You'll corrupt the next page if page is o

Re: [dm-devel] [PATCH] dm-crypt: allocate compound pages if possible

2023-02-16 Thread Matthew Wilcox
On Thu, Feb 16, 2023 at 12:47:08PM -0500, Mikulas Patocka wrote: > + while (order > 0) { > + page = alloc_pages(gfp_mask > + | __GFP_NOMEMALLOC | __GFP_NORETRY | > __GFP_NOWARN, order); ... | __GFP_COMP > page = mempool_al

[dm-devel] [PATCH] dm-crypt: allocate compound pages if possible

2023-02-16 Thread Mikulas Patocka
It was reported that allocating pages for the write buffer in dm-crypt causes measurable overhead [1]. This patch changes dm-crypt to allocate compound pages if they are available. If not, we fall back to the mempool. [1] https://listman.redhat.com/archives/dm-devel/2023-February/053284.html Sig