From: Keir Fraser <keir.fraser@eu.citrix.com>
To: Jan Beulich <jbeulich@novell.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH] x86: fix preemptable page type handling(v2)
Date: Thu, 30 Oct 2008 15:00:20 +0000 [thread overview]
Message-ID: <C52F7C84.2897B%keir.fraser@eu.citrix.com> (raw)
In-Reply-To: <4909D910.76E4.0078.0@novell.com>
On 30/10/08 14:56, "Jan Beulich" <jbeulich@novell.com> wrote:
>> get_page() across all __put_page() operations and then skipping the
>> put_page() in some cases, for example, seems inefficient and also makes the
>> code less clear. Why would you do it that way?
>
> Because I can't handle a failure of get_page() (due to count overflow)
> once I'm past the put()s.
We could make get_page() always leave a few available references, and then
define a new get_page() variant which:
A. Does not check the owner
B. Knows that it is incrementing a non-zero count
C. Is able to use the few references never claimed by get_page().
This would be basically a small cmpxchg() loop. Since it's only executed
before setting PGT_partial we know that only one such special reference is
needed per page and we could just make get_page() leave headroom of one
reference.
Simpler code and faster code?
-- Keir
next prev parent reply other threads:[~2008-10-30 15:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-30 12:27 [PATCH] x86: fix preemptable page type handling (v2) Jan Beulich
2008-10-30 14:46 ` Keir Fraser
2008-10-30 14:56 ` [PATCH] x86: fix preemptable page type handling(v2) Jan Beulich
2008-10-30 15:00 ` Keir Fraser [this message]
2008-10-30 17:03 ` [PATCH] x86: fix preemptable page typehandling(v2) Jan Beulich
2008-10-30 17:27 ` Keir Fraser
2008-10-30 21:19 ` Use of the "has_shutdown_code" code in v3.2 Roger Cruz
2008-10-30 22:02 ` Keir Fraser
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=C52F7C84.2897B%keir.fraser@eu.citrix.com \
--to=keir.fraser@eu.citrix.com \
--cc=jbeulich@novell.com \
--cc=xen-devel@lists.xensource.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 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.