From owner-svn-src-head@freebsd.org Fri May 11 18:59:44 2018 Return-Path: Delivered-To: svn-src-head@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 588F0FC6280; Fri, 11 May 2018 18:59:44 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (unknown [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 0537B74D12; Fri, 11 May 2018 18:59:44 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id BD2421DFCE; Fri, 11 May 2018 18:59:43 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f43.google.com with SMTP id n64-v6so3199998itb.3; Fri, 11 May 2018 11:59:43 -0700 (PDT) X-Gm-Message-State: ALKqPwezOoXGWJBb3X1hot9LA6j7lZLoxErmPajq/Y8qQ2U3Q2iqFiXk +aLgEVoKuMoZ0L3SN5JKsGBX65MDqx0hUHNnm64= X-Google-Smtp-Source: AB8JxZpLfkW338z7xnVV4C6tv7E0fbd/lmla9EBdJLIvsoxDLjJbWvc2P/Co1AeLZid2z9SpZ9kGUrCCcEPNIb8byak= X-Received: by 2002:a24:5a85:: with SMTP id v127-v6mr4628530ita.128.1526065183195; Fri, 11 May 2018 11:59:43 -0700 (PDT) MIME-Version: 1.0 References: <201805101755.w4AHtPRt028900@repo.freebsd.org> <20180511184735.GA34339@raichu> In-Reply-To: <20180511184735.GA34339@raichu> From: Matthew Macy Date: Fri, 11 May 2018 11:59:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333466 - in head: contrib/bmake sys/conf sys/kern sys/modules/epoch_test sys/sys sys/tests/epoch To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 May 2018 18:59:44 -0000 Thanks On Fri, May 11, 2018 at 11:47 Mark Johnston wrote: > On Thu, May 10, 2018 at 05:55:25PM +0000, Matt Macy wrote: > > Author: mmacy > > Date: Thu May 10 17:55:24 2018 > > New Revision: 333466 > > URL: https://svnweb.freebsd.org/changeset/base/333466 > > > > Log: > > Add simple preempt safe epoch API > > > > Read locking is over used in the kernel to guarantee liveness. This > API makes > > it easy to provide livenes guarantees without atomics. > > > > Includes epoch_test kernel module to stress test the API. > > > > Documentation will follow initial use case. > > > > Test case and improvements to preemption handling in response to > discussion > > with mjg@ > > > > Reviewed by: imp@, shurd@ > > Approved by: sbruno@ > > > > Added: > > head/sys/kern/subr_epoch.c (contents, props changed) > > head/sys/modules/epoch_test/ > > head/sys/modules/epoch_test/Makefile (contents, props changed) > > head/sys/sys/epoch.h (contents, props changed) > > head/sys/tests/epoch/ > > head/sys/tests/epoch/epoch_test.c (contents, props changed) > > Modified: > > head/contrib/bmake/job.c > > head/sys/conf/files > > head/sys/conf/kern.pre.mk > > head/sys/kern/kern_malloc.c > > head/sys/kern/kern_synch.c > > head/sys/kern/subr_trap.c > > head/sys/kern/subr_turnstile.c > > head/sys/sys/proc.h > > head/sys/sys/turnstile.h > > > > Modified: head/sys/sys/proc.h > > > ============================================================================== > > --- head/sys/sys/proc.h Thu May 10 17:22:04 2018 (r333465) > > +++ head/sys/sys/proc.h Thu May 10 17:55:24 2018 (r333466) > > @@ -243,6 +243,7 @@ struct thread { > > > > /* Cleared during fork1() */ > > #define td_startzero td_flags > > + u_char td_epochnest; /* (k) Private thread epoch nest counter */ > > It looks like td_epochnest was inteded to be in the zeroed section, but > td_startzero still points to td_flags. > > > int td_flags; /* (t) TDF_* flags. */ > > int td_inhibitors; /* (t) Why can not run. */ > > int td_pflags; /* (k) Private thread (TDP_*) > flags. */ > > @@ -355,6 +356,7 @@ struct thread { > > int td_lastcpu; /* (t) Last cpu we were on. */ > > int td_oncpu; /* (t) Which cpu we are on. */ > > void *td_lkpi_task; /* LinuxKPI task struct pointer */ > > + TAILQ_ENTRY(thread) td_epochq; /* (t) Epoch queue. */ > > }; >