mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kyeongdon Kim <kyeongdon.kim@lge.com>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Minchan Kim <minchan@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: Re: Re: [PATCH v3 2/2] zram: try vmalloc() after kmalloc()
Date: Tue, 1 Dec 2015 15:35:57 +0900	[thread overview]
Message-ID: <565D3FCD.3060503@lge.com> (raw)
In-Reply-To: <20151201051652.GA894@swordfish>


On 2015-12-01 오후 2:16, Sergey Senozhatsky wrote:
> 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
>> > > ..<snip>..
>> > > <4>[ 2289.092411][0] KDKIM: zcomp_lz4_create: 24: ret = (null)
>> > > <4>[ 2289.092546][0] KDKIM: zcomp_lz4_create: 30: ret =
> ffffff80028b5000
>> > > ..<snip>..
>> > > <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

Let me give you a simple code of it.

@test #1 (previous shared log)
 kmalloc(f | __GFP_NOMEMALLOC)
  __vmalloc(f | __GFP_NOMEMALLOC)
// can find failure both

@test #2 (previous shared log)
 kmalloc(f | __GFP_NOMEMALLOC)
__vmalloc(f) 	
// removed '__GFP_NOMEMALLOC' from vmalloc() only, and cannot find
failure from vmalloc()

And like you said, I made a quick check to see a failure about kmalloc()
without the flag :

@test #3
 kmalloc(f)
__vmalloc(f | __GFP_NOMEMALLOC)
// removed '__GFP_NOMEMALLOC' from zmalloc() only
// and cannot find failure from zmalloc(), but in this case, it's hard
to find failure from vmalloc() because of already allocation mostly from
zsmalloc()

log message (test #3) :
<4>[  186.763605][1] KDKIM: zcomp_lz4_create: 24: ret = ffffffc002030000
<4>[  186.776652][1] KDKIM: zcomp_lz4_create: 24: ret = ffffffc0020f0000
<4>[  186.811423][1] KDKIM: zcomp_lz4_create: 24: ret = ffffffc002108000
<4>[  186.816744][1] KDKIM: zcomp_lz4_create: 24: ret = ffffffc002000000
<4>[  186.816796][1] KDKIM: zcomp_lz4_create: 24: ret = ffffffc002008000

@test #4
 kmalloc(f)
__vmalloc(f)
// cannot find failure both until now

log message (test #4) :
<4>[  641.440468][7] KDKIM: zcomp_lz4_create: 24: ret = ffffffc002190000
<snip>
<4>[  922.182980][7] KDKIM: zcomp_lz4_create: 24: ret = ffffffc002208000
<snip>
<4>[  923.197593][7] KDKIM: zcomp_lz4_create: 24: ret = ffffffc002020000
<snip>
<4>[  939.813499][7] KDKIM: zcomp_lz4_create: 24: ret = ffffffc0020a0000

So,is there another problem if we remove the flag from both sides?

Thanks,
Kyeongdon Kim

  reply	other threads:[~2015-12-01  6:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27  4:10 [PATCH v3 0/2] zram/zcomp: stream allocation fixes and tweaks Sergey Senozhatsky
2015-11-27  4:10 ` [PATCH v3 1/2] zram/zcomp: use GFP_NOIO to allocate streams Sergey Senozhatsky
2015-11-30  7:09   ` Minchan Kim
2015-11-27  4:10 ` [PATCH v3 2/2] zram: try vmalloc() after kmalloc() Sergey Senozhatsky
2015-11-30  7:10   ` Minchan Kim
2015-11-30 10:42     ` kyeongdon.kim
2015-11-30 11:14       ` Sergey Senozhatsky
2015-12-01  2:04         ` kyeongdon.kim
     [not found]       ` <20151130231841.GA960@bbox>
2015-12-01  0:33         ` Sergey Senozhatsky
2015-12-01  2:31         ` Re: " kyeongdon.kim
2015-12-01  4:44           ` Minchan Kim
     [not found]             ` <20151201045535.GA5999@bbox>
2015-12-01  5:16               ` Sergey Senozhatsky
2015-12-01  6:35                 ` Kyeongdon Kim [this message]
2015-12-01  7:15                   ` Sergey Senozhatsky
2015-12-01  7:33                     ` Sergey Senozhatsky
2015-12-01  8:16                     ` Minchan Kim
2015-12-01  9:11                       ` Sergey Senozhatsky
2015-12-01  7:24                   ` Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=565D3FCD.3060503@lge.com \
    --to=kyeongdon.kim@lge.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome