Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1172456
| From | Daniel Kiper <daniel.kiper@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCHv1 6/8] xen/balloon: only hotplug additional memory if required |
| Date | 2015-06-25 23:20 +0200 |
| Message-ID | <pFmIX-3FZ-23@gated-at.bofh.it> (permalink) |
| References | <pFiYF-6KG-17@gated-at.bofh.it> <pFiYG-6KG-39@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Jun 25, 2015 at 06:11:01PM +0100, David Vrabel wrote:
> Now that we track the total number of pages (included hotplugged
> regions), it is easy to determine if more memory needs to be
> hotplugged.
>
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> ---
> drivers/xen/balloon.c | 16 +++++++++++++---
> 1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
> index 960ac79..dd41da8 100644
> --- a/drivers/xen/balloon.c
> +++ b/drivers/xen/balloon.c
> @@ -241,12 +241,22 @@ static void release_memory_resource(struct resource *resource)
> * bit set). Real size of added memory is established at page onlining stage.
> */
>
> -static enum bp_state reserve_additional_memory(long credit)
> +static enum bp_state reserve_additional_memory(void)
> {
> + long credit;
> struct resource *resource;
> int nid, rc;
> unsigned long balloon_hotplug;
>
> + credit = balloon_stats.target_pages - balloon_stats.total_pages;
> +
> + /*
> + * Already hotplugged enough pages? Wait for them to be
> + * onlined.
> + */
Comment is wrong or at least misleading. Both values does not depend on onlining.
> + if (credit <= 0)
> + return BP_EAGAIN;
Not BP_EAGAIN for sure. It should be BP_DONE but then balloon_process() will go
into loop until memory is onlined at least up to balloon_stats.target_pages.
BP_ECANCELED does work but it is misleading because it is not an error. So, maybe
we should introduce BP_STOP (or something like that) which works like BP_ECANCELED
and is not BP_ECANCELED.
Daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCHv1 6/8] xen/balloon: only hotplug additional memory if required Daniel Kiper <daniel.kiper@oracle.com> - 2015-06-25 23:20 +0200
csiph-web