public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Nitin Gupta <ngupta@vflare.org>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>,
	Minchan Kim <minchan.kim@gmail.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Sam Hansen <solid.se7en@gmail.com>,
	Linux Driver Project <devel@linuxdriverproject.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [staging][zram] Fix handling of incompressible pages
Date: Mon, 22 Oct 2012 13:43:08 -0700	[thread overview]
Message-ID: <20121022204308.GA23993@kroah.com> (raw)
In-Reply-To: <1349916138-9011-1-git-send-email-ngupta@vflare.org>

On Wed, Oct 10, 2012 at 05:42:18PM -0700, Nitin Gupta wrote:
> Change 130f315a (staging: zram: remove special handle of uncompressed page)
> introduced a bug in the handling of incompressible pages which resulted in
> memory allocation failure for such pages.
> 
> When a page expands on compression, say from 4K to 4K+30, we were trying to
> do zsmalloc(pool, 4K+30). However, the maximum size which zsmalloc can
> allocate is PAGE_SIZE (for obvious reasons), so such allocation requests
> always return failure (0).
> 
> For a page that has compressed size larger than the original size (this may
> happen with already compressed or random data), there is no point storing
> the compressed version as that would take more space and would also require
> time for decompression when needed again. So, the fix is to store any page,
> whose compressed size exceeds a threshold (max_zpage_size), as-it-is i.e.
> without compression.  Memory required for storing this uncompressed page can
> then be requested from zsmalloc which supports PAGE_SIZE sized allocations.
> 
> Lastly, the fix checks that we do not attempt to "decompress" the page which
> we stored in the uncompressed form -- we just memcpy() out such pages.

So this fix needs to go to the stable 3.6 release also, right?

thanks,

greg k-h

  reply	other threads:[~2012-10-22 20:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-11  0:42 [PATCH] [staging][zram] Fix handling of incompressible pages Nitin Gupta
2012-10-22 20:43 ` Greg KH [this message]
2012-10-22 21:48   ` Nitin Gupta
  -- strict thread matches above, loose matches on Subject: below --
2012-10-09  1:32 Nitin Gupta
2012-10-09  8:46 ` Dan Carpenter
2012-10-09 13:31 ` Minchan Kim
2012-10-09 17:35   ` Nitin Gupta
2012-10-09 23:36     ` Minchan Kim

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=20121022204308.GA23993@kroah.com \
    --to=greg@kroah.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@linuxdriverproject.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan.kim@gmail.com \
    --cc=ngupta@vflare.org \
    --cc=sjenning@linux.vnet.ibm.com \
    --cc=solid.se7en@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