From owner-freebsd-hackers@freebsd.org Wed Aug 22 06:44:31 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5DDA108EA66 for ; Wed, 22 Aug 2018 06:44:31 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 743A885138 for ; Wed, 22 Aug 2018 06:44:31 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com [209.85.214.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 2FFA811F1E for ; Wed, 22 Aug 2018 06:44:31 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f44.google.com with SMTP id 72-v6so1628808itw.3 for ; Tue, 21 Aug 2018 23:44:31 -0700 (PDT) X-Gm-Message-State: AOUpUlGGpIRfljIKmaMaDTX5G0p/tIPY+Y5Z3HFY5movxWFAoy8fzfzy EiARleuJw7WAxuZ5TRDXOu9LgdOCYk6qREeVpu4= X-Google-Smtp-Source: AA+uWPzCrc+mBQBav2NV8mgJKK8rhPy7dmBetcfWqH1nbCbk500Di+cq3BuaROBy1O6AD0KDXp9HssnzJ+6c6z+xJrE= X-Received: by 2002:a02:2b12:: with SMTP id h18-v6mr47599150jaa.10.1534920270523; Tue, 21 Aug 2018 23:44:30 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Matthew Macy Date: Tue, 21 Aug 2018 23:44:19 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: epoch(9) background information? To: sebastian.huber@embedded-brains.de Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2018 06:44:32 -0000 On Tue, Aug 21, 2018 at 11:34 PM Sebastian Huber < sebastian.huber@embedded-brains.de> wrote: > On 21/08/18 15:38, Jacques Fourie wrote: > > > > > > On Tue, Aug 21, 2018 at 8:33 AM, Sebastian Huber > > > > wrote: > > > > Hello, > > > > I update currently a port of the FreeBSD network stack, etc. to > > the real-time operating system RTEMS from the head version at > > 2017-04-04 to the head version of today. I noticed that some > > read-write locks are replaced by a relatively new stuff called > > EPOCH(9). Is there some background information available for this? > > The man page is a bit vague and searching for something named > > epoch on the internet is not really great. For example, what is > > the motivation for this change? How is this related to > > read-copy-update (RCU)? > > > > -- > > Sebastian Huber, embedded brains GmbH > > > > Address : Dornierstr. 4, D-82178 Puchheim, Germany > > < > https://maps.google.com/?q=3DDornierstr.+4,+D-82178+Puchheim,+Germany&ent= ry=3Dgmail&source=3Dg > > > > 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 de= s EHUG. > > > > _______________________________________________ > > freebsd-hackers@freebsd.org > > mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > > > To unsubscribe, send any mail to > > "freebsd-hackers-unsubscribe@freebsd.org > > " > > > > > > Additional information is available here : > > http://concurrencykit.org/presentations/ebr.pdf > > . The way I > > understand it is that it is mostly used in place of read locks to > > provide liveness guarantees without using atomics. Additional detail > > is available in the commit messages. As an example see r333813 for > > some performance data. > > > > Thanks, for the reference. The "epoch reclamation" are good keywords to > find more information. > > What is the right mailing list to ask questions about the epoch > implementation of the FreeBSD kernel? > > -hackers is probably as good as any. Your questions are at a high enough level that they might be appropriate for -arch. To support this machinery in RTEMS is a bit difficult (in particular > EPOCH_LOCKED). Since RTEMS is supposed to be a real-time operating > system it supports only fixed-priority and job-level fixed priority > (EDF) schedulers. To allow some scaling to larger SMP systems it > supports clustered scheduling together with the mutual exclusion locking > protocols MrsP (http://www-users.cs.york.ac.uk/~burns/MRSPpaper.pdf) and > OMIP (http://www.mpi-sws.org/~bbb/papers/pdf/ecrts13b.pdf). This makes > the thread pinning hard to implement (which is very easy to support in > FreeBSD). The locking protocols may temporarily move a thread which owns > a mutex to a foreign scheduler instance, e.g. a thread which wants to > obtain the mutex helps the owner to make progress if it was pre-empted > in its home scheduler instance. Due to a timeout of the helper the owner > may loose the right to execute in the foreign scheduler instance. This > would make it impossible to fulfil the processor pinning constraint > (e.g. the thread priority in the foreign scheduler instance is undefined)= . > > It would save me a lot of trouble if I could assume that EPOCH_LOCKED is > an exotic feature which is unlikely to get used in FreeBSD. > EPOCH_LOCKED is something that one would only want to use in a fairly narrow set of circumstances. The only place it's being discussed currently is in pmap: https://reviews.freebsd.org/D15983 There it would conceivably replace a global mutex that currently serializes all munmap operations. -M