Re: [PATCH] x86_64: uninline TASK_SIZE

2019-04-24 Thread Ingo Molnar
* Andy Lutomirski wrote: > > Or am I missing some complication? > > Seems like a great idea to me. > > BTW, what the heck is up with get_gate_page()? I'm struggling to > understand what it's even trying to do. If there's an architecture > that allows a user program to mremap() or otherwise

Re: [PATCH] x86_64: uninline TASK_SIZE

2019-04-23 Thread Andy Lutomirski
On Tue, Apr 23, 2019 at 4:13 AM Ingo Molnar wrote: > > > * Andy Lutomirski wrote: > > > > Saving 2KB on a defconfig is quite a lot. > > > > Saving 2kB of text by adding 8 bytes to thread_info seems rather > > dubious to me. You only need 256 tasks before you lose. My > >

Re: [PATCH] x86_64: uninline TASK_SIZE

2019-04-23 Thread Ingo Molnar
* Andy Lutomirski wrote: > > Saving 2KB on a defconfig is quite a lot. > > Saving 2kB of text by adding 8 bytes to thread_info seems rather > dubious to me. You only need 256 tasks before you lose. My > not-particularly-loaded laptop has 865 tasks right now. I was suggesting

Re: [PATCH] x86_64: uninline TASK_SIZE

2019-04-22 Thread Andy Lutomirski
On Mon, Apr 22, 2019 at 3:09 PM Alexey Dobriyan wrote: > > On Mon, Apr 22, 2019 at 07:30:40AM -0700, Andy Lutomirski wrote: > > > > > > > On Apr 22, 2019, at 3:34 AM, Ingo Molnar wrote: > > > > > > > > > * Alexey Dobriyan wrote: > > > > > > +++ b/arch/x86/kernel/task_size_64.c > > > @@

Re: [PATCH] x86_64: uninline TASK_SIZE

2019-04-22 Thread Linus Torvalds
On Sun, Apr 21, 2019 at 9:06 AM Alexey Dobriyan wrote: > > TASK_SIZE macro is quite deceptive: it looks like a constant but in fact > compiles to 50+ bytes. Honestly, if you are interested in improving TASK_SIZE, I'd really like to see you try to go even further than this. TASK_SIZE _used_ to

Re: [PATCH] x86_64: uninline TASK_SIZE

2019-04-22 Thread Alexey Dobriyan
On Mon, Apr 22, 2019 at 07:30:40AM -0700, Andy Lutomirski wrote: > > > > On Apr 22, 2019, at 3:34 AM, Ingo Molnar wrote: > > > > > > * Alexey Dobriyan wrote: > > > > +++ b/arch/x86/kernel/task_size_64.c > > @@ -0,0 +1,9 @@ > > +#include > > +#include > > +#include >

Re: [PATCH] x86_64: uninline TASK_SIZE

2019-04-22 Thread Alexey Dobriyan
On Mon, Apr 22, 2019 at 12:34:49PM +0200, Ingo Molnar wrote: > When set_personality_ia32() is called then TIF_ADDR32 is set > unconditionally, without any Kconfig variations. Indeed. personality(PER_LINUX32) = 0 (PER_LINUX) I only wasted about half an evening ifdefing TIF_ flags.

Re: [PATCH] x86_64: uninline TASK_SIZE

2019-04-22 Thread Andy Lutomirski
> On Apr 22, 2019, at 3:34 AM, Ingo Molnar wrote: > > > * Alexey Dobriyan wrote: > > +++ b/arch/x86/kernel/task_size_64.c > @@ -0,0 +1,9 @@ > +#include > +#include > +#include > + > +unsigned long _task_size(void) > +{ > +return

Re: [PATCH] x86_64: uninline TASK_SIZE

2019-04-22 Thread Ingo Molnar
* Alexey Dobriyan wrote: > > >> +++ b/arch/x86/kernel/task_size_64.c > > >> @@ -0,0 +1,9 @@ > > >> +#include > > >> +#include > > >> +#include > > >> + > > >> +unsigned long _task_size(void) > > >> +{ > > >> +return test_thread_flag(TIF_ADDR32) ? IA32_PAGE_OFFSET : > >

Re: [PATCH] x86_64: uninline TASK_SIZE

2019-04-21 Thread Alexey Dobriyan
On Sun, Apr 21, 2019 at 01:07:08PM -0700, h...@zytor.com wrote: > On April 21, 2019 11:28:42 AM PDT, Ingo Molnar wrote: > > > >* Alexey Dobriyan wrote: > > > >> TASK_SIZE macro is quite deceptive: it looks like a constant but in > >fact > >> compiles to 50+ bytes. > >> > >> Space savings on

Re: [PATCH] x86_64: uninline TASK_SIZE

2019-04-21 Thread hpa
On April 21, 2019 11:28:42 AM PDT, Ingo Molnar wrote: > >* Alexey Dobriyan wrote: > >> TASK_SIZE macro is quite deceptive: it looks like a constant but in >fact >> compiles to 50+ bytes. >> >> Space savings on x86_64 defconfig: >> >> add/remove: 1/0 grow/shrink: 3/24 up/down: 77/-2247 (-2170)

Re: [PATCH] x86_64: uninline TASK_SIZE

2019-04-21 Thread Ingo Molnar
* Alexey Dobriyan wrote: > TASK_SIZE macro is quite deceptive: it looks like a constant but in fact > compiles to 50+ bytes. > > Space savings on x86_64 defconfig: > > add/remove: 1/0 grow/shrink: 3/24 up/down: 77/-2247 (-2170) > Function old new

[PATCH] x86_64: uninline TASK_SIZE

2019-04-21 Thread Alexey Dobriyan
TASK_SIZE macro is quite deceptive: it looks like a constant but in fact compiles to 50+ bytes. Space savings on x86_64 defconfig: add/remove: 1/0 grow/shrink: 3/24 up/down: 77/-2247 (-2170) Function old new delta _task_size