linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@cs.helsinki.fi>
To: Nitin Gupta <ngupta@vflare.org>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
	"Hugh Dickins" <hugh.dickins@tiscali.co.uk>,
	"Ed Tomlinson" <edt@aei.ca>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	linux-mm-cc@laptop.org, "Ingo Molnar" <mingo@elte.hu>,
	"Frédéric Weisbecker" <fweisbec@gmail.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Greg KH" <greg@kroah.com>
Subject: Re: [PATCH 2/4] virtual block device driver (ramzswap)
Date: Tue, 15 Sep 2009 11:30:16 +0300	[thread overview]
Message-ID: <84144f020909150130r573df1e1jfe359b88387f94ad@mail.gmail.com> (raw)
In-Reply-To: <d760cf2d0909150121i7f6f45b9p76f8eb89ab0d5882@mail.gmail.com>

On Tue, Sep 15, 2009 at 11:21 AM, Nitin Gupta <ngupta@vflare.org> wrote:
> I don't want to ponder too much about this point now. If you all are okay
> with keeping this function buried in driver, I will do so. I'm almost tired
> maintaining this compcache thing outside of mainline.

Yup, whatever makes most sense to you.

>> Then make ramzswap depend on !CONFIG_ARM. In any case, CONFIG_ARM bits
>> really don't belong into drivers/block.
>
> ARM is an extremely important user of compcache -- Its currently being
> tested (unofficially) on Android, Nokia etc.

That's not a technical argument for keeping CONFIG_ARM in the driver.

>>>>> +
>>>>> +       trace_mark(ramzswap_lock_wait, "ramzswap_lock_wait");
>>>>> +       mutex_lock(&rzs->lock);
>>>>> +       trace_mark(ramzswap_lock_acquired, "ramzswap_lock_acquired");
>>>>
>>>> Hmm? What's this? I don't think you should be doing ad hoc
>>>> trace_mark() in driver code.
>>>
>>> This is not ad hoc. It is to see contention over this lock which I believe is a
>>> major bottleneck even on dual-cores. I need to keep this to measure improvements
>>> as I gradually make this locking more fine grained (using per-cpu buffer etc).
>>
>> It is ad hoc. Talk to the ftrace folks how to do it properly. I'd keep
>> those bits out-of-tree until the issue is resolved, really.
>
> /me is speechless.

That's fine, I CC'd the ftrace folks. Hopefully they'll be able to help you.

>
>>>>> +       rzs->compress_buffer = kzalloc(2 * PAGE_SIZE, GFP_KERNEL);
>>>>
>>>> Use alloc_pages(__GFP_ZERO) here?
>>>
>>> alloc pages then map them (i.e. vmalloc). What did we gain? With
>>> vmalloc, pages might
>>> not be physically contiguous which might hurt performance as
>>> compressor runs over this buffer.
>>>
>>> So, use kzalloc().
>>
>> I don't know what you're talking about. kzalloc() calls
>> __get_free_pages() directly for your allocation. You probably should
>> use that directly.
>
> What is wrong with kzalloc? I'm wholly totally stumped.
> I respect your time reviewing the code but this really goes over my head.
> We can continue arguing about get_pages vs kzalloc but I doubt if we will
> gain anything out of it.

The slab allocator needs metadata for the allocation so you're wasting
memory. If you really want *two pages*, why don't you simply use the
page allocator for that?

Btw, Nitin, why are you targeting drivers/block and not
drivers/staging at this point? It seems obvious enough that there are
still some issues that need to be ironed out (like the CONFIG_ARM
thing) so submitting the driver for inclusion in drivers/staging and
fixing it up there incrementally would likely save you from a lot of
trouble. Greg, does ramzswap sound like something that you'd be
willing to take?

                        Pekka

--
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:[~2009-09-15  8:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200909100215.36350.ngupta@vflare.org>
2009-09-09 21:19 ` [PATCH 2/4] virtual block device driver (ramzswap) Nitin Gupta
2009-09-14 20:10   ` Pekka Enberg
2009-09-15  6:39     ` Nitin Gupta
2009-09-15  7:30       ` Pekka Enberg
2009-09-15  8:21         ` Nitin Gupta
2009-09-15  8:30           ` Pekka Enberg [this message]
2009-09-15 15:26             ` Greg KH
2009-09-15 15:55               ` Nitin Gupta
2009-09-15 11:45         ` Ed Tomlinson
2009-09-15 12:42           ` Pekka Enberg
2009-09-15 13:14         ` Steven Rostedt
2009-09-15 13:43           ` Pekka Enberg
2009-09-15 14:08             ` Steven Rostedt
2009-09-09 21:21 ` [PATCH 4/4] documentation Nitin Gupta
2009-09-09 21:50 ` [PATCH 3/4] send callback when swap slot is freed Nitin Gupta
2009-09-09 21:53 ` [PATCH 1/4] xvmalloc memory allocator Nitin Gupta
2009-09-09 22:02 ` [PATCH 0/4] compcache: in-memory compressed swapping v2 Nitin Gupta
2009-09-12  2:24   ` Nitin Gupta
2009-09-13 19:07     ` Hugh Dickins
2009-09-14  4:04       ` 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=84144f020909150130r573df1e1jfe359b88387f94ad@mail.gmail.com \
    --to=penberg@cs.helsinki.fi \
    --cc=akpm@linux-foundation.org \
    --cc=edt@aei.ca \
    --cc=fweisbec@gmail.com \
    --cc=greg@kroah.com \
    --cc=hugh.dickins@tiscali.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm-cc@laptop.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=ngupta@vflare.org \
    --cc=rostedt@goodmis.org \
    /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).