From owner-svn-src-head@FreeBSD.ORG Fri Jun 11 13:44:52 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 E60781065672; Fri, 11 Jun 2010 13:44:52 +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 B48F78FC1D; Fri, 11 Jun 2010 13:44:52 +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 5159146C3A; Fri, 11 Jun 2010 09:44:52 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9CFBB8A03C; Fri, 11 Jun 2010 09:44:51 -0400 (EDT) From: John Baldwin To: Kostik Belousov Date: Fri, 11 Jun 2010 09:43:02 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006101614.o5AGE5Zh099383@svn.freebsd.org> <201006110810.40295.jhb@freebsd.org> <20100611124149.GD13238@deviant.kiev.zoral.com.ua> In-Reply-To: <20100611124149.GD13238@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201006110943.02539.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 11 Jun 2010 09:44:51 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r208988 - in head/sys: kern sys 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: Fri, 11 Jun 2010 13:44:53 -0000 On Friday 11 June 2010 8:41:49 am Kostik Belousov wrote: > On Fri, Jun 11, 2010 at 08:10:40AM -0400, John Baldwin wrote: > > On Friday 11 June 2010 4:31:37 am Kostik Belousov wrote: > > > On Thu, Jun 10, 2010 at 04:14:05PM +0000, Alexander Motin wrote: > > > > Author: mav > > > > Date: Thu Jun 10 16:14:05 2010 > > > > New Revision: 208988 > > > > URL: http://svn.freebsd.org/changeset/base/208988 > > > > > > > > Log: > > > > Store interrupt trap frame into struct thread. It allows interrupt > > handler > > > > to obtain both trap frame and opaque argument submitted on registrction. > > > > After kernel and all drivers get used to it, legacy hack can be removed. > > > > > > > > Reviewed by: jhb@ > > > Just curious, why td_frame is not enough for your usage ? I believe td_frame > > > is currently set only by traps and syscalls, and copied on forks. > > > > td_frame is not set on a nested interrupt. Thus, if you use td_frame and get > > an interrupt while in a syscall, statclock() would account the time as a user > > tick instead of a system tick. > > > > Put another way, td_frame always references the user --> system > > trapframe, but td_intr_frame will reference the most recent trapframe > > on the stack. > > I mean, save old td_frame on the interrupt, and assign interrupt trap > frame to td_frame. I.e., do what r208988, but replace td_intr_frame > with td_frame. Hmmm, I had thought there were reasons that was not safe, but after looking it may be safe to do this. -- John Baldwin