[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86: fix preemptable page type handling(v2)


  • To: Jan Beulich <jbeulich@xxxxxxxxxx>
  • From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
  • Date: Thu, 30 Oct 2008 15:00:20 +0000
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 30 Oct 2008 08:00:46 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: Ack6oDoOeJ+0fqaTEd23kwAX8io7RQ==
  • Thread-topic: [Xen-devel] [PATCH] x86: fix preemptable page type handling(v2)

On 30/10/08 14:56, "Jan Beulich" <jbeulich@xxxxxxxxxx> 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



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.