Date: Fri, 11 Jun 2010 11:14:05 -0700 From: Julian Elischer <julian@elischer.org> To: John Baldwin <jhb@freebsd.org> Cc: Kostik Belousov <kostikbel@gmail.com>, svn-src-head@freebsd.org, Alexander Motin <mav@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r208988 - in head/sys: kern sys Message-ID: <4C127CED.90208@elischer.org> In-Reply-To: <201006110943.02539.jhb@freebsd.org> References: <201006101614.o5AGE5Zh099383@svn.freebsd.org> <201006110810.40295.jhb@freebsd.org> <20100611124149.GD13238@deviant.kiev.zoral.com.ua> <201006110943.02539.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C127CED.90208>