Style: remove trailing spaces/tabs.
Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
39eb07f172
commit
8f4d74eb1e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=356292
@ -95,7 +95,7 @@ struct umtx_pi {
|
|||||||
/* Reference count */
|
/* Reference count */
|
||||||
int pi_refcount;
|
int pi_refcount;
|
||||||
|
|
||||||
/* List entry to link umtx holding by thread */
|
/* List entry to link umtx holding by thread */
|
||||||
TAILQ_ENTRY(umtx_pi) pi_link;
|
TAILQ_ENTRY(umtx_pi) pi_link;
|
||||||
|
|
||||||
/* List entry in hash */
|
/* List entry in hash */
|
||||||
@ -138,7 +138,7 @@ struct umtx_q {
|
|||||||
|
|
||||||
/* Inherited priority from PP mutex */
|
/* Inherited priority from PP mutex */
|
||||||
u_char uq_inherited_pri;
|
u_char uq_inherited_pri;
|
||||||
|
|
||||||
/* Spare queue ready to be reused */
|
/* Spare queue ready to be reused */
|
||||||
struct umtxq_queue *uq_spare_queue;
|
struct umtxq_queue *uq_spare_queue;
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ struct umtxq_chain {
|
|||||||
TAILQ_HEAD(,umtx_pi) uc_pi_list;
|
TAILQ_HEAD(,umtx_pi) uc_pi_list;
|
||||||
|
|
||||||
#ifdef UMTX_PROFILING
|
#ifdef UMTX_PROFILING
|
||||||
u_int length;
|
u_int length;
|
||||||
u_int max_length;
|
u_int max_length;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
@ -292,7 +292,7 @@ static struct mtx umtx_lock;
|
|||||||
|
|
||||||
#ifdef UMTX_PROFILING
|
#ifdef UMTX_PROFILING
|
||||||
static void
|
static void
|
||||||
umtx_init_profiling(void)
|
umtx_init_profiling(void)
|
||||||
{
|
{
|
||||||
struct sysctl_oid *chain_oid;
|
struct sysctl_oid *chain_oid;
|
||||||
char chain_name[10];
|
char chain_name[10];
|
||||||
@ -300,8 +300,8 @@ umtx_init_profiling(void)
|
|||||||
|
|
||||||
for (i = 0; i < UMTX_CHAINS; ++i) {
|
for (i = 0; i < UMTX_CHAINS; ++i) {
|
||||||
snprintf(chain_name, sizeof(chain_name), "%d", i);
|
snprintf(chain_name, sizeof(chain_name), "%d", i);
|
||||||
chain_oid = SYSCTL_ADD_NODE(NULL,
|
chain_oid = SYSCTL_ADD_NODE(NULL,
|
||||||
SYSCTL_STATIC_CHILDREN(_debug_umtx_chains), OID_AUTO,
|
SYSCTL_STATIC_CHILDREN(_debug_umtx_chains), OID_AUTO,
|
||||||
chain_name, CTLFLAG_RD, NULL, "umtx hash stats");
|
chain_name, CTLFLAG_RD, NULL, "umtx hash stats");
|
||||||
SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(chain_oid), OID_AUTO,
|
SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(chain_oid), OID_AUTO,
|
||||||
"max_length0", CTLFLAG_RD, &umtxq_chains[0][i].max_length, 0, NULL);
|
"max_length0", CTLFLAG_RD, &umtxq_chains[0][i].max_length, 0, NULL);
|
||||||
@ -406,7 +406,7 @@ sysctl_debug_umtx_chains_clear(SYSCTL_HANDLER_ARGS)
|
|||||||
uc = &umtxq_chains[i][j];
|
uc = &umtxq_chains[i][j];
|
||||||
mtx_lock(&uc->uc_lock);
|
mtx_lock(&uc->uc_lock);
|
||||||
uc->length = 0;
|
uc->length = 0;
|
||||||
uc->max_length = 0;
|
uc->max_length = 0;
|
||||||
mtx_unlock(&uc->uc_lock);
|
mtx_unlock(&uc->uc_lock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -441,7 +441,7 @@ umtxq_sysinit(void *arg __unused)
|
|||||||
umtxq_chains[i][j].uc_waiters = 0;
|
umtxq_chains[i][j].uc_waiters = 0;
|
||||||
#ifdef UMTX_PROFILING
|
#ifdef UMTX_PROFILING
|
||||||
umtxq_chains[i][j].length = 0;
|
umtxq_chains[i][j].length = 0;
|
||||||
umtxq_chains[i][j].max_length = 0;
|
umtxq_chains[i][j].max_length = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -613,7 +613,7 @@ umtxq_insert_queue(struct umtx_q *uq, int q)
|
|||||||
if (uc->length > uc->max_length) {
|
if (uc->length > uc->max_length) {
|
||||||
uc->max_length = uc->length;
|
uc->max_length = uc->length;
|
||||||
if (uc->max_length > max_length)
|
if (uc->max_length > max_length)
|
||||||
max_length = uc->max_length;
|
max_length = uc->max_length;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -770,7 +770,7 @@ umtxq_signal_thread(struct umtx_q *uq)
|
|||||||
wakeup(uq);
|
wakeup(uq);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
tstohz(const struct timespec *tsp)
|
tstohz(const struct timespec *tsp)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
@ -825,7 +825,7 @@ abs_timeout_gethz(struct abs_timeout *timo)
|
|||||||
struct timespec tts;
|
struct timespec tts;
|
||||||
|
|
||||||
if (timespeccmp(&timo->end, &timo->cur, <=))
|
if (timespeccmp(&timo->end, &timo->cur, <=))
|
||||||
return (-1);
|
return (-1);
|
||||||
timespecsub(&timo->end, &timo->cur, &tts);
|
timespecsub(&timo->end, &timo->cur, &tts);
|
||||||
return (tstohz(&tts));
|
return (tstohz(&tts));
|
||||||
}
|
}
|
||||||
@ -1009,7 +1009,7 @@ kern_umtx_wake(struct thread *td, void *uaddr, int n_wake, int is_private)
|
|||||||
{
|
{
|
||||||
struct umtx_key key;
|
struct umtx_key key;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if ((ret = umtx_key_get(uaddr, TYPE_SIMPLE_WAIT,
|
if ((ret = umtx_key_get(uaddr, TYPE_SIMPLE_WAIT,
|
||||||
is_private ? THREAD_SHARE : AUTO_SHARE, &key)) != 0)
|
is_private ? THREAD_SHARE : AUTO_SHARE, &key)) != 0)
|
||||||
return (ret);
|
return (ret);
|
||||||
@ -1522,7 +1522,7 @@ umtx_pi_check_loop(struct umtx_pi *pi)
|
|||||||
/*
|
/*
|
||||||
* Propagate priority when a thread is blocked on POSIX
|
* Propagate priority when a thread is blocked on POSIX
|
||||||
* PI mutex.
|
* PI mutex.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
umtx_propagate_priority(struct thread *td)
|
umtx_propagate_priority(struct thread *td)
|
||||||
{
|
{
|
||||||
@ -1773,7 +1773,7 @@ umtx_pi_ref(struct umtx_pi *pi)
|
|||||||
/*
|
/*
|
||||||
* Decrease reference count for a PI mutex, if the counter
|
* Decrease reference count for a PI mutex, if the counter
|
||||||
* is decreased to zero, its memory space is freed.
|
* is decreased to zero, its memory space is freed.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
umtx_pi_unref(struct umtx_pi *pi)
|
umtx_pi_unref(struct umtx_pi *pi)
|
||||||
{
|
{
|
||||||
@ -1972,7 +1972,7 @@ do_lock_pi(struct thread *td, struct umutex *m, uint32_t flags,
|
|||||||
*/
|
*/
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
umtxq_lock(&uq->uq_key);
|
umtxq_lock(&uq->uq_key);
|
||||||
umtxq_busy(&uq->uq_key);
|
umtxq_busy(&uq->uq_key);
|
||||||
umtxq_unlock(&uq->uq_key);
|
umtxq_unlock(&uq->uq_key);
|
||||||
@ -2099,7 +2099,7 @@ do_unlock_pi(struct thread *td, struct umutex *m, uint32_t flags, bool rb)
|
|||||||
umtx_pi_disown(pi);
|
umtx_pi_disown(pi);
|
||||||
/* get highest priority thread which is still sleeping. */
|
/* get highest priority thread which is still sleeping. */
|
||||||
uq_first = TAILQ_FIRST(&pi->pi_blocked);
|
uq_first = TAILQ_FIRST(&pi->pi_blocked);
|
||||||
while (uq_first != NULL &&
|
while (uq_first != NULL &&
|
||||||
(uq_first->uq_flags & UQF_UMTXQ) == 0) {
|
(uq_first->uq_flags & UQF_UMTXQ) == 0) {
|
||||||
uq_first = TAILQ_NEXT(uq_first, uq_lockq);
|
uq_first = TAILQ_NEXT(uq_first, uq_lockq);
|
||||||
}
|
}
|
||||||
@ -2624,7 +2624,7 @@ do_cv_wait(struct thread *td, struct ucond *cv, struct umutex *m,
|
|||||||
if (timeout != NULL)
|
if (timeout != NULL)
|
||||||
abs_timeout_init(&timo, clockid, (wflags & CVWAIT_ABSTIME) != 0,
|
abs_timeout_init(&timo, clockid, (wflags & CVWAIT_ABSTIME) != 0,
|
||||||
timeout);
|
timeout);
|
||||||
|
|
||||||
umtxq_lock(&uq->uq_key);
|
umtxq_lock(&uq->uq_key);
|
||||||
if (error == 0) {
|
if (error == 0) {
|
||||||
error = umtxq_sleep(uq, "ucond", timeout == NULL ?
|
error = umtxq_sleep(uq, "ucond", timeout == NULL ?
|
||||||
@ -2673,7 +2673,7 @@ do_cv_signal(struct thread *td, struct ucond *cv)
|
|||||||
if (error == -1)
|
if (error == -1)
|
||||||
return (EFAULT);
|
return (EFAULT);
|
||||||
if ((error = umtx_key_get(cv, TYPE_CV, GET_SHARE(flags), &key)) != 0)
|
if ((error = umtx_key_get(cv, TYPE_CV, GET_SHARE(flags), &key)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
umtxq_lock(&key);
|
umtxq_lock(&key);
|
||||||
umtxq_busy(&key);
|
umtxq_busy(&key);
|
||||||
cnt = umtxq_count(&key);
|
cnt = umtxq_count(&key);
|
||||||
@ -2702,7 +2702,7 @@ do_cv_broadcast(struct thread *td, struct ucond *cv)
|
|||||||
if (error == -1)
|
if (error == -1)
|
||||||
return (EFAULT);
|
return (EFAULT);
|
||||||
if ((error = umtx_key_get(cv, TYPE_CV, GET_SHARE(flags), &key)) != 0)
|
if ((error = umtx_key_get(cv, TYPE_CV, GET_SHARE(flags), &key)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
|
|
||||||
umtxq_lock(&key);
|
umtxq_lock(&key);
|
||||||
umtxq_busy(&key);
|
umtxq_busy(&key);
|
||||||
@ -3124,7 +3124,7 @@ do_rw_unlock(struct thread *td, struct urwlock *rwlock)
|
|||||||
}
|
}
|
||||||
if (state & URWLOCK_WRITE_OWNER) {
|
if (state & URWLOCK_WRITE_OWNER) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
rv = casueword32(&rwlock->rw_state, state,
|
rv = casueword32(&rwlock->rw_state, state,
|
||||||
&oldstate, state & ~URWLOCK_WRITE_OWNER);
|
&oldstate, state & ~URWLOCK_WRITE_OWNER);
|
||||||
if (rv == -1) {
|
if (rv == -1) {
|
||||||
error = EFAULT;
|
error = EFAULT;
|
||||||
@ -3279,7 +3279,7 @@ do_sem_wake(struct thread *td, struct _usem *sem)
|
|||||||
if (error == -1)
|
if (error == -1)
|
||||||
return (EFAULT);
|
return (EFAULT);
|
||||||
if ((error = umtx_key_get(sem, TYPE_SEM, GET_SHARE(flags), &key)) != 0)
|
if ((error = umtx_key_get(sem, TYPE_SEM, GET_SHARE(flags), &key)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
umtxq_lock(&key);
|
umtxq_lock(&key);
|
||||||
umtxq_busy(&key);
|
umtxq_busy(&key);
|
||||||
cnt = umtxq_count(&key);
|
cnt = umtxq_count(&key);
|
||||||
@ -3400,7 +3400,7 @@ do_sem2_wake(struct thread *td, struct _usem2 *sem)
|
|||||||
if (rv == -1)
|
if (rv == -1)
|
||||||
return (EFAULT);
|
return (EFAULT);
|
||||||
if ((error = umtx_key_get(sem, TYPE_SEM, GET_SHARE(flags), &key)) != 0)
|
if ((error = umtx_key_get(sem, TYPE_SEM, GET_SHARE(flags), &key)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
umtxq_lock(&key);
|
umtxq_lock(&key);
|
||||||
umtxq_busy(&key);
|
umtxq_busy(&key);
|
||||||
cnt = umtxq_count(&key);
|
cnt = umtxq_count(&key);
|
||||||
@ -3456,12 +3456,12 @@ static inline int
|
|||||||
umtx_copyin_umtx_time(const void *addr, size_t size, struct _umtx_time *tp)
|
umtx_copyin_umtx_time(const void *addr, size_t size, struct _umtx_time *tp)
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
if (size <= sizeof(struct timespec)) {
|
if (size <= sizeof(struct timespec)) {
|
||||||
tp->_clockid = CLOCK_REALTIME;
|
tp->_clockid = CLOCK_REALTIME;
|
||||||
tp->_flags = 0;
|
tp->_flags = 0;
|
||||||
error = copyin(addr, &tp->_timeout, sizeof(struct timespec));
|
error = copyin(addr, &tp->_timeout, sizeof(struct timespec));
|
||||||
} else
|
} else
|
||||||
error = copyin(addr, tp, sizeof(struct _umtx_time));
|
error = copyin(addr, tp, sizeof(struct _umtx_time));
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
return (error);
|
return (error);
|
||||||
@ -3695,7 +3695,7 @@ __umtx_op_rw_wrlock(struct thread *td, struct _umtx_op_args *uap)
|
|||||||
if (uap->uaddr2 == NULL) {
|
if (uap->uaddr2 == NULL) {
|
||||||
error = do_rw_wrlock(td, uap->obj, 0);
|
error = do_rw_wrlock(td, uap->obj, 0);
|
||||||
} else {
|
} else {
|
||||||
error = umtx_copyin_umtx_time(uap->uaddr2,
|
error = umtx_copyin_umtx_time(uap->uaddr2,
|
||||||
(size_t)uap->uaddr1, &timeout);
|
(size_t)uap->uaddr1, &timeout);
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
return (error);
|
return (error);
|
||||||
@ -4203,12 +4203,12 @@ umtx_copyin_umtx_time32(const void *addr, size_t size, struct _umtx_time *tp)
|
|||||||
{
|
{
|
||||||
struct umtx_time32 t32;
|
struct umtx_time32 t32;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
t32.clockid = CLOCK_REALTIME;
|
t32.clockid = CLOCK_REALTIME;
|
||||||
t32.flags = 0;
|
t32.flags = 0;
|
||||||
if (size <= sizeof(struct timespec32))
|
if (size <= sizeof(struct timespec32))
|
||||||
error = copyin(addr, &t32.timeout, sizeof(struct timespec32));
|
error = copyin(addr, &t32.timeout, sizeof(struct timespec32));
|
||||||
else
|
else
|
||||||
error = copyin(addr, &t32, sizeof(struct umtx_time32));
|
error = copyin(addr, &t32, sizeof(struct umtx_time32));
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
return (error);
|
return (error);
|
||||||
@ -4269,7 +4269,7 @@ __umtx_op_wait_umutex_compat32(struct thread *td, struct _umtx_op_args *uap)
|
|||||||
if (uap->uaddr2 == NULL)
|
if (uap->uaddr2 == NULL)
|
||||||
tm_p = NULL;
|
tm_p = NULL;
|
||||||
else {
|
else {
|
||||||
error = umtx_copyin_umtx_time32(uap->uaddr2,
|
error = umtx_copyin_umtx_time32(uap->uaddr2,
|
||||||
(size_t)uap->uaddr1, &timeout);
|
(size_t)uap->uaddr1, &timeout);
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
return (error);
|
return (error);
|
||||||
|
Loading…
Reference in New Issue
Block a user