Re: [PATCH] I3 sched tweaks...

Rusty Russell (rusty@rustcorp.com.au)
Thu, 17 Jan 2002 14:37:09 +1100


In message <Pine.LNX.4.33.0201162343290.18971-100000@localhost.localdomain> you
write:
>
> On Wed, 16 Jan 2002, Rusty Russell wrote:
>
> > > > 4) scheduler_tick needs no args (p is always equal to current).
> > >
> > > i have not taken this part. We have 'current' calculated in
> > > update_process_times(), so why not pass it along to the scheduler_tick()
> > > function?
> >
> > Because it's redundant. It's *always* p == current (and the code
> > assumes this!), but I had to grep the callers to find out.
>
> we pass pointers across functions regularly, even if the pointer could be
> calculated within the function. We do this in the timer code too.

Look at it semantically: scheduler_tick() is just a function called
regularly for scheduler maintenance. It might need the CPU number,
the runqueue length, or phase of the moon: the caller shouldn't care.

If it was a static fn, maybe this optimization makes sense. But it's
an interface wart, and the "optimization" is utterly marginal anyway.

That said, I never would have sent such a trivial patch by itself: I
can't believe how many keystrokes were wasted over this issue!

Rusty.

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/