Commit ba9c4f88 authored by Steven J. Magnani's avatar Steven J. Magnani Committed by Michal Simek
Browse files

microblaze: Allow PAGE_SIZE configuration



Allow developer to configure memory page size at compile time.
Larger pages can improve performance on some workloads.

Based on PowerPC code.

Signed-off-by: default avatarSteven J. Magnani <steve@digidescorp.com>
Signed-off-by: default avatarMichal Simek <monstr@monstr.eu>
parent 0d9ec762
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -223,6 +223,36 @@ config TASK_SIZE
	hex "Size of user task space" if TASK_SIZE_BOOL
	default "0x80000000"

choice
	prompt "Page size"
	default MICROBLAZE_4K_PAGES
	depends on ADVANCED_OPTIONS && !MMU
	help
	  Select the kernel logical page size. Increasing the page size
	  will reduce software overhead at each page boundary, allow
	  hardware prefetch mechanisms to be more effective, and allow
	  larger dma transfers increasing IO efficiency and reducing
	  overhead. However the utilization of memory will increase.
	  For example, each cached file will using a multiple of the
	  page size to hold its contents and the difference between the
	  end of file and the end of page is wasted.

	  If unsure, choose 4K_PAGES.

config MICROBLAZE_4K_PAGES
	bool "4k page size"

config MICROBLAZE_8K_PAGES
	bool "8k page size"

config MICROBLAZE_16K_PAGES
	bool "16k page size"

config MICROBLAZE_32K_PAGES
	bool "32k page size"

endchoice

endmenu

source "mm/Kconfig"
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
#define ELF_DATA	ELFDATA2MSB
#endif

#define ELF_EXEC_PAGESIZE	4096
#define ELF_EXEC_PAGESIZE	PAGE_SIZE


#define ELF_CORE_COPY_REGS(_dest, _regs)			\
+10 −2
Original line number Diff line number Diff line
@@ -23,8 +23,16 @@
#ifdef __KERNEL__

/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT	(12)
#define PAGE_SIZE	(_AC(1, UL) << PAGE_SHIFT)
#if defined(CONFIG_MICROBLAZE_32K_PAGES)
#define PAGE_SHIFT		15
#elif defined(CONFIG_MICROBLAZE_16K_PAGES)
#define PAGE_SHIFT		14
#elif defined(CONFIG_MICROBLAZE_8K_PAGES)
#define PAGE_SHIFT		13
#else
#define PAGE_SHIFT		12
#endif
#define PAGE_SIZE	(ASM_CONST(1) << PAGE_SHIFT)
#define PAGE_MASK	(~(PAGE_SIZE-1))

#define LOAD_OFFSET	ASM_CONST((CONFIG_KERNEL_START-CONFIG_KERNEL_BASE_ADDR))
+1 −0
Original line number Diff line number Diff line
@@ -126,6 +126,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
			cpuinfo.pvr_user1,
			cpuinfo.pvr_user2);

	count += seq_printf(m, "Page size:\t%lu\n", PAGE_SIZE);
	return 0;
}

+2 −2
Original line number Diff line number Diff line
@@ -43,10 +43,10 @@
.global empty_zero_page
.align 12
empty_zero_page:
	.space	4096
	.space	PAGE_SIZE
.global swapper_pg_dir
swapper_pg_dir:
	.space	4096
	.space	PAGE_SIZE

#endif /* CONFIG_MMU */

Loading