From: Gabriel Corona Date: Mon, 3 Nov 2014 12:04:18 +0000 (+0100) Subject: [mc] Do nto clean the main stack X-Git-Tag: v3_12~732^2~244 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f710e2d7c97fa76f9eaa390e5537bbeb1edbe8f9 [mc] Do nto clean the main stack We only need to clean the stacks of the application processes. Otherwise, we spend a *lot* of time cleaniong the stack in the MC code which slows SimGridMC a lot and is useless anyway. The way we check if we need to clean the stack is currently quite haskish and could be improved. --- diff --git a/tools/stack-cleaner/clean-stack-filter b/tools/stack-cleaner/clean-stack-filter index 8c5c01ca1c..fdeacfc4b0 100755 --- a/tools/stack-cleaner/clean-stack-filter +++ b/tools/stack-cleaner/clean-stack-filter @@ -23,11 +23,20 @@ sub emit_code { my $offset = - $size - 8; if($size != 0) { + # This is a crude hack to disable the stack cleaning on the main + # stack. It rellies on the fact that the main stack is high in + # the address space and the other stacks are in the hap (lower). + print("\tmovq \$0x7ffff7ff8000, %r11\n"); + print("\tcmpq %r11, %rsp\n"); + print("\tjle .Lstack_cleaner_done$id\n"); + + # Loop over the stack frame quadwords and zero it: print("\tmovabsq \$$qsize, %r11\n"); print(".Lstack_cleaner_loop$id:\n"); print("\tmovq \$0, $offset(%rsp,%r11,8)\n"); print("\tsubq \$1, %r11\n"); print("\tjne .Lstack_cleaner_loop$id\n"); + print(".Lstack_cleaner_done$id:\n"); } print $lines;