Hi Adhemerval, If my memory does not betray me, I believe the reason why the hugepages would not be relevant was because the mprotect to the guard region would enforce different protection on part of the huge page. In that sense you could test if the guard region is a part of the of the first page. If it is it would mean that the page would be broken in smaller parts and it should advise for smaller pages. While debugging I realized as well you were chacking for allignment of "mem" however for the common case STACK_GROWS_DOWN, the relevant allignment to check is the start of the stack (end of the memory allocated). I have included your patch with some changes which I think make a reasonable estimation. In any case, I would like to keep the tunable, as I think it is armless and makes sense. BTW, you mentioned that you would install the tunable patch in a previous email. Maybe you forgot. I am waiting for it to do some internal backporting. ;-) Regards, Cupertino