Date: Wed, 22 Aug 2018 08:42:49 +0200 From: Sebastian Huber <sebastian.huber@embedded-brains.de> To: FreeBSD <freebsd-hackers@freebsd.org> Cc: Matthew Macy <mmacy@freebsd.org> Subject: Re: epoch(9) background information? Message-ID: <15e3f080-2f82-a243-80e9-f0a916445828@embedded-brains.de> In-Reply-To: <fc088eb4-f306-674c-7404-ebe17a60a5f8@embedded-brains.de> References: <db397431-2c4c-64de-634a-20f38ce6a60e@embedded-brains.de> <CALX0vxBAN6nckuAnYR3_mOfwbCjJCjHGuuOFh9njpxO%2BGUzo3w@mail.gmail.com> <fc088eb4-f306-674c-7404-ebe17a60a5f8@embedded-brains.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On 22/08/18 08:34, Sebastian Huber wrote: > On 21/08/18 15:38, Jacques Fourie wrote: >> >> >> On Tue, Aug 21, 2018 at 8:33 AM, Sebastian Huber=20 >> <sebastian.huber@embedded-brains.de=20 >> <mailto:sebastian.huber@embedded-brains.de>> wrote: >> >> =C2=A0=C2=A0=C2=A0 Hello, >> >> =C2=A0=C2=A0=C2=A0 I update currently a port of the FreeBSD network st= ack, etc. to >> =C2=A0=C2=A0=C2=A0 the real-time operating system RTEMS from the head = version at >> =C2=A0=C2=A0=C2=A0 2017-04-04 to the head version of today. I noticed = that some >> =C2=A0=C2=A0=C2=A0 read-write locks are replaced by a relatively new s= tuff called >> =C2=A0=C2=A0=C2=A0 EPOCH(9). Is there some background information avai= lable for this? >> =C2=A0=C2=A0=C2=A0 The man page is a bit vague and searching for somet= hing named >> =C2=A0=C2=A0=C2=A0 epoch on the internet is not really great. For exam= ple, what is >> =C2=A0=C2=A0=C2=A0 the motivation for this change? How is this related= to >> =C2=A0=C2=A0=C2=A0 read-copy-update (RCU)? >> >> =C2=A0=C2=A0=C2=A0 -- =C2=A0=C2=A0=C2=A0 Sebastian Huber, embedded bra= ins GmbH >> >> =C2=A0=C2=A0=C2=A0 Address : Dornierstr. 4, D-82178 Puchheim, Germany >> <https://maps.google.com/?q=3DDornierstr.+4,+D-82178+Puchheim,+Germany= &entry=3Dgmail&source=3Dg> >> =C2=A0=C2=A0=C2=A0 Phone=C2=A0 =C2=A0: +49 89 189 47 41-16 >> =C2=A0=C2=A0=C2=A0 Fax=C2=A0 =C2=A0 =C2=A0: +49 89 189 47 41-09 >> =C2=A0=C2=A0=C2=A0 E-Mail=C2=A0 : sebastian.huber@embedded-brains.de >> =C2=A0=C2=A0=C2=A0 <mailto:sebastian.huber@embedded-brains.de> >> =C2=A0=C2=A0=C2=A0 PGP=C2=A0 =C2=A0 =C2=A0: Public key available on re= quest. >> >> =C2=A0=C2=A0=C2=A0 Diese Nachricht ist keine gesch=C3=A4ftliche Mittei= lung im Sinne des=20 >> EHUG. >> >> =C2=A0=C2=A0=C2=A0 _______________________________________________ >> =C2=A0=C2=A0=C2=A0 freebsd-hackers@freebsd.org <mailto:freebsd-hackers= @freebsd.org> >> =C2=A0=C2=A0=C2=A0 mailing list >> =C2=A0=C2=A0=C2=A0 https://lists.freebsd.org/mailman/listinfo/freebsd-= hackers >> <https://lists.freebsd.org/mailman/listinfo/freebsd-hackers> >> =C2=A0=C2=A0=C2=A0 To unsubscribe, send any mail to >> =C2=A0=C2=A0=C2=A0 "freebsd-hackers-unsubscribe@freebsd.org >> =C2=A0=C2=A0=C2=A0 <mailto:freebsd-hackers-unsubscribe@freebsd.org>" >> >> >> Additional information is available here :=20 >> http://concurrencykit.org/presentations/ebr.pdf=20 >> <http://concurrencykit.org/presentations/ebr.pdf>. The way I=20 >> understand it is that it is mostly used in place of read locks to=20 >> provide liveness guarantees without using atomics. Additional detail=20 >> is available in the commit messages. As an example see r333813 for=20 >> some performance data. >> > > Thanks, for the reference. The "epoch reclamation" are good keywords=20 > to find more information. > > What is the right mailing list to ask questions about the epoch=20 > implementation of the FreeBSD kernel? > > To support this machinery in RTEMS is a bit difficult (in particular=20 > EPOCH_LOCKED). Since RTEMS is supposed to be a real-time operating=20 > system it supports only fixed-priority and job-level fixed priority=20 > (EDF) schedulers. To allow some scaling to larger SMP systems it=20 > supports clustered scheduling together with the mutual exclusion=20 > locking protocols MrsP=20 > (http://www-users.cs.york.ac.uk/~burns/MRSPpaper.pdf) and OMIP=20 > (http://www.mpi-sws.org/~bbb/papers/pdf/ecrts13b.pdf). This makes the=20 > thread pinning hard to implement (which is very easy to support in=20 > FreeBSD). The locking protocols may temporarily move a thread which=20 > owns a mutex to a foreign scheduler instance, e.g. a thread which=20 > wants to obtain the mutex helps the owner to make progress if it was=20 > pre-empted in its home scheduler instance. Due to a timeout of the=20 > helper the owner may loose the right to execute in the foreign=20 > scheduler instance. This would make it impossible to fulfil the=20 > processor pinning constraint (e.g. the thread priority in the foreign=20 > scheduler instance is undefined). > > It would save me a lot of trouble if I could assume that EPOCH_LOCKED=20 > is an exotic feature which is unlikely to get used in FreeBSD. > Another question, is it a common use case to call epoch_enter_preempt()=20 and epoch_exit_preempt() while owning a mutex? --=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?15e3f080-2f82-a243-80e9-f0a916445828>