[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] const / static (against current CVS)

From: Andreas Mohr
Subject: [Qemu-devel] [PATCH] const / static (against current CVS)
Date: Tue, 23 Aug 2005 19:40:26 +0200
User-agent: Mutt/

Hello all,

Introduction part:
I'm doing a performance tuning effort all over the place in
frequently-used Linux programs:
I'm trying to mark as many data areas as possible const (and static)
in various programs (at those places where it's actually feasible,
that is).

This should have the following benefits:
a) more .rodata (read-only) pages in programs, which means that
pages (since they're read-only and can thus be restored from the binary any
time) can simply be discarded instead of having to be paged out when
free memory is getting low
b) more page sharing between program instances due to less
modified / read-write (and thus unique instance *per-program*!) memory pages
c) various const compiler optimizations kicking in
d) less linker work to be done (static)
e) we detect previously silent memory corruption (random data area trashing)

(use "objdump -x" to analyze what can be improved)

In smaller programs marking variables as const won't be enough to get
several whole pages (4K size) back to read-only, but it goes into the
right direction after all, since we don't intend to actually increase
the number of read-write pages...

This patch against current CVS adds const and/or static to numerous structs
that obviously could be made so. It compiles without any warnings,
and qemu even still runs! ;-)

Patch had been posted to "Patches Repository" on User Forum about a month
ago, but of course that wasn't enough... (silly me)

Thank you,

Andreas Mohr
(patch attached)

GNU/Linux. It's not the software that's free, it's you.

Attachment: qemu_const.diff
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]