[PATCH] D25766: [ELF] - Implemented --section-ordering-file option.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 30 10:43:05 PDT 2016
>> Minimizing the number of page faults is not a goal of this feature (although
>> it could be a measure to achieve it.) You want to measure the start up time
>> of the app. That's what this feature was originally designed for.
>
>Yes. The suggestion of looking at page faults is just for an easier to
>reproduce number to look at first.
>
>I am under the impression that this can also be useful for instruction
>cache on a running application. Which order file is used to optimize
>that is obviously different (the one created by
>function_reordering_plugin), but the linker option is the same.
>
>Cheers,
>Rafael
Yeah, I am looking on page faults because want to see the
noticable difference, though I do not forget about looking at startup time.
Last my results are below.
As I mentioned I forward ported 6 years old icegring valgrind patch
(https://bugzilla.mozilla.org/show_bug.cgi?id=549749) to produce sections list file for regular firefox build.
Just in case I shared it here:
https://drive.google.com/file/d/0B_OWr6ld9gUmWjkwMmtLeDZxQTA/view
I tried both VM and real hardware tests of my lld patch with that file and saw no difference
in pagefaults and startup time.
Finally I decided to use just vanila gold linker
which has this option implemented in case lld patch has some issues.
I tested on old real hardware with HDD (not SSD) for that last time, I expected
to see launch time boost because of that.
And I still do not observe any difference.
For example next are average numbers I see from 5 sequentual runs
of ordered and unordered builds. I am lauching firefox and close it as soon as
I see full UI on screen. Yes, I am closing it manually, but average numbers are anyways are the same:
Performance counter stats for '/home/umb/tests/firefox/mozilla-central/obj-x86_64-pc-linux-gnu/dist/bin/firefox -no-remote -profile /home/umb/tests/firefox/mozilla-central/obj-x86_64-pc-linux-gnu/tmp/scratch_user'
9275,574798 task-clock (msec) # 1,218 CPUs utilized
16 818 context-switches # 0,002 M/sec
936 cpu-migrations # 0,101 K/sec
116 713 page-faults # 0,013 M/sec
23 194 539 659 cycles # 2,501 GHz (49,46%)
<not supported> stalled-cycles-frontend
<not supported> stalled-cycles-backend
8 179 492 869 instructions # 0,35 insns per cycle (74,69%)
1 755 530 791 branches # 189,264 M/sec (74,94%)
144 524 901 branch-misses # 8,23% of all branches (75,72%)
7,615463859 seconds time elapsed
Performance counter stats for '/home/umb/tests/firefox/ordered/mozilla-central/obj-x86_64-pc-linux-gnu/dist/bin/firefox -no-remote -profile /home/umb/tests/firefox/ordered/mozilla-central/obj-x86_64-pc-linux-gnu/tmp/scratch_user':
9300,245987 task-clock (msec) # 1,227 CPUs utilized
17 213 context-switches # 0,002 M/sec
966 cpu-migrations # 0,104 K/sec
116 913 page-faults # 0,013 M/sec
23 328 142 841 cycles # 2,508 GHz (49,94%)
<not supported> stalled-cycles-frontend
<not supported> stalled-cycles-backend
8 367 279 963 instructions # 0,36 insns per cycle (75,55%)
1 772 610 613 branches # 190,598 M/sec (74,98%)
146 712 893 branch-misses # 8,28% of all branches (75,20%)
7,580559286 seconds time elapsed
As you can see there is no real difference in pagefaults or time.
I prepared another patch that takes symbol list file instead of sections list file: https://reviews.llvm.org/D26130,
tomorrow I am going to check combination of Rafael's script with this patch, probably that can change something.
George.
More information about the llvm-commits
mailing list