All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kyungsik Lee <kyungsik.lee@lge.com>
To: dsterba@suse.cz
Cc: Chris Mason <chris.mason@fusionio.com>,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	hyojun.im@lge.com, chan.jeong@lge.com,
	raphael.andy.lee@gmail.com
Subject: Re: [PATCH v2] btrfs: use kmalloc for lzo de/compress buffer
Date: Fri, 22 Feb 2013 17:26:31 +0900	[thread overview]
Message-ID: <20130222082630.GA21294@Corona> (raw)
In-Reply-To: <20130221134153.GD27541@twin.jikos.cz>

On Thu, Feb 21, 2013 at 02:41:53PM +0100, David Sterba wrote:
> On Mon, Feb 18, 2013 at 04:56:04PM +0900, Kyungsik Lee wrote:
> > @@ -55,8 +55,9 @@ static struct list_head *lzo_alloc_workspace(void)
> >  		return ERR_PTR(-ENOMEM);
> >  
> >  	workspace->mem = vmalloc(LZO1X_MEM_COMPRESS);
> > -	workspace->buf = vmalloc(PAGE_CACHE_SIZE);
> > -	workspace->cbuf = vmalloc(lzo1x_worst_compress(PAGE_CACHE_SIZE));
> > +	workspace->buf = kmalloc(PAGE_CACHE_SIZE, GFP_NOFS);
> > +	workspace->cbuf = kmalloc(lzo1x_worst_compress(PAGE_CACHE_SIZE),
> 
> This is still larger than usual page size and allocator may issue a
> warning, so if we want to use kmalloc (it's ~4.4k in size and likely to
> be available, but not always due to possible page fragmentation), the
> __GFP_NOWARN should be supplied and if the allocation fails fall back to
> vmalloc.
Right, there shoud be another fixed verson for this.

Thanks,
Kyungsik

      reply	other threads:[~2013-02-22  8:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-18  7:56 [PATCH v2] btrfs: use kmalloc for lzo de/compress buffer Kyungsik Lee
2013-02-21 13:41 ` David Sterba
2013-02-22  8:26   ` Kyungsik Lee [this message]

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=20130222082630.GA21294@Corona \
    --to=kyungsik.lee@lge.com \
    --cc=chan.jeong@lge.com \
    --cc=chris.mason@fusionio.com \
    --cc=dsterba@suse.cz \
    --cc=hyojun.im@lge.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raphael.andy.lee@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.