Re: [PATCH v16] sys_membarrier(): system-wide memory barrier (generic, x86)

From: Mathieu Desnoyers
Date: Thu Apr 23 2015 - 09:45:47 EST


----- Original Message -----
> On Wed, 22 Apr 2015 17:40:51 -0700
> Stephen Hemminger <stephen@xxxxxxxxxxxxxxxxxx> wrote:
>
> > The syscall should just return 0.
> > Let the application not worry about how many CPU's are present
>
> +1

This is indeed how I implemented it initially. The nice thing
about this approach is that if the application don't care much
about the overhead of calling sys_membarrier on !SMP, returning
0 tells the application that sys_membarrier is indeed supported,
and that the application don't need to issue memory barriers on
the other target threads (compiler barrier is then sufficient),
which is correct.

I'll update the patch accordingly.

Thanks,

Mathieu

--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/