Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 May 2018 11:59:32 -0700
From:      Matthew Macy <mmacy@freebsd.org>
To:        Mark Johnston <markj@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r333466 - in head: contrib/bmake sys/conf sys/kern sys/modules/epoch_test sys/sys sys/tests/epoch
Message-ID:  <CAPrugNpvhf%2BfhtE0rbv28Rsr1L_LiKrU6mfjFBXWBH5uAKdhHA@mail.gmail.com>
In-Reply-To: <20180511184735.GA34339@raichu>
References:  <201805101755.w4AHtPRt028900@repo.freebsd.org> <20180511184735.GA34339@raichu>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks

On Fri, May 11, 2018 at 11:47 Mark Johnston <markj@freebsd.org> 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. */
> >  };
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPrugNpvhf%2BfhtE0rbv28Rsr1L_LiKrU6mfjFBXWBH5uAKdhHA>