[RFC/PATCH 1/7] ARM: ARM11 MPCore: pgd_alloc is not preempt safe

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Oct 6 12:35:20 EDT 2011


On Thu, Oct 06, 2011 at 01:08:28AM -0400, gdavis at mvista.com wrote:
> @@ -31,6 +32,9 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
>  	if (!new_pgd)
>  		goto no_pgd;
>  
> +	if (cache_ops_need_broadcast())
> +		get_cpu();

Is there something wrong with preempt_disable() here and preempt_enable()
below?  If it's preempt that we're concerned about, these are the correct
interfaces to be used.

> +
>  	memset(new_pgd, 0, USER_PTRS_PER_PGD * sizeof(pgd_t));
>  
>  	/*
> @@ -42,6 +46,9 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
>  
>  	clean_dcache_area(new_pgd, PTRS_PER_PGD * sizeof(pgd_t));
>  
> +	if (cache_ops_need_broadcast())
> +		put_cpu();
> +



More information about the linux-arm-kernel mailing list