Skip to contentSkip to conversation

limit thread stack size with >4K pages

PATCH James Bottomley 3 participants 3 messages Mar 17, 2007 – Apr 21, 2007 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Review

Quoted 8 lines · Helge Deller
(quoted diff) +7 -1
-#define THREAD_ORDER            2
+#if defined(CONFIG_PARISC_PAGE_SIZE_4KB)
+# define THREAD_ORDER  2
+#elif defined(CONFIG_PARISC_PAGE_SIZE_16KB)
+# define THREAD_ORDER  0
+#elif defined(CONFIG_PARISC_PAGE_SIZE_64KB)
+# define THREAD_ORDER  0
+#endif

That's a bit ugly ... and would break if someone added new page sizes. Can't we do something like

#if PAGE_BITS > 16
#define THREAD_ORDER 0
#else
#define THREAD_ORDER (16 - PAGE_BITS)
#endif

?

James

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 9 lines · James Bottomley

That's a bit ugly ... and would break if someone added new page sizes. Can't we do something like

#if PAGE_BITS > 16
#define THREAD_ORDER 0
#else
#define THREAD_ORDER (16 - PAGE_BITS)
#endif

Nice.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw
Quoted 4 lines · Kyle McMartin
Quoted 3 lines · James Bottomley

That's a bit ugly ... and would break if someone added new page sizes. Can't we do something like

Quoted 8 lines
Quoted 6 lines

#if PAGE_BITS > 16
#define THREAD_ORDER 0
#else
#define THREAD_ORDER (16 - PAGE_BITS)
#endif

Nice.

Nice yes, but doesn't work.
Basically I think it would need to be PAGE_SHIFT (instead of PAGE_BITS is part of include/linux/raid/bitmap.h).

But with PAGE_SHIFT you get due to missing #includes lots of:
In file included from include/linux/thread_info.h:21,

                 from include/linux/preempt.h:9,
                 from include/linux/spinlock.h:49,
                 from include/linux/module.h:9,
                 from init/main.c:13:

include/asm/thread_info.h:37:5: warning: "PAGE_SHIFT" is not defined

Adding more #includes isn't a good idea either.

I still propose my initial patch: http://lists.parisc-linux.org/pipermail/parisc-linux/2007-March/031423.html
If someone adds new page sizes (is this likely?), he will stumble over the not-defined THREAD_ORDER anyway and will have to fix it acordingly.

Helge
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux