ctx->stop = true;
ctx->start = true; for (i = 0; i < nr; i++)
pthread_join(tids[i], NULL);
}
void test_task_storage_map_stress_lookup(void)
{ #define MAX_NR_THREAD 4096 unsignedint i, nr = 256, loop = 8192, cpu = 0; struct read_bpf_task_storage_busy *skel;
pthread_t tids[MAX_NR_THREAD]; struct lookup_ctx ctx;
cpu_set_t old, new; constchar *cfg; int err;
cfg = getenv("TASK_STORAGE_MAP_NR_THREAD"); if (cfg) {
nr = atoi(cfg); if (nr > MAX_NR_THREAD)
nr = MAX_NR_THREAD;
}
cfg = getenv("TASK_STORAGE_MAP_NR_LOOP"); if (cfg)
loop = atoi(cfg);
cfg = getenv("TASK_STORAGE_MAP_PIN_CPU"); if (cfg)
cpu = atoi(cfg);
/* Only for a fully preemptible kernel */ if (!skel->kconfig->CONFIG_PREEMPTION) {
printf("%s SKIP (no CONFIG_PREEMPTION)\n", __func__);
read_bpf_task_storage_busy__destroy(skel);
skips++; return;
}
/* Save the old affinity setting */
sched_getaffinity(getpid(), sizeof(old), &old);
/* Pinned on a specific CPU */
CPU_ZERO(&new);
CPU_SET(cpu, &new);
sched_setaffinity(getpid(), sizeof(new), &new);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.