search for: do_relax

Displaying 4 results from an estimated 4 matches for "do_relax".

Did you mean: do_read
2016 Jan 21
1
[PATCH] tools/virtio: add ringtest utilities
...uses */ +#define barrier() asm volatile("" ::: "memory") + +/* Is there a portable way to do this? */ +#if defined(__x86_64__) || defined(__i386__) +#define cpu_relax() asm ("rep; nop" ::: "memory") +#else +#define cpu_relax() assert(0) +#endif + +extern bool do_relax; + +static inline void busy_wait(void) +{ + if (do_relax) + cpu_relax(); + else + /* prevent compiler from removing busy loops */ + barrier(); +} + +/* + * Not using __ATOMIC_SEQ_CST since gcc docs say they are only synchronized + * with other __ATOMIC_SEQ_CST calls. + */ +#define smp_mb() __sy...
2016 Jan 21
1
[PATCH] tools/virtio: add ringtest utilities
...uses */ +#define barrier() asm volatile("" ::: "memory") + +/* Is there a portable way to do this? */ +#if defined(__x86_64__) || defined(__i386__) +#define cpu_relax() asm ("rep; nop" ::: "memory") +#else +#define cpu_relax() assert(0) +#endif + +extern bool do_relax; + +static inline void busy_wait(void) +{ + if (do_relax) + cpu_relax(); + else + /* prevent compiler from removing busy loops */ + barrier(); +} + +/* + * Not using __ATOMIC_SEQ_CST since gcc docs say they are only synchronized + * with other __ATOMIC_SEQ_CST calls. + */ +#define smp_mb() __sy...
2017 Apr 07
0
[PATCH 2/3] ringtest: support test specific parameters
...ools/virtio/ringtest/main.c b/tools/virtio/ringtest/main.c index f31353f..022ae95 100644 --- a/tools/virtio/ringtest/main.c +++ b/tools/virtio/ringtest/main.c @@ -20,6 +20,7 @@ int runcycles = 10000000; int max_outstanding = INT_MAX; int batch = 1; +int param = 0; bool do_sleep = false; bool do_relax = false; @@ -247,6 +248,11 @@ static const struct option longopts[] = { .val = 'b', }, { + .name = "param", + .has_arg = required_argument, + .val = 'p', + }, + { .name = "sleep", .has_arg = no_argument, .val = 's', @@ -274,6 +280,7 @@...
2017 Apr 07
0
[PATCH 2/3] ringtest: support test specific parameters
...ools/virtio/ringtest/main.c b/tools/virtio/ringtest/main.c index f31353f..022ae95 100644 --- a/tools/virtio/ringtest/main.c +++ b/tools/virtio/ringtest/main.c @@ -20,6 +20,7 @@ int runcycles = 10000000; int max_outstanding = INT_MAX; int batch = 1; +int param = 0; bool do_sleep = false; bool do_relax = false; @@ -247,6 +248,11 @@ static const struct option longopts[] = { .val = 'b', }, { + .name = "param", + .has_arg = required_argument, + .val = 'p', + }, + { .name = "sleep", .has_arg = no_argument, .val = 's', @@ -274,6 +280,7 @@...