Re: [PATCH v2 0/8] sparc: use asm-generic/dma-mapping-common.h and pci-dma-compat.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* David Miller <davem@xxxxxxxxxxxxx> wrote:

> From: Ingo Molnar <mingo@xxxxxxx>
> Date: Sat, 18 Jul 2009 13:06:20 +0200
> 
> > I'm wondering why sparc32 frees from the middle of the kernel 
> > image. The way architectures generally do it is to put freeable 
> > pages into a separate section. That way it does not get mingled 
> > with the kernel core image area (which stays nicely continuous).
> 
> It's conditionally free'able, we actually use the pages if the 
> system is SMP and has more than cpu 0 installed.

Sounds similar to the alternate instructions section on x86:

 arch/x86/kernel/alternative.c:

        if (smp_alt_once)
                free_init_pages("SMP alternatives",
                                (unsigned long)__smp_locks,
                                (unsigned long)__smp_locks_end);

It's in a separate section and linked + freed separately. The linker 
script page-aligns it:

 arch/x86/kernel/vmlinux.lds.S:

        /*
         * smp_locks might be freed after init
         * start/end must be page aligned
         */
        . = ALIGN(PAGE_SIZE);
        .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
                __smp_locks = .;
                *(.smp_locks)
                __smp_locks_end = .;
                . = ALIGN(PAGE_SIZE);
        }

So that it can be freed. It's also placed next to the regular init 
section to not create too many holes. It also keeps the 'kernel text 
area' continuous and things like core_kernel_text() & co still work 
fine.

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux