Commit 35bf403c authored by Florian Fischer's avatar Florian Fischer
Browse files

don't pin our thread

parent d11862a3
Pipeline #66513 passed with stage
in 1 minute and 12 seconds
......@@ -5,7 +5,7 @@ OBJ := $(addprefix bench-,$(SYSCALLS))
LDFLAGS := -luring -pthread -lrt
CFLAGS := -Werror -Wall -g -O3 -D_GNU_SOURCE
CFLAGS := -Werror -Wall -g -O3
# CFLAGS := -Werror -Wall -g -O0
.PHONY: all clean eval docker-eval check
......
#include <err.h>
#include <fcntl.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/eventfd.h>
#include <unistd.h>
#include "stopwatch.h"
......@@ -25,22 +23,11 @@ static int create_eventfd() {
return fd;
}
static void set_cpu_affinity(int cpu) {
cpu_set_t set;
// NOLINTNEXTLINE(clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling)
CPU_ZERO(&set);
CPU_SET(cpu, &set);
if (sched_setaffinity(getpid(), sizeof(set), &set) == -1)
err(EXIT_FAILURE, "sched_setaffinity failed");
}
int main() {
uint64_t cycles_sum = 0;
uint64_t nanos_sum = 0;
uint64_t write_buf = 1;
set_cpu_affinity(0);
int fd = create_eventfd();
init(fd);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment