runq: Fix printing status word bits
'rqsw_t' is 'unsigned long', strictly longer than integers on 64-bit
platforms.
While here, factor out the print format for a status word.
Fixes: d2ac231616 ("Make the run queue parameters machine dependent...")
MFC after: 1 month
Event: Kitchener-Waterloo Hackathon 202506
Sponsored by: The FreeBSD Foundation
This commit is contained in:
@@ -326,7 +326,9 @@ runq_sw_set_not_empty_op(int idx, int sw_idx, rqsw_t sw_bit, rqsw_t *swp)
|
||||
rqsw_t old_sw __unused = *swp;
|
||||
|
||||
*swp |= sw_bit;
|
||||
CTR4(KTR_RUNQ, "runq_sw_set_not_empty: idx=%d sw_idx=%d bits=%#x->%#x",
|
||||
CTR4(KTR_RUNQ,
|
||||
"runq_sw_set_not_empty: idx=%d sw_idx=%d "
|
||||
"bits=" RQSW_PRI "->" RQSW_PRI,
|
||||
idx, sw_idx, old_sw, *swp);
|
||||
return (0);
|
||||
}
|
||||
@@ -349,7 +351,9 @@ runq_sw_set_empty_op(int idx, int sw_idx, rqsw_t sw_bit, rqsw_t *swp)
|
||||
rqsw_t old_sw __unused = *swp;
|
||||
|
||||
*swp &= ~sw_bit;
|
||||
CTR4(KTR_RUNQ, "runq_sw_set_empty: idx=%d sw_idx=%d bits=%#x->%#x",
|
||||
CTR4(KTR_RUNQ,
|
||||
"runq_sw_set_empty: idx=%d sw_idx=%d "
|
||||
"bits=" RQSW_PRI "->" RQSW_PRI,
|
||||
idx, sw_idx, old_sw, *swp);
|
||||
return (0);
|
||||
}
|
||||
@@ -525,7 +529,8 @@ runq_findq(struct runq *const rq, const int lvl_min, const int lvl_max,
|
||||
goto return_idx;
|
||||
return (-1);
|
||||
return_idx:
|
||||
CTR4(KTR_RUNQ, "runq_findq: bits=%#x->%#x i=%d idx=%d",
|
||||
CTR4(KTR_RUNQ,
|
||||
"runq_findq: bits=" RQSW_PRI "->" RQSW_PRI " i=%d idx=%d",
|
||||
(*rqsw)[i], w, i, idx);
|
||||
return (idx);
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ struct thread;
|
||||
|
||||
typedef unsigned long rqsw_t; /* runq's status words type. */
|
||||
#define RQSW_BPW (sizeof(rqsw_t) * NBBY) /* Bits per runq word. */
|
||||
#define RQSW_PRI "%#lx" /* printf() directive. */
|
||||
|
||||
/* Number of status words to cover RQ_NQS queues. */
|
||||
#define RQSW_NB (howmany(RQ_NQS, RQSW_BPW))
|
||||
|
||||
Reference in New Issue
Block a user