From: Alex Elder <elder@dreamhost.com>
To: Sage Weil <sage@newdream.net>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH, v2] ceph: use a shared zero page rather than one per messenger
Date: Fri, 02 Mar 2012 19:43:32 -0800 [thread overview]
Message-ID: <4F519364.5080604@dreamhost.com> (raw)
In-Reply-To: <4F515472.60101@dreamhost.com>
On 03/02/2012 03:14 PM, Alex Elder wrote:
> On 03/02/2012 11:21 AM, Sage Weil wrote:
>> On Wed, 29 Feb 2012, Alex Elder wrote:
>>
>>> Each messenger allocates a page to be used when writing zeroes
>>> out in the event of error or other abnormal condition. Instead,
>>> use the kernel ZERO_PAGE() for that purpose.
>>>
>>> Signed-off-by: Alex Elder<elder@dreamhost.com>
>>> ---
>>> v2: Updated to use kernel ZERO_PAGE()
>>>
>>> include/linux/ceph/messenger.h | 1
. . .
>>> + BUG_ON(zero_page_address != NULL);
>>> + zero_page_address = kmap(zero_page);
>>
>> I've always assumed that kmap() used up an expensive slot, and that pages
>> should be kmapped only when needed. Myabe this should still be done
>> inside write_partial_msg_pages()?
>
> I think that's only for high memory pages, and especially for
> the kernel zero page I doubt that's where it sits. But you
> make a good point.
>
> I'll look into it a bit and if we're not guaranteed it's
> "free" to do this I'll re-post with the kmap done inside where
> it's needed. I'll follow up either way.
OK, here's how I'm going to resolve this. First, the result of this
patch makes things no worse than they were before with respect to
hanging onto a zero page mapping. Previously, every messenger
allocated its own zero page, and mapped it and held onto that
mapping for the duration of that messenger's lifetime.
With this patch in place, we don't allocate any new page (we
use ZERO_PAGE()) and grab one mapping to it used for all
messengers until the subsystem is shut down.
So basically, since things are left no worse than before, I'm
going to keep this as-is.
I will do a follow-on patch soon (after I get through committing
all those I've put out this week) that will affect the way the
zero page is handled.
-Alex
prev parent reply other threads:[~2012-03-03 3:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-29 3:06 [PATCH] ceph: use a shared zero page rather than one per messenger Alex Elder
2012-02-29 4:18 ` Christoph Hellwig
2012-02-29 17:40 ` [PATCH, v2] " Alex Elder
2012-03-02 19:21 ` Sage Weil
2012-03-02 23:14 ` Alex Elder
2012-03-03 3:43 ` Alex Elder [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=4F519364.5080604@dreamhost.com \
--to=elder@dreamhost.com \
--cc=ceph-devel@vger.kernel.org \
--cc=sage@newdream.net \
/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.