From owner-svn-src-head@FreeBSD.ORG Mon Nov 22 15:30:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C614106564A; Mon, 22 Nov 2010 15:30:00 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id EF52F8FC08; Mon, 22 Nov 2010 15:29:59 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 9C67846B03; Mon, 22 Nov 2010 10:29:59 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B34428A009; Mon, 22 Nov 2010 10:29:47 -0500 (EST) From: John Baldwin To: Kostik Belousov Date: Mon, 22 Nov 2010 10:29:28 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <201011221242.oAMCgW9O092144@svn.freebsd.org> <20101122125106.GZ2392@deviant.kiev.zoral.com.ua> In-Reply-To: <20101122125106.GZ2392@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201011221029.29119.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 22 Nov 2010 10:29:47 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Alexander Leidinger Subject: Re: svn commit: r215675 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 22 Nov 2010 15:30:00 -0000 On Monday, November 22, 2010 7:51:06 am Kostik Belousov wrote: > On Mon, Nov 22, 2010 at 12:42:32PM +0000, Alexander Leidinger wrote: > > Author: netchild > > Date: Mon Nov 22 12:42:32 2010 > > New Revision: 215675 > > URL: http://svn.freebsd.org/changeset/base/215675 > > > > Log: > > Do not take the process lock. The assignment to u_short inside the > > properly aligned structure is atomic on all supported architectures, and > > the thread that should see side-effect of assignment is the same thread > > that does assignment. > > > > Use a more appropriate conditional to detect the linux ABI. > > > > Suggested by: kib > > X-MFC: together with r215664 > > > > Modified: > > head/sys/compat/linux/linux_emul.c > > > > Modified: head/sys/compat/linux/linux_emul.c > > ============================================================================== > > --- head/sys/compat/linux/linux_emul.c Mon Nov 22 12:33:48 2010 (r215674) > > +++ head/sys/compat/linux/linux_emul.c Mon Nov 22 12:42:32 2010 (r215675) > > @@ -265,7 +262,8 @@ linux_proc_exec(void *arg __unused, stru > > if (__predict_false(imgp->sysent == &elf_linux_sysvec > > && p->p_sysent != &elf_linux_sysvec)) > > linux_proc_init(FIRST_THREAD_IN_PROC(p), p->p_pid, 0); > > - if (__predict_false(p->p_sysent == &elf_linux_sysvec)) > > + if (__predict_false((p->p_sysent->sv_flags & SV_ABI_MASK) == > > + SV_ABI_LINUX)) > > /* Kill threads regardless of imgp->sysent value */ > > linux_kill_threads(FIRST_THREAD_IN_PROC(p), SIGKILL); > > if (__predict_false(imgp->sysent != &elf_linux_sysvec > There are several similar comparisons around the patched one. > > I am still quite curious for the reason of all __predict() obfuscations > that are countless in the linuxolator. We are not oblidged to emulate > this aspect of Linux. I think we should only have __predict() obfuscation if there is a benchmark showing an indisputable performance gain. Otherwise it is just cruft making the code hard to read. I suspect that a Linux app calling execve() is not a sufficient critical path to warrant any of these. -- John Baldwin