Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753152AbbKXH6S (ORCPT ); Tue, 24 Nov 2015 02:58:18 -0500 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:37037 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752469AbbKXH6R (ORCPT ); Tue, 24 Nov 2015 02:58:17 -0500 X-Original-SENDERIP: 156.147.1.127 X-Original-MAILFROM: kyeongdon.kim@lge.com X-Original-SENDERIP: 10.168.80.212 X-Original-MAILFROM: kyeongdon.kim@lge.com Subject: Re: Re: [PATCH v3] zram: try vmalloc() after kmalloc() To: Andrew Morton References: <1448259675-29888-1-git-send-email-kyeongdon.kim@lge.com> <20151123145226.63df6232c1f74898a980fdf2@linux-foundation.org> Cc: minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, linux-kernel@vger.kernel.org From: Kyeongdon Kim Message-ID: <56541831.8020408@lge.com> Date: Tue, 24 Nov 2015 16:56:33 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151123145226.63df6232c1f74898a980fdf2@linux-foundation.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2307 Lines: 65 Hello Andrew, On 2015-11-24 오전 7:52, Andrew Morton wrote: > On Mon, 23 Nov 2015 15:21:15 +0900 Kyeongdon Kim > wrote: > >> When we're using LZ4 multi compression streams for zram swap, >> we found out page allocation failure message in system running test. >> That was not only once, but a few(2 - 5 times per test). >> Also, some failure cases were continually occurring to try allocation >> order 3. >> >> In order to make parallel compression private data, we should call >> kzalloc() with order 2/3 in runtime(lzo/lz4). But if there is no order >> 2/3 size memory to allocate in that time, page allocation fails. >> This patch makes to use vmalloc() as fallback of kmalloc(), this >> prevents page alloc failure warning. >> >> After using this, we never found warning message in running test, also >> It could reduce process startup latency about 60-120ms in each case. >> >> ... >> >> --- a/drivers/block/zram/zcomp_lz4.c >> +++ b/drivers/block/zram/zcomp_lz4.c >> @@ -10,17 +10,25 @@ >> #include >> #include >> #include >> +#include >> +#include >> >> #include "zcomp_lz4.h" >> >> static void *zcomp_lz4_create(void) >> { >> - return kzalloc(LZ4_MEM_COMPRESS, GFP_KERNEL); >> + void *ret; >> + >> + ret = kzalloc(LZ4_MEM_COMPRESS, >> + __GFP_NORETRY|__GFP_NOWARN|__GFP_NOMEMALLOC); >> + if (!ret) >> + ret = vzalloc(LZ4_MEM_COMPRESS); >> + return ret; >> } > > What's the reasoning behind the modification to the gfp flags? > > It clears __GFP_FS, __GFP_IO and even __GFP_WAIT. I suspect the latter > two (at least) can be retained. And given that vmalloc() uses > GFP_KERNEL, what's the point in clearing those flags for the kmalloc() > case? > > If this change (or something like it) remains in place, it should have > a comment which fully explains the reasons, please. Sorry for the delay in replying, I just tried to remove that warning message. If there are more rightable gfp flags(like a code in Minchan's patch), we can use it. Thanks, -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/