Checking hlt_cpus_mask is a no-op, and the mask will be removed in the
next commit. However, we can use the more recent CPU_ABSENT() macro to
check the status.
Details
Details
- Reviewers
kib olce - Commits
- rG63d4f044225d: g_eli: better handling of absent/disabled CPUs
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
| sys/geom/eli/g_eli.c | ||
|---|---|---|
| 1087 | Why not use CPU_FOREACH() and break out of the loop if the counter >= threads? | |
| sys/geom/eli/g_eli.c | ||
|---|---|---|
| 1087 | I concur. In any case, the debug message does not seem useful and I'd remove it. | |
| sys/geom/eli/g_eli.c | ||
|---|---|---|
| 1087 | I hoped for this, but it is difficult to handle both cases because CPU_FOREACH() embeds a CPU_ABSENT() check. Let's take an example scenario:
What will happen is that it will skip thread creation on i == 2, and break on loop i == 5, resulting in only 5 threads created. So this ends up being the simplest change that does not further obfuscate things. | |
| sys/geom/eli/g_eli.c | ||
|---|---|---|
| 1087 | for (i = 0;;) {
CPU_FOREACH(k) {
do_something_allocate_thread_on(k);
if (++i >= threads)
goto done;
}
}
done:; | |
| sys/geom/eli/g_eli.c | ||
|---|---|---|
| 1087 | I do not think this is better. Let me propose a follow-up which disentangles the sc_cpubind and !sc_cpubind cases. | |