Re: [PATCH] limit thread stack size with >4K pages

Helge Deller <[email protected]>
Newsgroups gmane.linux.ports.hppa
Message-ID <[email protected]>
On Saturday 17 March 2007, Kyle McMartin wrote:
> On Sat, Mar 17, 2007 at 08:47:44AM -0500, James Bottomley wrote:
> > 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.

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.