From owner-svn-src-stable@freebsd.org Mon Jan 23 13:34:51 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A755CBCF0B; Mon, 23 Jan 2017 13:34:51 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 0507CA86; Mon, 23 Jan 2017 13:34:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id BDED0D65BE7; Tue, 24 Jan 2017 00:34:41 +1100 (AEDT) Date: Tue, 24 Jan 2017 00:34:41 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r312666 - stable/10/sys/kern In-Reply-To: <201701230834.v0N8Ypnu011042@repo.freebsd.org> Message-ID: <20170124002712.Q903@besplex.bde.org> References: <201701230834.v0N8Ypnu011042@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=BKLDlBYG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=RN40QYc7CpQC_wqHqSMA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2017 13:34:51 -0000 On Mon, 23 Jan 2017, Andriy Gapon wrote: > ============================================================================== > --- stable/10/sys/kern/sched_4bsd.c Mon Jan 23 08:34:41 2017 (r312665) > +++ stable/10/sys/kern/sched_4bsd.c Mon Jan 23 08:34:51 2017 (r312666) > @@ -963,8 +963,8 @@ sched_switch(struct thread *td, struct t > sched_load_rem(); > > td->td_lastcpu = td->td_oncpu; > - preempted = !((td->td_flags & TDF_SLICEEND) || > - (flags & SWT_RELINQUISH)); > + preempted = (td->td_flags & TDF_SLICEEND) == 0 && > + (flags & SW_PREEMPT) != 0; > td->td_flags &= ~(TDF_NEEDRESCHED | TDF_SLICEEND); > td->td_owepreempt = 0; > td->td_oncpu = NOCPU; Please also merge to FreeBSD-9. FreeBSD-9 has best performance for a makeworld benchmark. What is a good benchmark for showing that the fix helps? Involuntary context switches increased by almost a factor of 2 for the makeworld benchmark (over nfs) recently, but that was just caused by pessimizations in the NIC driver. Bruce