linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Nitin Gupta <ngupta@vflare.org>, Dave Hansen <dave@linux.vnet.ibm.com>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>,
	Greg KH <greg@kroah.com>, Brian King <brking@linux.vnet.ibm.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	linux-mm@kvack.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: RE: [PATCH 1/5] staging: zsmalloc: zsmalloc memory allocation library
Date: Wed, 8 Feb 2012 13:39:52 -0800 (PST)	[thread overview]
Message-ID: <52f90b19-84b5-4e97-952a-373bdfeaa77d@default> (raw)
In-Reply-To: <4F32E1D2.4010809@vflare.org>

(cc'ing the _real_ GregKH to avoid further bounces... Greg, if
you care, the whole thread is on the various lists)

> From: Nitin Gupta [mailto:ngupta@vflare.org]
> Subject: Re: [PATCH 1/5] staging: zsmalloc: zsmalloc memory allocation library
> 
> On 02/08/2012 01:28 PM, Dave Hansen wrote:
> 
> > On 02/08/2012 09:53 AM, Nitin Gupta wrote:
> >> vmap() is not just slower but also does memory allocations at various
> >> places. Under memory pressure, this may cause failure in reading a
> >> stored object just because we failed to map it. Also, it allocates VA
> >> region each time its called which is a real big waste when we can simply
> >> pre-allocate 2 * PAGE_SIZE'ed VA regions (per-cpu).
> >
> > Yeah, vmap() is a bit heavy-handed.  I'm just loathe to go mucking
> > around in the low-level pagetables too much.  Just seems like there'll
> > be a ton of pitfalls, like arch-specific TLB flushing, and it _seems_
> > like one of the existing kernel mechanisms should work.
> >
> > I guess if you've exhaustively explored all of the existing kernel
> > mapping mechanisms and found none of them to work, and none of them to
> > be in any way suitably adaptable to your use, you should go ahead and
> > roll your own.  I guess you do at least use alloc_vm_area().  What made
> > map_vm_area() unsuitable for your needs?  If you're remapping, you
> > should at least be guaranteed not to have to allocate pte pages.
> 
> map_vm_area() needs 'struct vm_struct' parameter but for mapping kernel
> allocated pages within kernel, what should we pass here?  I think we can
> instead use map_kernel_range_noflush() -- surprisingly
> unmap_kernel_range_noflush() is exported but this one is not.

Creating a dependency on a core kernel change (even just an EXPORT_SYMBOL)
is probably not a good idea.  Unless Dave vehemently objects, I'd suggest
implementing it both ways, leaving the method that relies on the
kernel change ifdef'd out, and add this to "the list of things that
need to be done before zcache can be promoted out of staging".

  reply	other threads:[~2012-02-08 21:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-09 22:51 [PATCH 0/5] staging: zsmalloc: memory allocator for compressed pages Seth Jennings
2012-01-09 22:51 ` [PATCH 1/5] staging: zsmalloc: zsmalloc memory allocation library Seth Jennings
2012-01-20 22:12   ` Andrew Morton
2012-01-23 14:36     ` Seth Jennings
2012-01-23 18:57     ` Nitin Gupta
2012-01-23 19:40       ` Andrew Morton
2012-01-26 19:12   ` Dave Hansen
2012-02-06 17:26     ` Seth Jennings
2012-02-08 16:39       ` Dave Hansen
2012-02-08 17:15         ` Dan Magenheimer
2012-02-08 17:21           ` Dave Hansen
2012-02-08 17:53         ` Nitin Gupta
2012-02-08 18:28           ` Dave Hansen
2012-02-08 20:57             ` Nitin Gupta
2012-02-08 21:39               ` Dan Magenheimer [this message]
2012-02-08 23:07                 ` Dave Hansen
2012-01-09 22:51 ` [PATCH 2/5] staging: add zsmalloc to Kconfig/Makefile Seth Jennings
2012-01-09 22:51 ` [PATCH 3/5] staging: zcache: replace xvmalloc with zsmalloc Seth Jennings
2012-02-09  1:13   ` Greg KH
2012-02-09 14:36     ` Seth Jennings
2012-02-09 14:55     ` Seth Jennings
2012-02-09 18:13       ` Greg KH
2012-02-09 18:28         ` Seth Jennings
2012-01-09 22:51 ` [PATCH 4/5] staging: zram: " Seth Jennings
2012-01-09 22:52 ` [PATCH 5/5] staging: zram: remove xvmalloc Seth Jennings
2012-01-09 23:09 ` [PATCH 0/5] staging: zsmalloc: memory allocator for compressed pages Greg KH
2012-01-09 23:26   ` Seth Jennings
2012-01-20 22:03 ` Andrew Morton
2012-01-23 14:27   ` Seth Jennings
     [not found] <<1326149520-31720-1-git-send-email-sjenning@linux.vnet.ibm.com>
     [not found] ` <<1326149520-31720-2-git-send-email-sjenning@linux.vnet.ibm.com>
2012-01-11 17:19   ` [PATCH 1/5] staging: zsmalloc: zsmalloc memory allocation library Dan Magenheimer
2012-01-11 17:45     ` Seth Jennings
2012-01-11 21:44       ` Dan Magenheimer

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=52f90b19-84b5-4e97-952a-373bdfeaa77d@default \
    --to=dan.magenheimer@oracle.com \
    --cc=brking@linux.vnet.ibm.com \
    --cc=dave@linux.vnet.ibm.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=greg@kroah.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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).