Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mkcomposefs: make it cpuset aware #355

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tools/mkcomposefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <linux/fsverity.h>
#include <linux/fs.h>
#include <pthread.h>
#include <sched.h>
#include <sys/sysinfo.h>

static void oom(void)
Expand Down Expand Up @@ -1442,6 +1443,11 @@ static void digest_to_string(const uint8_t *csum, char *buf)

static int get_cpu_count(void)
{
cpu_set_t set;

if (sched_getaffinity(0, sizeof(set), &set) == 0)
return CPU_COUNT(&set);

return get_nprocs();
}

Expand Down
Loading