Re: [PATCH] init: use KERNEL_DS when trying to start init process

From: Mathias Krause
Date: Thu Jun 09 2011 - 08:06:49 EST


On Thu, Jun 9, 2011 at 12:40 PM, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
> On Thu, Jun 09, 2011 at 10:14:03AM +0200, Mathias Krause wrote:
>
>> v1 was actually the alternative solution in run_init_process()
>> v2 was missing the set_fs() calls for SPARC, TILE and Xtensa
>
> sparc does not need it...

So do FRV, M68k (MMU and NOMMU) and PA-RISC. But they all call
set_fs(USER_DS) in flush_thread() and additionally in start_thread().
As those architectures aren't that visible for the average user, I
guess this is just an oversight that has no measurable performance
impact anyway.

For SPARC we might not want this duplicated work so the call to
set_fs() in flush_thread() should be removed to equalize the semantics
of that function between the different architectures -- call
set_fs(USER_DS) only in start_thread() (with the above exceptions).
...Albeit by looking closer at the implementation of flush_old_exec()
I think we should just move the set_fs() call there and remove it from
the architecture dependent implementations of flush_thread() and
start_thread(). flush_old_exec() is the real point of no return and
this way we get it consistent between all architectures.

What do you think?

Mathias
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/