lkml.org 
[lkml]   [2010]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] introduce sys_membarrier(): process-wide memory barrier (v5)
On Tue, Jan 12, 2010 at 09:00:23PM -0800, Nicholas Miell wrote:
> On Tue, 2010-01-12 at 20:37 -0500, Mathieu Desnoyers wrote:
> > + * sys_membarrier - issue memory barrier on current process running threads
> > + * @expedited: (0) Lowest overhead. Few milliseconds latency.
> > + * (1) Few microseconds latency.
> > + *
>
> Alternate ABI proposal, keeping the possibility of future expansion in
> mind:
>
> /*
> Mandatory flags to the membarrier system call that the kernel must
> understand are in the high 16 bits.
> */
> #define MEMBARRIER_MANDATORY_MASK 0xFFFF0000
>
> /*
> Optional hints that the kernel can ignore are in the low 16 bits.
> */
> #define MEMBARRIER_OPTIONAL_MASK 0x0000FFFF
>
> #define MEMBARRIER_EXPEDITED 1
>
> extern int membarrier(unsigned int flags);
>
> And then add to the system call itself:
>
> if ((flags & MEMBARRIER_MANDATORY_MASK) != 0)
> return -EINVAL;

Why is it OK to ignore the developer's request for an expedited
membarrer()? The guy who expected the syscall to complete in a few
microseconds might not be so happy to have it take many milliseconds.
By the same token, the guy who specified non-expedited so as to minimally
disturb other threads in the system might not be so happy to see them
all be IPIed for no good reason. ;-)

Thanx, Paul


\
 
 \ /
  Last update: 2010-01-13 06:33    [W:0.178 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site