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

Anshuman Khandual khandual at linux.vnet.ibm.com
Mon Feb 1 19:31:09 AEDT 2016


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.



More information about the Linuxppc-dev mailing list