On Tue, Jan 07, 2020 at 01:18:06AM +0100, Eduard Shishkin wrote: > >> @@ -61,7 +64,17 @@ struct list_head *zlib_alloc_workspace(unsigned int level) > >> zlib_inflate_workspacesize()); > >> workspace->strm.workspace = kvmalloc(workspacesize, GFP_KERNEL); > >> workspace->level = level; > >> - workspace->buf = kmalloc(PAGE_SIZE, GFP_KERNEL); > >> + workspace->buf = NULL; > >> + if (zlib_deflate_dfltcc_enabled()) { > >> + workspace->buf = kmalloc(ZLIB_DFLTCC_BUF_SIZE, > >> + __GFP_NOMEMALLOC | __GFP_NORETRY | > >> + __GFP_NOWARN | GFP_NOIO); > > Why do you use this wild GFP flag combination? I can understand NOWARN, > > but why the others? > > This addresses the following complaint about order 2 allocation with > GFP_KERNEL: > https://lkml.org/lkml/2019/11/26/417 > > Below a fallback to a single page is implemented, as it was suggested. > So, the initial (more costly) allocation should be made with minimal > aggression > to allow the allocator fail. Otherwise, that fallback simply doesn't > make sense. > Hence, such a combination. I see, please add a comment explaining that.