lkml.org 
[lkml]   [2005]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] cpuset semaphore depth check optimize
Paul Jackson writes:

[...]

>
> 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++;
> }

Err... note that now cpuset_{down,up}() take semaphore as a parameter,
but use global cpuset_sem_{owner,depth} to track recursion. This, I
believe, is an inconsistent API---it only works for a single semaphore
as passing different @psem's would lead to deadlocks and meaningless
owner and depth.

What about making these functions

static void cpuset_{down,up}(void);

operating on cpuset_sem internally?

"I won't rest till it's the best ..." :-)

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

\
 
 \ /
  Last update: 2005-09-12 13:52    [W:0.545 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site