Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Aug 2018 08:51:59 +0200
From:      Sebastian Huber <sebastian.huber@embedded-brains.de>
To:        Matthew Macy <mmacy@freebsd.org>, freebsd-hackers@freebsd.org
Subject:   Re: epoch(9) background information?
Message-ID:  <f34df96d-9910-e695-54c4-7ee698795389@embedded-brains.de>
In-Reply-To: <CAPrugNptSR4dmqAqo82SskP-YNqkVnR%2BnFxqKjFQv-k_8wrhUQ@mail.gmail.com>
References:  <db397431-2c4c-64de-634a-20f38ce6a60e@embedded-brains.de> <CALX0vxBAN6nckuAnYR3_mOfwbCjJCjHGuuOFh9njpxO%2BGUzo3w@mail.gmail.com> <fc088eb4-f306-674c-7404-ebe17a60a5f8@embedded-brains.de> <15e3f080-2f82-a243-80e9-f0a916445828@embedded-brains.de> <CAPrugNpZ5CihCW6hz3ztXAZrNn1qJNRsE=yGCvw1rzqNPQYRvg@mail.gmail.com> <26445c95-17c5-1a05-d290-0741d91b7721@embedded-brains.de> <CAPrugNptSR4dmqAqo82SskP-YNqkVnR%2BnFxqKjFQv-k_8wrhUQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 22/08/18 09:09, Matthew Macy wrote:
>>> Yes. Very. It is generally not permitted to hold a mutex across
>>> epoch_wait() that's why there's the special flag EPOCH_LOCKED. If you
>>> have a very limited number of threads, you might want to have each
>>> thread have its own record registered with the epoch. Then you
>>> wouldn't need the CPU pinning. The pinning is just away of providing =
a
>>> limited number of records to an unbounded number of threads.
>> Thanks for the prompt answer.
>>
>> Do I need a record per thread and per epoch? Could I use only one (may=
be
>> dependent on the nest level?) record per thread?
>>
>>
> A record can only be registered with one epoch. And yes you can have ju=
st
> one single global epoch. However, then the epoch_wait_preempt time  or =
time
> until the gc task is run is determined be the longest epoch section
> globally.

I think the thread pinning feature is absolutely necessary for an=20
efficient implementation. You have to avoid any atomic read-modify-write=20
operations in the fast path. For the preempt variants you have to=20
maintain a list of threads and for this you need per-processor list heads=
.

--=20
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine gesch=C3=A4ftliche Mitteilung im Sinne des EHUG=
.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f34df96d-9910-e695-54c4-7ee698795389>