Re: [PATCH 04/21] sched: implement scheduler notifiers

Tejun Heo
2009-11-16T18:44:53Z

Hello,

Avi Kivity wrote:
> Four hlist_heads (64 bytes) is pretty heavy for this.

hlist_head is one pointer, so it will be 32bytes on 64bit machines.

> I having all members present in sched_notifier (instead of a union)
> and calling a callback if it is not NULL. This reduces the overhead
> to 16 bytes at the expense of an extra check for sched_notifier
> users.

And it will reduce the overhead to 8 bytes. Anyways, Linus was
against walking the list multiple times for different callbacks and
the way kvm uses these notifiers doesn't work very well with
allocating separate table on demand, so I just went with four
pointers. Given that these notifiers are quite unpopular yet, I lean
toward Avi's suggestion. Linus?

> Besides this, is there any difference to preempt_notifiers? if not we
> can just add the new members and rename.

Yeap, if we're gonna add things to ops table, I agree that would be
better.

Thanks.

--
tejun