From owner-svn-src-all@freebsd.org Fri May 11 18:47:41 2018 Return-Path: Delivered-To: svn-src-all@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 B2BEBFC593B; Fri, 11 May 2018 18:47:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (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)) by mx1.freebsd.org (Postfix) with ESMTPS id 4811870EDA; Fri, 11 May 2018 18:47:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io0-x244.google.com with SMTP id e12-v6so8105812iob.8; Fri, 11 May 2018 11:47:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=0vnTZvP+H+WwGCYhYSZ8tRmarwY4xsrWHZq/2ZSOWkE=; b=Xf4m0PxI/iKyyJpOOi1f1TBi7K0zny7H0fLjbOeQqSxAOJILs81yaRkQxBfqvr1Pea qhzzA1EJ9pmclo0SHQrdHPI/SHj8xF6sQTbdFIaYscJ9pYr8kkmL2qbkSU4Mu61O88YJ nisRQQtsq6klMp3X6eyl9jyEQDR6c3C9FPdy0E9Cq2+Vda2eponc2zL4qvLj3dTdqRBl SzFVCRpMOwoT7sqYfSsHlgAvI9gHGulS5racx0eZesID1HhdKLyxQFMEOz2bbGuCntqZ 3Mv6eSWzn7RmlwqOwxhP29B/xT52+mXKqjjDLRoQscUW6UuFp8EgzJhNi8qkvt9/zkDv pWgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=0vnTZvP+H+WwGCYhYSZ8tRmarwY4xsrWHZq/2ZSOWkE=; b=EJFIOtrEejjvladgziReh8Dlj6JOzJFDPeNKY/U8Qyyr1WV9GUcAY0AMXIEIoCy3O/ uQi+oYVTBb8CeVTwLpdfnAfUZSJ3AQGLgVnjAncxWt1UCpgO/LfMwIq//+aZ48oTs2Ky dCmfzX2W6fb82X49ypO4fYsDAa2YmyKcGkSNw3JcDInMf8WjzT4lCajysRWxzKzx+Fz6 mRxgNxr187XDMfVvocLSoFqYDFQQLcp793gaixZjn/TPtE4nJJKE8jcG1hkljjZd7zzt G4ZBDLKISIS86u/npXQaTAn0T8uTBV1gTrUmYOsMRo0o8Fd8+noB5fqc6+eiNBePhEJ9 edBg== X-Gm-Message-State: ALKqPwfUQWP2EM/b306DBlZV2skuLtvAwoTaQAKb7fEJck3ArjCZ6P+I QJg018PyT/5SdaVSxmtoDvcyOA== X-Google-Smtp-Source: AB8JxZoyxoVpLiPjfu1UInzsUEXha0JTKOBndJGH+p+9VHZAovDuTBoHOxpwTy3Lunv3IwHb6VHVfQ== X-Received: by 2002:a6b:b386:: with SMTP id c128-v6mr3486478iof.50.1526064460363; Fri, 11 May 2018 11:47:40 -0700 (PDT) Received: from raichu (toroon0560w-lp130-04-184-145-252-229.dsl.bell.ca. [184.145.252.229]) by smtp.gmail.com with ESMTPSA id n7-v6sm1716793ioc.75.2018.05.11.11.47.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 11:47:39 -0700 (PDT) Sender: Mark Johnston Date: Fri, 11 May 2018 14:47:35 -0400 From: Mark Johnston To: Matt Macy 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: <20180511184735.GA34339@raichu> References: <201805101755.w4AHtPRt028900@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201805101755.w4AHtPRt028900@repo.freebsd.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 May 2018 18:47:42 -0000 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. */ > };