Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Blackfin: drop unused bad_page pages and move zero_page to the bss

The empty_bad_page/empty_bad_page_table pages are unused, so punt them.
The zero_page is always allocated, so push it out to the bss to speed up
the booting process a bit and pack data nicer.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

+6 -26
+2 -1
arch/blackfin/include/asm/pgtable.h
··· 80 80 * ZERO_PAGE is a global shared page that is always zero: used 81 81 * for zero-mapped memory areas etc.. 82 82 */ 83 - #define ZERO_PAGE(vaddr) (virt_to_page(0)) 83 + #define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page) 84 + extern char empty_zero_page[]; 84 85 85 86 extern unsigned int kobjsize(const void *objp); 86 87
+4 -25
arch/blackfin/mm/init.c
··· 15 15 #include "blackfin_sram.h" 16 16 17 17 /* 18 - * BAD_PAGE is the page that is used for page faults when linux 19 - * is out-of-memory. Older versions of linux just did a 20 - * do_exit(), but using this instead means there is less risk 21 - * for a process dying in kernel mode, possibly leaving a inode 22 - * unused etc.. 23 - * 24 - * BAD_PAGETABLE is the accompanying page-table: it is initialized 25 - * to point to BAD_PAGE entries. 26 - * 27 - * ZERO_PAGE is a special page that is used for zero-initialized 28 - * data and COW. 18 + * ZERO_PAGE is a special page that is used for zero-initialized data and COW. 19 + * Let the bss do its zero-init magic so we don't have to do it ourselves. 29 20 */ 30 - static unsigned long empty_bad_page_table; 31 - 32 - static unsigned long empty_bad_page; 33 - 34 - static unsigned long empty_zero_page; 21 + char empty_zero_page[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE))); 22 + EXPORT_SYMBOL(empty_zero_page); 35 23 36 24 #ifndef CONFIG_EXCEPTION_L1_SCRATCH 37 25 #if defined CONFIG_SYSCALL_TAB_L1 ··· 46 58 unsigned long end_mem = memory_end & PAGE_MASK; 47 59 48 60 pr_debug("start_mem is %#lx virtual_end is %#lx\n", PAGE_ALIGN(memory_start), end_mem); 49 - 50 - /* 51 - * initialize the bad page table and bad page to point 52 - * to a couple of allocated pages 53 - */ 54 - empty_bad_page_table = (unsigned long)alloc_bootmem_pages(PAGE_SIZE); 55 - empty_bad_page = (unsigned long)alloc_bootmem_pages(PAGE_SIZE); 56 - empty_zero_page = (unsigned long)alloc_bootmem_pages(PAGE_SIZE); 57 - memset((void *)empty_zero_page, 0, PAGE_SIZE); 58 61 59 62 /* 60 63 * Set up SFC/DFC registers (user data space)