[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <alpine.LFD.2.00.0811071513180.13034@xanadu.home>
Date: Fri, 07 Nov 2008 15:18:22 -0500 (EST)
From: Nicolas Pitre <nico@....org>
To: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
Cc: David Howells <dhowells@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Ingo Molnar <mingo@...e.hu>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
linux-kernel@...r.kernel.org, Ralf Baechle <ralf@...ux-mips.org>,
benh@...nel.crashing.org, paulus@...ba.org,
David Miller <davem@...emloft.net>,
Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Steven Rostedt <rostedt@...dmis.org>,
linux-arch@...r.kernel.org
Subject: Re: [RFC patch 08/18] cnt32_to_63 should use smp_rmb()
On Fri, 7 Nov 2008, Mathieu Desnoyers wrote:
> * David Howells (dhowells@...hat.com) wrote:
> > Nicolas Pitre <nico@....org> wrote:
> >
> > > > I mean, the darned thing is called from sched_clock(), which can be
> > > > concurrently called on separate CPUs and which can be called from
> > > > interrupt context (with an arbitrary nesting level!) while it was running
> > > > in process context.
> > >
> > > Yes! And this is so on *purpose*. Please take some time to read the
> > > comment that goes along with it, and if you're still not convinced then
> > > look for those explanation emails I've already posted.
> >
> > I agree with Nicolas on this. It's abominably clever, but I think he's right.
> >
> > The one place I remain unconvinced is over the issue of preemption of a process
> > that is in the middle of cnt32_to_63(), where if the preempted process is
> > asleep for long enough, I think it can wind time backwards when it resumes, but
> > that's not a problem for the one place I want to use it (sched_clock()) because
> > that is (almost) always called with preemption disabled in one way or another.
> >
> > The one place it isn't is a debugging case that I'm not too worried about.
> >
>
> I am also concerned about the non-preemption off case.
>
> Then I think the function should document that it must be called with
> preempt disabled.
I explained several times already why I disagree. Preemption is not a
problem unless you're preempted away for long enough, or IOW if your
counter is too fast.
And no, ^Z on a process doesn't create preemption. This is a signal that
gets acted upon far away from the middle of cnt32_to_63().
Nicolas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists