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

From: Tejun Heo
Date: Mon Nov 16 2009 - 13:45:04 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/