lkml.org 
[lkml]   [2013]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH] Linux kernel Wait-Free Concurrent Queue Implementation
From
Date
On Mon, 2013-03-11 at 17:36 -0400, Mathieu Desnoyers wrote:
> +/*
> + * Do not put head and tail on the same cache-line if concurrent
> + * enqueue/dequeue are expected from many CPUs. This eliminates
> + * false-sharing between enqueue and dequeue.
> + */
> +struct wfcq_head {
> + struct wfcq_node node;
> + struct mutex lock;
> +};
> +
> +struct wfcq_tail {
> + struct wfcq_node *p;
> +};


If you want to force separate cachelines for SMP, this would be

struct wfcq_head {
struct wfcq_node node;
struct mutex lock;
} ____cacheline_aligned_in_smp;

struct wfcq_tail {
struct wfcq_node *p;
} ____cacheline_aligned_in_smp;



\
 
 \ /
  Last update: 2013-03-15 02:21    [W:0.082 / U:2.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site