Commit Graph

18 Commits

Author SHA1 Message Date
Olivier Houchard
74e9b5f29a Merge commit 'ce929fe84f9c453263af379f3b255ff8eca01d48'
Import CK as of commit 2265c7846f4ce667f5216456afe2779b23c3e5f7.
2021-10-29 19:18:03 +02:00
Mark Johnston
d75884df78 ck: Correct asm output operand widths in amd64 pointer intrinsics
This does not appear to change generated code with the default
toolchain.  However, KMSAN makes use of output operand specifications to
instrument inline asm, and with incorrect specifications we get false
positives in code that uses the CK_(S)LIST macros.

This was submitted upstream:
https://github.com/concurrencykit/ck/pull/175

The commit applies the same change locally to make KMSAN usable until
something equivalent is merged upstream.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-08-10 21:27:54 -04:00
Olivier Houchard
77a1348b3c Remove FreeBSD/armv4 specific bits from CK.
Now that armv4/v5 is gone, remove the bits that implemented atomic operations
by disabling interrupts.
Those were specific to FreeBSD and never reached upstream.
2020-04-13 23:16:32 +00:00
Warner Losh
58aa35d429 Remove sparc64 kernel support
Remove all sparc64 specific files
Remove all sparc64 ifdefs
Removee indireeect sparc64 ifdefs
2020-02-03 17:35:11 +00:00
Marius Strobl
f993117205 Import CK as of 21d3e319407d19dece16ee317c757ffc54a452bc, which makes its
sparcv9 atomics compatible with the FreeBSD kernel by using instructions
which access the appropriate address space.
Atomic operations within the kernel must access the nucleus address space
instead of the default primary one. Without this change but the increased
use of CK in the kernel, machines started to panic after some minutes of
uptime due to an unresolvable fault in ck_pr_cas_64_value().
2018-11-27 12:35:51 +00:00
Jonathan T. Looney
8064dab643 Import CK as of commit 5221ae2f3722a78c7fc41e47069ad94983d3bccb.
This fixes two problems, one where epoch calls could occur before all
the readers had exited the epoch section, and one where the epoch calls
could be unnecessarily delayed.

Approved by:	re (glebius)
2018-10-16 02:30:13 +00:00
Olivier Houchard
d8f1ed8d94 Import CK as of commit 08813496570879fbcc2adcdd9ddc0a054361bfde, mostly
to avoid using lwsync on ppc32.
2018-08-09 12:11:49 +00:00
Andriy Gapon
725de58112 MFV CK@r336629: Import CK as of commit 1c1f9901c2dea7a883342cd03d3906a1bc482583
This adds CK_SLIST_INSERT_PREVPTR and CK_SLIST_REMOVE_PREVPTR macros
as well as ck_pr_dec_is_zero family of functions.

MFC after:	3 weeks
2018-07-23 11:21:43 +00:00
Olivier Houchard
d1f3fb2cb4 Import CK as of commit 0f017230ccc86929f56bf44ef2dca93d7df8076b.
This brings us the renaming of fields in ck_queue, so that our own
LIST/SLIST/TAILQ/etc won't accidentally work with them.
2018-05-24 21:38:18 +00:00
Matt Macy
4c7d0d925f ck: add support for executing callbacks outside of main poll loop
Pull in change from upstream deca119d14bfffd440770eb67cbdbeaf7b57eb7b

|    ck_epoch: introduce ck_epoch_deferred
|
|    Allow for deferral to occur outside epoch poll critical loop (which may access per-CPU structures).
|

Approved by:	sbruno
2018-05-17 18:14:10 +00:00
Olivier Houchard
271ce40239 Import CK as of commit b19ed4c6a56ec93215ab567ba18ba61bf1cfbac8
It should fix ck_pr_[load|store]_ptr on mips and riscv, make sure no
*fence instructions are used on i386, as older cpus don't support it, and
make sure we don't rely on gcc builtins that can lead to calls to
libatomic when linked with -O0.

MFC after:	1 week
2018-04-02 23:40:50 +00:00
Olivier Houchard
a72c9dc53f Define CK_MD_TSO for the relevant arches (i386, amd64 and sparc64).
Defaulting to CK_MD_RMO has the unfortunate side effect of generating
memory barriers that are useless on those arches, and the even more
unfortunate side effect of generating lfence/sfence/mfence on i386, even
if older CPUs don't support it.
This should fix the panic reported when using IPFW on a Pentium 3.
Note that mfence and sfence might still be used in a few case, but that
shouldn't happen in FreeBSD right now, and should be fixed upstream first.

MFC after:	1 week
2018-02-16 17:50:06 +00:00
Olivier Houchard
7e8cd4e1af Import CK as of commit 6b141c0bdd21ce8b3e14147af8f87f22b20ecf32
This brings us changes we needed in ck_epoch.
2017-04-09 21:02:05 +00:00
Olivier Houchard
08c22689e6 Merge CK as of commit 24d26965d1a28039062ba3bcf9433b623f3d2c5e, to get
a fix in ck_epoch.
2017-02-28 23:30:14 +00:00
Olivier Houchard
8f87df16d4 Merge CK as of commit 255a47553aa5e8d0bb5f8eec63acac7f4c25a6d8, mostly
to make sure we don't use any FP instruction.
2016-12-30 18:23:58 +00:00
Olivier Houchard
114b7c00ca Add a FREEBSD-Xlist file for CK. 2016-11-28 21:16:03 +00:00
Olivier Houchard
5ac7aafe09 Add FreeBSD-specific files. 2016-11-28 20:33:30 +00:00
Olivier Houchard
1fb62fb074 Import Concurrency Kit in the kernel.
CK is a toolkit providing different lockfree algorithms/data structures.
More information can be found here : www.concurrencykit.org
2016-11-28 20:27:58 +00:00