Re: [PATCH] pi_stress: Clear affinity for DEADLINE tasks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Wed, 18 Feb 2015, Daniel Wagner wrote:

> Deadline tasks are not allowed to set smp affinity.
> 
> Signed-off-by: Daniel Wagner <daniel.wagner@xxxxxxxxxxxx>
> ---
> 
> Hi Clark,
> 
> I missed that one because I tested it only on a UP. Sorry about that.
> 
> cheers,
> daniel
> 
> src/pi_tests/pi_stress.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c
> index cf55712..aaa36c3 100644
> --- a/src/pi_tests/pi_stress.c
> +++ b/src/pi_tests/pi_stress.c
> @@ -882,8 +882,21 @@ void *high_priority(void *arg)
>  	pthread_barrier_t *loop_barr = &p->loop_barr;
>  	pthread_mutex_t *loop_mtx = &p->loop_mtx;
>  	int *loop = &p->loop;
> +	cpu_set_t cpu_mask;
> +	int i;
>  
>  	if (high_sa.sched_policy == SCHED_DEADLINE) {
> +		CPU_ZERO(&cpu_mask);
> +		for (i = 0; i < num_processors; i++)
> +			CPU_SET(i, &cpu_mask);
> +		status = sched_setaffinity(0, sizeof(cpu_set_t), &cpu_mask);
> +		if (status < 0) {
> +			pi_error
> +			    ("high_priority[%d]: set cpu affinity*dl): %x\n",
> +			    p->id, status);
> +			return NULL;
> +		}
> +
>  		status = sched_setattr(gettid(), &high_sa, 0);
>  		if (status < 0) {
>  			pi_error
> -- 
> 2.1.0
> 
> --

Signed-off-by: John Kacur <jkacur@xxxxxxxxxx>

(this will be in the next build)
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux