Subject: Re: [RFCv2 7/9] pseries: Add support for hash table resizing

From: Anshuman Khandual <[email-masked]>
Date: Mon, 01 Feb 2016 14:01:09 +0530

On 01/29/2016 10:54 AM, David Gibson wrote:

> +
> +static int pseries_lpar_resize_hpt_commit(void *data)
> +{
> +	struct hpt_resize_state *state = data;
> +
> +	state->commit_rc = plpar_resize_hpt_commit(0, state->shift);
> +	if (state->commit_rc != H_SUCCESS)
> +		return -EIO;
> +
> +	/* Hypervisor has transitioned the HTAB, update our globals */
> +	ppc64_pft_size = state->shift;
> +	htab_size_bytes = 1UL << ppc64_pft_size;
> +	htab_hash_mask = (htab_size_bytes >> 7) - 1;
> +
> +	return 0;
> +}
> +

snip

> +/* Must be called in user context */
> +static int pseries_lpar_resize_hpt(unsigned long shift)
> +{
> +	struct hpt_resize_state state = {
> +		.shift = shift,
> +		.commit_rc = H_FUNCTION,

> +
> +	rc = stop_machine(pseries_lpar_resize_hpt_commit, &state, NULL);

With my limited knowledge of stop_machine, wondering if the current
or any future version of 'pseries_lpar_resize_hpt_commit' function
can cause HPT change (page fault path) while stop is executing it.