From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 18:13:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F029E1065679; Fri, 11 Jun 2010 18:13:43 +0000 (UTC) (envelope-from julian@elischer.org) Received: from out-0.mx.aerioconnect.net (outx.internet-mail-service.net [216.240.47.247]) by mx1.freebsd.org (Postfix) with ESMTP id C6B898FC08; Fri, 11 Jun 2010 18:13:43 +0000 (UTC) Received: from idiom.com (postfix@mx0.idiom.com [216.240.32.160]) by out-0.mx.aerioconnect.net (8.13.8/8.13.8) with ESMTP id o5BIDf3X025057; Fri, 11 Jun 2010 11:13:41 -0700 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id 5E2992D6016; Fri, 11 Jun 2010 11:13:40 -0700 (PDT) Message-ID: <4C127CED.90208@elischer.org> Date: Fri, 11 Jun 2010 11:14:05 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: John Baldwin References: <201006101614.o5AGE5Zh099383@svn.freebsd.org> <201006110810.40295.jhb@freebsd.org> <20100611124149.GD13238@deviant.kiev.zoral.com.ua> <201006110943.02539.jhb@freebsd.org> In-Reply-To: <201006110943.02539.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 216.240.47.51 Cc: Kostik Belousov , 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-all@freebsd.org X-Mailman-Version: 2.1.5 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 Jun 2010 18:13:44 -0000 On 6/11/10 6:43 AM, John Baldwin wrote: > 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. > I THINK it is OK but make sure you add good comments everywhere.