Re: [PATCH] cpuset semaphore depth check optimize

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

 



Paul Jackson <[email protected]> wrote:
>
>  +static struct task_struct *cpuset_sem_owner;
>  +static int cpuset_sem_depth;
>   
>   /*
>    * The global cpuset semaphore cpuset_sem can be needed by the
>  @@ -200,16 +202,19 @@ static DECLARE_MUTEX(cpuset_sem);
>   
>   static inline void cpuset_down(struct semaphore *psem)
>   {
>  -	if (current->cpuset_sem_nest_depth == 0)
>  +	if (cpuset_sem_owner != current) {
>   		down(psem);
>  -	current->cpuset_sem_nest_depth++;
>  +		cpuset_sem_owner = current;
>  +	}
>  +	cpuset_sem_depth++;
>   }

Better, but still hacky.  The rest of the kernel manages to avoid the need
for nestable semaphores by getting the locking design sorted out.  Can
cpusets do that sometime?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux