i386: always use 4k stacks
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 2 lines · Horst von Brand
"With some drawbacks" is the point: It has been determined that the drawbacks are heavy enough that the 8KiB stack option should go.
Determined by voodoo and wild guessing.
Let's detect the need for 4K stacks: (I hope I found the correct place)
(Maybe the printk should be completely ifdefed, but I'm not sure)
kernel/fork.c 2005-12-21 19:15:23.000000000 +0100 renamed from kernel/fork.c.ori 2005-12-21 19:06:24.000000000 +0100 +5 -0
@@ -168,4 +168,9 @@ static struct task_struct *dup_task_stru if (!ti) { free_task_struct(tsk); + printk(KERN_WARNING, "Can't allocate new task structure" +#ifndef CONFIG_4KSTACKS + ". Maybe you could benefit from 4K stacks.\n" +#endif + "\n"); return NULL; }
Signature · 2 lines
Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF verbreiteten Lügen zu sabotieren.
Quoted 18 lines · Bodo Eggert
Quoted 2 lines · Horst von Brand
"With some drawbacks" is the point: It has been determined that the drawbacks are heavy enough that the 8KiB stack option should go.
Determined by voodoo and wild guessing.
Let's detect the need for 4K stacks: (I hope I found the correct place)
(Maybe the printk should be completely ifdefed, but I'm not sure)
Signed-off-by Bodo Eggert <[email protected]>
kernel/fork.c 2005-12-21 19:15:23.000000000 +0100 static struct task_struct *dup_task_stru · line 176
Quoted 9 lines
kernel/fork.c 2005-12-21 19:15:23.000000000 +0100 renamed from kernel/fork.c.ori 2005-12-21 19:06:24.000000000 +0100 +5
-0@@ -168,4 +168,9 @@ static struct task_struct *dup_task_stru if (!ti) { free_task_struct(tsk); + printk(KERN_WARNING, "Can't allocate new task structure" +#ifndef CONFIG_4KSTACKS + ". Maybe you could benefit from 4K stacks.\n" +#endif + "\n"); return NULL; }
This patch is not OK but for i386 architecture.
For example, x86_64 cannot use a 4K stack, it needs a 8KB stack (so a order-1 allocation that may fail)
Eric
Quoted 6 lines · Bodo Eggert
Quoted 2 lines · Horst von Brand
"With some drawbacks" is the point: It has been determined that the drawbacks are heavy enough that the 8KiB stack option should go.
Determined by voodoo and wild guessing.
Bullshit. There's no more guessing involved than you thinking 8K stacks
are sufficient. How do you know that 8K stacks are enough? If you
don't understand the testing and common sense that has gone into 4K+4K stacks you should really be putting in a patch for 128K stacks, because you don't have any proof that 8K stacks are sufficient either (except by
voodoo and wild guessing). However, if you _do_ understand the testing
and coding methods then you'll see that 4K + 4K stacks are sufficient (modulo any bugs, which should be fixed).
Sean
Quoted 22 lines
Let's detect the need for 4K stacks: (I hope I found the correct place)
(Maybe the printk should be completely ifdefed, but I'm not sure)
Signed-off-by Bodo Eggert <[email protected]>kernel/fork.c 2005-12-21 19:15:23.000000000 +0100 renamed from kernel/fork.c.ori 2005-12-21 19:06:24.000000000 +0100 +5
-0@@ -168,4 +168,9 @@ static struct task_struct *dup_task_stru if (!ti) { free_task_struct(tsk); + printk(KERN_WARNING, "Can't allocate new task structure" +#ifndef CONFIG_4KSTACKS + ". Maybe you could benefit from 4K stacks.\n" +#endif + "\n"); return NULL; }
kernel/fork.c 2005-12-21 19:15:23.000000000 +0100 static struct task_struct *dup_task_stru
Quoted 5 lines · Bodo Eggert
kernel/fork.c 2005-12-21 19:15:23.000000000 +0100 renamed from kernel/fork.c.ori 2005-12-21 19:06:24.000000000 +0100 +5
-0+ printk(KERN_WARNING, "Can't allocate new task structure" +#ifndef CONFIG_4KSTACKS + ". Maybe you could benefit from 4K stacks.\n" +#endif + "\
A sarcastic patch, nice. So, lets try to get something useful from this flamewar...sight.
The 4k patch is being proposed for -mm. Personally I'm _shocked_ that so many people is trying to avoid _testing_ (-mm is for testing, isn't it) this feature so hard. Which is surprising, since merging it into -mm may prove that they're right (people will report bugs caused by 4k stacks, etc). Maybe 8k groupies are not willing to be proved that they're right, or they're afraid of being proven that they're wrong? </sarcasm>
Now, seriously:
I think that most of the 8k groupies don't like 4k not because it doesn't works in the common case, but because it could cause hangs that are not easy to reproduce (ie: they are paranoid). The combination of code paths is too big and complex. I can understand that.
What I don't know is why you think that 8k will be "safe". As far as I know, there're have been stacks overflows with 8KB stacks in the past (ie, "hangs that are not easy to reproduce") before the 4k stack patch was proposed, and the _one_ reason why now it's very safe to run with 8k stacks is because the 4k stack patch has forced people to do stack diets, not because 8k is the best option.
We have *NO* *WAY* of proving that it's safe to run either 4k or 8k stacks. Face it. And since such bugs can exist no matter what stack size you use, the best option (IMO) is to choose the option that will allow us to hit those bugs _faster_, ie: 4k stacks. From a engineering point of view, I can't understand why hiding the problem is better than choosing the path that will allow to hit and fix those bugs faster. It remembers me of "security through obscurity". What we will do when we have too may overflows with 8K? 16K stacks? Oh, let me guess: "we'll fix it"?. Well, and why can't we fix 4k stacks???
Now, the code is easy to maintain and some people depends on 8k stacks, as akpm pointed out in http://lkml.org/lkml/2005/12/15/336
This patch (http://lkml.org/lkml/2005/12/16/89) stolen from^W^Winspired by Adrian Bunk defaults to 4k, makes the 8k people happy and it should make akpm happy too.
Can someone tell me a reason why all this stupid flamewar can't be solved with that patch?
Quoted 17 lines · Bodo Eggert
Quoted 2 lines · Horst von Brand
"With some drawbacks" is the point: It has been determined that the drawbacks are heavy enough that the 8KiB stack option should go.
Determined by voodoo and wild guessing.
Let's detect the need for 4K stacks: (I hope I found the correct place)
(Maybe the printk should be completely ifdefed, but I'm not sure)
Signed-off-by Bodo Eggert <[email protected]>
kernel/fork.c 2005-12-21 19:15:23.000000000 +0100 static struct task_struct *dup_task_stru · line 176
Quoted 9 lines
kernel/fork.c 2005-12-21 19:15:23.000000000 +0100 renamed from kernel/fork.c.ori 2005-12-21 19:06:24.000000000 +0100 +5
-0@@ -168,4 +168,9 @@ static struct task_struct *dup_task_stru if (!ti) { free_task_struct(tsk); + printk(KERN_WARNING, "Can't allocate new task structure" +#ifndef CONFIG_4KSTACKS + ". Maybe you could benefit from 4K stacks.\n" +#endif + "\n"); return NULL; }
Two newlines in case of 4Kstacks...
Pavel
Signature · 1 line
Thanks, Sharp!