Right. Well, I'm just saying that there are cases where it doesn't work, so it's a bit akin a voodoo feature you enable and then convince yourself that there is a speed benefit. It is only when you read AnonHugePages line from /proc/meminfo and see, for instance, that only 64 MB is actually in hugepages that you realize it isn't all it's cracked up to be. But hey, it's better than nothing, right?
I was wondering if there shouldn't be a memory defragmenting task that goes through the running process' heap periodically and would move the 4k pages around until coalescing them to a hugepage becomes possible. I mean, if using these pages really gives you around 5 % performance benefit, it would seem reasonable to spend up to few % of CPU to do it for tasks that seem long-lived enough.