You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
init: Add CONFIG_ROCKCHIP_THUNDER_BOOT_DEFER_FREE_MEMBLOCK
Allow defer free large memblock to Buddy allocator work on !CONFIG_ROCKCHIP_THUNDER_BOOT. Change-Id: I30f851f648b007d1629eed27ba464ad2d7425577 Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This commit is contained in:
@@ -250,10 +250,25 @@ config ROCKCHIP_MINI_KERNEL
|
||||
config ROCKCHIP_THUNDER_BOOT
|
||||
bool "Rockchip Thunder Boot support"
|
||||
depends on NO_GKI
|
||||
select ROCKCHIP_THUNDER_BOOT_DEFER_FREE_MEMBLOCK if SMP
|
||||
help
|
||||
Say y here to enable Rockchip thunder boot support.
|
||||
This option make the kernel boot faster.
|
||||
|
||||
config ROCKCHIP_THUNDER_BOOT_DEFER_FREE_MEMBLOCK
|
||||
bool "Defer free large memblock to Buddy allocator"
|
||||
depends on SMP
|
||||
depends on NO_GKI
|
||||
help
|
||||
The physical memory of a system is divided into several types, like
|
||||
memory reserved for device, for kernel pagetable, etc. The remaining
|
||||
area is for Buddy allocator. Normally, The memory for Buddy is consist
|
||||
of different size blocks, so, under meeting the memory request of kernel
|
||||
booting, we can defer free the large block size to Buddy which can be
|
||||
done later in work queue in parallel to other kernel threads, and the
|
||||
size of the large block can be defined in kernel command line
|
||||
by "defer_free_block_size" boot parameter.
|
||||
|
||||
config ROCKCHIP_THUNDER_BOOT_MMC
|
||||
bool "Rockchip Thunder Boot from MMC"
|
||||
depends on ROCKCHIP_THUNDER_BOOT
|
||||
|
||||
@@ -24,7 +24,7 @@ extern unsigned long max_pfn;
|
||||
*/
|
||||
extern unsigned long long max_possible_pfn;
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT
|
||||
#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT_DEFER_FREE_MEMBLOCK
|
||||
extern int defer_free_memblock(void *unused);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1819,7 +1819,7 @@ static noinline void __init kernel_init_freeable(void)
|
||||
smp_init();
|
||||
sched_init_smp();
|
||||
|
||||
#if defined(CONFIG_ROCKCHIP_THUNDER_BOOT) && defined(CONFIG_SMP)
|
||||
#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT_DEFER_FREE_MEMBLOCK
|
||||
kthread_run(defer_free_memblock, NULL, "defer_mem");
|
||||
#endif
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ struct pglist_data __refdata contig_page_data;
|
||||
EXPORT_SYMBOL(contig_page_data);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ROCKCHIP_THUNDER_BOOT) && defined(CONFIG_SMP)
|
||||
#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT_DEFER_FREE_MEMBLOCK
|
||||
static int db_count __initdata;
|
||||
#define DB_COUNT_MAX 4
|
||||
|
||||
@@ -2066,7 +2066,7 @@ static void __init __free_pages_memory(unsigned long start, unsigned long end)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(CONFIG_ROCKCHIP_THUNDER_BOOT) && defined(CONFIG_SMP)
|
||||
#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT_DEFER_FREE_MEMBLOCK
|
||||
int __init defer_free_memblock(void *unused)
|
||||
{
|
||||
int i;
|
||||
@@ -2100,7 +2100,7 @@ static unsigned long __init __free_memory_core(phys_addr_t start,
|
||||
if (start_pfn >= end_pfn)
|
||||
return 0;
|
||||
|
||||
#if defined(CONFIG_ROCKCHIP_THUNDER_BOOT) && defined(CONFIG_SMP)
|
||||
#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT_DEFER_FREE_MEMBLOCK
|
||||
pr_debug("%s, start = %pa, end = %pa\n", __func__, &start, &end);
|
||||
if ((end - start) > defer_free_block_size && (db_count < ARRAY_SIZE(db))) {
|
||||
db[db_count].defer_start = start_pfn;
|
||||
|
||||
Reference in New Issue
Block a user