Subject: Re: [RFCv2 9/9] pseries: Automatically resize HPT for memory hot add/remove

From: David Gibson <[email-masked]>
Date: Mon, 1 Feb 2016 21:55:24 +1100

On Mon, Feb 01, 2016 at 02:21:46PM +0530, Anshuman Khandual wrote:
> On 01/29/2016 10:54 AM, David Gibson wrote:
> >  #ifdef CONFIG_MEMORY_HOTPLUG
> > +void resize_hpt_for_hotplug(unsigned long new_mem_size)
> > +{
> > +	unsigned target_hpt_shift;
> > +
> > +	if (!ppc_md.resize_hpt)
> > +		return;
> > +
> > +	target_hpt_shift = htab_shift_for_mem_size(new_mem_size);
> > +
> > +	/*
> > +	 * To avoid lots of HPT resizes if memory size is fluctuating
> > +	 * across a boundary, we deliberately have some hysterisis
> 
> 
> What do you mean by 'memory size is fluctuating across a boundary' ?
> Through memory hotplug interface ? Why some one will do that ?

I was thinking it might be possible to have some management system
that automatically adjusts memory size based on load, and if that
happened to land on a boundary you could get nasty behaviour.

> I
> can understand why we dont have this check in the sysfs debug path
> as we would like to test any memory HPT re sizing scenario we want
> in any sequence of increase or decrease we want.
> 
> Overall the RFC V2 looks pretty good. Looking forward to see the
> host side of the code for this feature.

The qemu host side has been posted to [email-masked] already.
I haven't started on a KVM HV implementation yet.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson