On Mon, Sep 8, 2008 at 2:05 AM, <[EMAIL PROTECTED]> wrote:
> Revision 5251 Author gyang Date 2008-09-08 01:05:11 -0500 (Mon, 08 Sep 2008)
>
> Log Message
>
> Task [#2299], use CONFIG_KERNEL_STACKS_L1 to enable or disable putting
> kernel stacks in L1, default is enabled, smp kernel need turn it off
umm, i think you've named this incorrectly. nowhere do we put kernel
stacks into L1. the code you've ifdef-ed out (FLAT) is for putting a
single application's stack into L1 scratch pad.
> Modified: trunk/arch/blackfin/Kconfig (5250 => 5251)
> +config KERNEL_STACKS_L1
> + bool "Locate kernel stacks in L1 Scratch Memory"
> + default y
> + depends on !BF531
> + help
> + If enabled the kernel stacks are located
> + into L1 scratch memory (less latency).
disallowing BF531 makes no sense. all Blackfin's have the same L1
scratch pad at the same address and of the same length.
> Modified: trunk/fs/binfmt_flat.c (5250 => 5251)
> @@ -417,6 +417,9 @@
> unsigned long *extra_stack,
> unsigned long *stack_base)
> {
> +#ifndef CONFIG_KERNEL_STACKS_L1
> + static int l1stk_disable_warn_once;
> +#endif
> struct flat_hdr * hdr;
> unsigned long textpos = 0, datapos = 0, result;
> unsigned long realdatastart = 0;
> @@ -502,6 +505,13 @@
> return -ENOMEM;
>
> if (flags & FLAT_FLAG_L1STK) {
> +#ifndef CONFIG_KERNEL_STACKS_L1
> + flags &= ~FLAT_FLAG_L1STK;
> + if (!l1stk_disable_warn_once) {
> + l1stk_disable_warn_once = 1;
> + printk(KERN_NOTICE "BINFMT_FLAT: L1 stack support
> disabled - will
> continue anyway\n");
> + }
> +#else
> }
>
> /* Flush all traces of the currently running executable */
> @@ -798,8 +809,10 @@
>
> return 0;
> out_fail:
> +#ifdef CONFIG_KERNEL_STACKS_L1
> if (flags & FLAT_FLAG_L1STK)
> free_l1stack();
> +#endif
> return result;
> }
>
there's no need to separate the warning decl from the usage as it only
gets used in nested if scope. combining the #ifdef's lessens the
mess. then again, i'd say you should be warning on every application
that gets executed, not just once and then go silent. also, since you
negate the bit in the flags var, there is no need for ifdef'ing the
free_l1stack() in the error path.
> @@ -920,6 +933,7 @@
> /* Stash our initial stack pointer into the mm structure */
> current->mm->start_stack = (unsigned long )sp;
>
> +#ifdef CONFIG_KERNEL_STACKS_L1
> if (l1stack_base) {
> /* Find L1 stack pointer corresponding to the current bottom
> of the stack in normal RAM. */
> @@ -927,6 +941,7 @@
> if (!activate_l1stack(current->mm, ramstack_top - stack_len))
> l1stack_base = 0;
> }
> +#endif
same thing here ... it is impossible for l1stack_base to be non-zero
after your changes in load_flat_file(), thus there is no need to stick
ifdef's here.
-mike
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits