From owner-freebsd-hackers@freebsd.org Mon Aug 27 06:52:11 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 3D8F1108EA57 for ; Mon, 27 Aug 2018 06:52:11 +0000 (UTC) (envelope-from sebastian.huber@embedded-brains.de) Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9C8481505; Mon, 27 Aug 2018 06:52:10 +0000 (UTC) (envelope-from sebastian.huber@embedded-brains.de) Received: from [78.46.172.2] (helo=sslproxy05.your-server.de) by dedi548.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.85_2) (envelope-from ) id 1fuBNa-00031V-RR; Mon, 27 Aug 2018 08:52:02 +0200 Received: from [82.135.62.35] (helo=mail.embedded-brains.de) by sslproxy05.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1fuBNa-000Xcc-Li; Mon, 27 Aug 2018 08:52:02 +0200 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id A99AD2A165C; Mon, 27 Aug 2018 08:52:08 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Rgf0EljfkRGr; Mon, 27 Aug 2018 08:52:08 +0200 (CEST) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 5B9F12A167E; Mon, 27 Aug 2018 08:52:08 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 76_l3KuxE3Km; Mon, 27 Aug 2018 08:52:08 +0200 (CEST) Received: from [192.168.96.149] (unknown [192.168.96.149]) by mail.embedded-brains.de (Postfix) with ESMTPSA id E4C2B2A165C; Mon, 27 Aug 2018 08:52:07 +0200 (CEST) Subject: Re: epoch(9) background information? To: Matthew Macy , freebsd-hackers@freebsd.org References: <15e3f080-2f82-a243-80e9-f0a916445828@embedded-brains.de> <26445c95-17c5-1a05-d290-0741d91b7721@embedded-brains.de> From: Sebastian Huber Message-ID: Date: Mon, 27 Aug 2018 08:51:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.100.1/24877/Mon Aug 27 06:46:55 2018) 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: Mon, 27 Aug 2018 06:52:11 -0000 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= .