linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Nitin Gupta <ngupta@vflare.org>
Cc: Minchan Kim <minchan@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Seth Jennings <sjenning@linux.vnet.ibm.com>
Subject: RE: [PATCH 2/2] zram: clean up handle
Date: Thu, 7 Jun 2012 14:20:40 -0700 (PDT)	[thread overview]
Message-ID: <06bd08dd-b8b4-4c7d-b8f3-f74f6270e51b@default> (raw)
In-Reply-To: <4FD11A3C.801@vflare.org>

> From: Nitin Gupta [mailto:ngupta@vflare.org]
> > Nitin, can zsmalloc allow full page allocation by assigning
> > an actual physical pageframe (which is what zram does now)?
> > Or will it allocate PAGE_SIZE bytes which zsmalloc will allocate
> > crossing a page boundary which, presumably, will have much worse
> > impact on page allocator availability when these pages are
> > "reclaimed" via your swap notify callback.
> 
> zsmalloc does not add any object headers, so when allocating PAGE_SIZE
> you get a separate page from as if you did alloc_page(). So, it does not
> span page boundaries.
> 
> > Though this may be rare across all workloads, it may turn out
> > to be very common for certain workloads (e.g. if the workload
> > has many dirty anonymous pages that are already compressed
> > by userland).
> >
> > It may not be worth cleaning up the code if it causes
> > performance issues with this case.
> >
> > And anyway can zsmalloc handle and identify to the caller pages
> > that are both compressed and "native" (uncompressed)?  It
> > certainly has to handle both if you remove ZRAM_UNCOMPRESSED
> > as compressing some pages actually results in more than
> > PAGE_SIZE bytes.  So you need to record somewhere that
> > this "compressed page" is special and that must somehow
> > be communicated to the caller of your "get" routine.
> >
> > (Just trying to save Minchan from removing all that code but
> > then needing to add it back again.)
> 
> zsmalloc cannot identify compressed vs uncompressed pages. However, in
> zram, we can tell if the page is uncompressed using table[i]->size which
> is set to PAGE_SIZE for uncompressed pages.   Pages that compress to
> more than PAGE_SIZE (i.e. expand on compression) are stored
> as-is/uncompressed and thus will have size field set to PAGE_SIZE.
> 
> Thus, we do not require ZRAM_UNCOMPRESSED flag when using zsmalloc for
> both compressed and uncompressed pages.

Good to know.  Nice work in zsmalloc and zram!

Dan

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2012-06-07 21:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-05  7:23 [PATCH 1/2] zsmalloc: zsmalloc: use unsigned long instead of void * Minchan Kim
2012-06-05  7:23 ` [PATCH 2/2] zram: clean up handle Minchan Kim
2012-06-06  5:04   ` Nitin Gupta
2012-06-07  2:46     ` Minchan Kim
2012-06-07 20:47       ` Dan Magenheimer
2012-06-07 21:16         ` Nitin Gupta
2012-06-07 21:20           ` Dan Magenheimer [this message]
2012-06-06  4:00 ` [PATCH 1/2] zsmalloc: zsmalloc: use unsigned long instead of void * Nitin Gupta

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=06bd08dd-b8b4-4c7d-b8f3-f74f6270e51b@default \
    --to=dan.magenheimer@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.org \
    --cc=sjenning@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).