All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Deegan <Tim.Deegan@citrix.com>
To: "Jiang, Yunhong" <yunhong.jiang@intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [RFC][PATCH] Basic support for page offline
Date: Fri, 13 Feb 2009 17:03:41 +0000	[thread overview]
Message-ID: <20090213170341.GC17060@york.uk.xensource.com> (raw)
In-Reply-To: <E2263E4A5B2284449EEBD0AAB751098401C781605D@PDSMSX501.ccr.corp.intel.com>

Hi, 

So a few more comments on the detail of those patches.  

I had imagined that you would suspend the domain, then update the p2m
and pagetables in the guest memory from the _tools_.  That would involve
less code (possibly none) in Xen, and is how I'd prefer it.  But your
current approach probably catches more of the corner cases (grant tables
&c) than the tools could, so that's OK.

update_pgtable_entry() needs a more descriptive name!  It updates
potentially very many pagetable entries, and in a particular way. 
Also it probably ought to be static.

The reference counting in update_pgtable_entry() is confusing -- it
should probably always do reference counting for both the old and new
entries; that seems more robust than only doing the decrements there and
manually setting count_info and type_info on the new page in
replace_page.

In replace_page(), your error paths are confused: the ENOMEM error case
drops a ref that wasn't taken and if get_page() fails you don't free the
allocated page.

Both of those functions need comments describing what they do and what
their arguments are.

memory_page_offline(): again, check your error and exit paths; I'm
pretty sure you leak references to the domain.  Why does this take a
domain, by the way?  can't it just take a range of MFNs and figure out
the owning domain for each one as it goes?

Also, isn't the returned nr_offlined value always one less than was
requested?  You write back the _index_ of the highest-numbered frame
that you _attempted_ to offline, which is a pretty confusing number.

Other than that, the xen mm patch just needs a good scattering of
comments.

The tools patch is enormous, and seems to copy big chunks of
xc_domain_save into a new file.  And since Xen is now doing the hard
work of pagetable manipulation, I don't think you even need to suspend
the guest -- just pausing it should be enough and is much easier.

If you do need to use the suspend/resume code in later stages of
development, please don't copy it out; just make a libxc function that
calls the existing functions appropriately.

I'll leave page_offline_xen.patch to Keir since he's said he'll do it,
but 700 new lines of code seems like quite a lot -- surely some subsets
of he existing buddy splitting and merging code could be split out and
reused?

Cheers,

Tim.

-- 
Tim Deegan <Tim.Deegan@citrix.com>
Principal Software Engineer, Citrix Systems (R&D) Ltd.
[Company #02300071, SL9 0DZ, UK.]

  parent reply	other threads:[~2009-02-13 17:03 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-09  8:54 [RFC][PATCH] Basic support for page offline Jiang, Yunhong
2009-02-10  9:15 ` Tim Deegan
2009-02-10  9:29   ` Jiang, Yunhong
2009-02-10  9:42     ` Tim Deegan
2009-02-10 10:29     ` Keir Fraser
2009-02-10 21:09 ` Frank van der Linden
2009-02-11  0:16   ` Jiang, Yunhong
2009-02-11  0:39     ` Frank van der Linden
2009-02-11  1:08       ` Jiang, Yunhong
2009-02-11  4:08         ` Frank Van Der Linden
2009-02-13 17:03 ` Tim Deegan [this message]
2009-02-13 17:36   ` Keir Fraser
2009-02-15  9:39     ` Jiang, Yunhong
2009-02-15  9:48   ` Jiang, Yunhong
2009-02-16 14:31     ` Tim Deegan
2009-02-16 15:25       ` Jiang, Yunhong
2009-02-18 14:51       ` Jiang, Yunhong
2009-02-18 15:20         ` Tim Deegan
2009-02-19  8:44           ` Jiang, Yunhong
2009-02-19 14:37             ` Jiang, Yunhong
2009-03-02 11:56               ` Tim Deegan
2009-03-04  8:23                 ` Jiang, Yunhong
2009-03-18 10:24                 ` [PATCH] Support swap a page from user space tools -- Was " Jiang, Yunhong
2009-03-18 10:32                   ` Jiang, Yunhong
2009-03-18 10:42                     ` Keir Fraser
2009-03-18 17:34                   ` Tim Deegan
2009-03-19  5:12                     ` Jiang, Yunhong
2009-03-19  9:32                       ` Tim Deegan
2009-03-19  9:45                         ` Keir Fraser
2009-03-19  9:57                           ` Jiang, Yunhong
2009-03-19 10:13                             ` Keir Fraser
2009-03-19 13:01                               ` Jiang, Yunhong
2009-03-19 13:22                                 ` Keir Fraser
2009-03-19 14:26                                   ` Jiang, Yunhong
2009-03-19 14:36                                     ` Keir Fraser
2009-03-19 14:42                                       ` Jiang, Yunhong
2009-03-19 14:48                                         ` Jiang, Yunhong
2009-03-19 16:45                                         ` Keir Fraser
2009-03-20  2:52                                           ` Jiang, Yunhong
2009-03-20  9:05                                             ` Keir Fraser
2009-03-20  9:16                                               ` Jiang, Yunhong
2009-03-20  9:28                                                 ` Keir Fraser
2009-03-20  9:42                                                   ` Re: [PATCH] Support swap a page from user space tools-- " Jan Beulich
2009-03-20  9:48                                                     ` Keir Fraser
2009-03-20  9:44                                                   ` Re: [PATCH] Support swap a page from user space tools -- " Jiang, Yunhong
2009-03-20  9:52                                                     ` Keir Fraser
2009-03-20  9:37                                             ` Re: [PATCH] Support swap a page from user spacetools " Jan Beulich
2009-03-20  9:41                                               ` Jiang, Yunhong
2009-03-20  9:42                                               ` Keir Fraser
2009-03-20  9:52                                                 ` Jiang, Yunhong
2009-03-20  9:58                                                   ` Keir Fraser
2009-03-20  9:59                                                     ` Jiang, Yunhong
2009-03-20 10:03                                                       ` Keir Fraser
2009-03-20 10:05                                                         ` Jiang, Yunhong
2009-03-20 10:07                                                         ` Keir Fraser
2009-03-20 10:13                                                           ` Jiang, Yunhong
2009-03-20 10:21                                                             ` Keir Fraser
2009-03-20 10:36                                                               ` Jiang, Yunhong
2009-03-20 10:40                                                                 ` Keir Fraser
2009-03-20 10:19                                                           ` Keir Fraser
2009-03-19  9:48                         ` [PATCH] Support swap a page from user space tools " Jiang, Yunhong

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=20090213170341.GC17060@york.uk.xensource.com \
    --to=tim.deegan@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=yunhong.jiang@intel.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.