Re: [PATCH] task_struct + kernel stack colouring ...

Shuji YAMAMURA (yamamura@flab.fujitsu.co.jp)
Thu, 06 Dec 2001 17:34:35 +0900


From: Manfred Spraul <manfred@colorfullife.com>
Subject: Re: [PATCH] task_struct + kernel stack colouring ...
Date: Wed, 05 Dec 2001 21:33:56 +0100
Message-ID: <3C0E84B4.1070808@colorfullife.com>

> Shuij, I don't understand why you need both a shift and a modulo:
> address % odd_number should generate a random distribution (i.e. all
> bits affect the result), even without the shift.

Yes, you are right. The shift operation is unnecessary.
Sorry for your confusion.

And probably, the modulo method is better than copying bits, because
it does not depend on the cache configuration.

My posted patch did't use modulo in order to avoid the overhead of
get_current(), which is frequently called. But, copy_thread() is
called once to generate a process, so such overhead may not be the
problem.

Additionally, we measured cache line conflict statistics of stack tops
by snapshotting them during running of apache on 1MB L2-cache system.
The modulo colouring certainly reduces the cache line collisions.

# of tasks # of cache line # of collisions
used AVG(MAX)
--------------------------------------------------------------
Davide's Patch 246 32 7.68(14)
(original)
Davide's Patch 244 165 1.48(6)
(copying 16 to 18 bits)
Davide's Patch 244 164 1.49(4)
(modulo 9)

but, we could't see the meaningful performance difference among them
at least in this experimentation.

Thank you,

-----
Computer Systems Laboratories, Fujitsu Labs.
Shuji YAMAMURA (yamamura@flab.fujitsu.co.jp)
-
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/