Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753323AbbLAFPx (ORCPT ); Tue, 1 Dec 2015 00:15:53 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:33949 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750918AbbLAFPw (ORCPT ); Tue, 1 Dec 2015 00:15:52 -0500 Date: Tue, 1 Dec 2015 14:16:52 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: "kyeongdon.kim" , Sergey Senozhatsky , Andrew Morton , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [PATCH v3 2/2] zram: try vmalloc() after kmalloc() Message-ID: <20151201051652.GA894@swordfish> References: <1448597449-17579-1-git-send-email-sergey.senozhatsky@gmail.com> <20151130231841.GA960@bbox> <565D068D.3050405@lge.com> <20151201044445.GA3817@bbox> <20151201045535.GA5999@bbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151201045535.GA5999@bbox> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2890 Lines: 83 On (12/01/15 13:55), Minchan Kim wrote: [..] > To clear my opinion, > > lzo_create(gfp_t flags) > { > void * ret = kmalloc(LZO1X_MEM_COMPRESS, flags); > if (!ret) > ret = vmalloc(LZO1X_MEM_COMPRESS, flasgs | GFP_NOMEMALLOC); > return ret; > } ah, ok, I see. I've a question. we had kmalloc(f | __GFP_NOMEMALLOC) __vmalloc(f | __GFP_NOMEMALLOC) which produced high failure rates for both kmalloc() and __vmalloc() test #1 > > > log message : [..] > > > [ 352.230608][0] zcomp_lz4_create: 32: ret = (null) > > > [ 352.230619][0] zcomp_lz4_create: 38: ret = (null) > > > [ 352.230888][0] zcomp_lz4_create: 32: ret = (null) > > > [ 352.230902][0] zcomp_lz4_create: 38: ret = (null) > > > [ 352.231406][0] zcomp_lz4_create: 32: ret = ffffffc002088000 > > > [ 352.234024][0] zcomp_lz4_create: 32: ret = (null) > > > [ 352.234060][0] zcomp_lz4_create: 38: ret = (null) > > > [ 352.234359][0] zcomp_lz4_create: 32: ret = (null) [..] > > > [ 352.234384][0] zcomp_lz4_create: 38: ret = (null) > > > [ 352.234618][0] zcomp_lz4_create: 32: ret = (null) > > > [ 352.234639][0] zcomp_lz4_create: 38: ret = (null) > > > [ 352.234667][0] zcomp_lz4_create: 32: ret = (null) > > > [ 352.235179][0] zcomp_lz4_create: 38: ret = ffffff80016a4000 Kyeongdon, do I understand correctly, that for the second test you removed '__GFP_NOMEMALLOC' from both kmalloc() and __vmalloc()? iow: kmalloc(f & ~__GFP_NOMEMALLOC) vmalloc(f & ~__GFP_NOMEMALLOC) test #2 : almost always failing kmalloc() and !NULL __vmalloc() > > > log message : > > > <4>[ 2288.954934][0] KDKIM: zcomp_lz4_create: 24: ret = (null) > > > <4>[ 2288.954972][0] KDKIM: zcomp_lz4_create: 30: ret = ffffff800287e000 > > > .... > > > <4>[ 2289.092411][0] KDKIM: zcomp_lz4_create: 24: ret = (null) > > > <4>[ 2289.092546][0] KDKIM: zcomp_lz4_create: 30: ret = ffffff80028b5000 > > > .... > > > <4>[ 2289.135628][0] KDKIM: zcomp_lz4_create: 24: ret = (null) > > > <4>[ 2289.135642][0] KDKIM: zcomp_lz4_create: 24: ret = (null) > > > <4>[ 2289.135729][0] KDKIM: zcomp_lz4_create: 30: ret = ffffff80028be000 > > > <4>[ 2289.135732][0] KDKIM: zcomp_lz4_create: 30: ret = ffffff80028c7000 if this is the case (__GFP_NOMEMALLOC removed from both kmalloc and __vmalloc), then proposed kmalloc(f & ~__GFP_NOMEMALLOC) __vmalloc(f | __GFP_NOMEMALLOC) can be very close to 'test #1 && test #2': kmalloc() fails (as in test #2) __vmalloc() fails (as in test #1) isn't it? -ss -- 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/