From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: Re: [PATCH] xen/balloon: export balloon hotplug page stats to sysfs Date: Thu, 20 Mar 2014 14:01:20 +0000 Message-ID: <20140320140120.GP16807@zion.uk.xensource.com> References: <1395320213-29921-1-git-send-email-wei.liu2@citrix.com> <532AEB4D.1050900@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <532AEB4D.1050900@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel Cc: Boris Ostrovsky , Wei Liu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, Mar 20, 2014 at 01:21:17PM +0000, David Vrabel wrote: > On 20/03/14 12:56, Wei Liu wrote: > > --- a/drivers/xen/xen-balloon.c > > +++ b/drivers/xen/xen-balloon.c > > @@ -129,6 +129,11 @@ module_exit(balloon_exit); > > BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(balloon_stats.current_pages)); > > BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_low)); > > BALLOON_SHOW(high_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_high)); > > +#ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG > > +BALLOON_SHOW(hotplug_kb, "%lu\n", PAGES2KB(balloon_stats.hotplug_pages)); > > +BALLOON_SHOW(balloon_hotplug_kb, "%lu\n", > > + PAGES2KB(balloon_stats.balloon_hotplug)); > > +#endif > > Extending the kernel's ABI requires justification. How are these values > useful for userspace tools? If it's just for debug purposes, using > debugfs would be preferred. > My original thought is that userspace tools have the right to know how many pages balloon driver has. Missing the hotplug pages is not very desirable. But I have yet known any tools that require balloon hotplug page stat -- after all they probably don't know there's such a thing is nothing is exported. Also note that these BALLOON_SHOW fields are read-only, so exporting more stats won't in any way affect system behavior. If you prefer debugfs I can switch to use that. Wei. > David