All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [PATCH 2 of 8] libxl: introduce libxl_set_relative_memory_target
Date: Wed, 1 Sep 2010 11:55:46 +0100	[thread overview]
Message-ID: <alpine.DEB.2.00.1009011148170.2714@kaball-desktop> (raw)
In-Reply-To: <19581.15132.637644.952724@mariner.uk.xensource.com>

On Tue, 31 Aug 2010, Ian Jackson wrote:
> Stefano Stabellini writes ("[Xen-devel] [PATCH 2 of 8] libxl: introduce libxl_set_relative_memory_target"):
> > libxl: introduce libxl_set_relative_memory_target
> > 
> > Introduce libxl_set_relative_memory_target to modify the memory target
> > of a domain by a relative amount of memory in a single xenstore
> > transaction.
> > Modify libxl_set_memory_target to use xenstore transactions.
> > The first time we are reading/writing dom0 memory target, fill the
> > informations in xenstore if they are missing.
> 
> >  int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid,
> >                              uint32_t target_memkb, int enforce)
> 
> See my earlier comments about memory targets.  I don't think it makes
> much sense to give a domain a memory target and then let it exceed it.
> So I think "enforce" should be abolished (as if it were always set).
> 

I can do that.


> Also please can you try to keep your code to <75ish columns ? :-)
> (75 because there should be room for > and + quoting without wrap
> damage.)
> 

Yes. We need a CODING_STILE, I'll post a patch with it later on.


> >  int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid,
> >                 uint32_t target_memkb, int enforce)
> ...
> > +int libxl_set_relative_memory_target(libxl_ctx *ctx, uint32_t
> > +            domid, int32_t relative_target_memkb, int enforce)
> 
> These functions are really rather too similar for my taste.  They
> seem to differ only in whether they read the existing target and add
> it on.  Surely they should be combined.
> 
> Also, I don't really think this patch to introuce the relative setting
> function should involves adding a lot of code to the absolute setting
> function.  It's a shame that we have to set so many different copies
> of the same value, but if we do then that should be done in a separate
> patch first perhaps ?
> 

The separate patch is a good idea, but merging the two functions
together will result in code harder to read in the implementation of a
very important function.

  reply	other threads:[~2010-09-01 10:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-27 11:18 [PATCH 2 of 8] libxl: introduce libxl_set_relative_memory_target Stefano Stabellini
2010-08-31 17:25 ` Ian Jackson
2010-09-01 10:55   ` Stefano Stabellini [this message]
2010-09-01 18:01   ` Jeremy Fitzhardinge
2010-09-01 20:03     ` Dan Magenheimer
2010-09-01 21:17       ` Jeremy Fitzhardinge
2010-09-01 21:49         ` Dan Magenheimer
2010-09-02  9:15     ` Stefano Stabellini

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=alpine.DEB.2.00.1009011148170.2714@kaball-desktop \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.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.