Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Apr 2016 18:24:16 +0200
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        freebsd-current@freebsd.org
Subject:   stall-free memory reads ? (possibly stale) ?
Message-ID:  <20160408162416.GA94343@onelab2.iet.unipi.it>

next in thread | raw e-mail | index | archive | help
Hi,
I have an application with two threads sharing a memory variable,
one continuously writing, one continuously reading.

Because of the way my system works, the reader can tolerate reading
stale data, but it should not stall on memory reads (the line
is on the local cache for the reader, just might be invalidated).

I was wondering if there is some way (either generic or
x86-specific, either simple or convoluted, possibly using
multiple versions of the shared variable in different cache
lines) to make sure that reads never stalls (or, equivalently,
let me read stale values from the cache) ?

I have done some experiments and on a single-socket machines
the stallled reads take some 50ns; on a dual socket machine
the stall penalty grows to about 200ns.

cheers
luigi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160408162416.GA94343>