forked from mirrors/linux
		
	Add a kernel parameter stack_depot_disable to disable stack depot. So that stack hash table doesn't consume any memory when stack depot is disabled. The use case is CONFIG_PAGE_OWNER without page_owner=on. Without this patch, stackdepot will consume the memory for the hashtable. By default, it's 8M which is never trivial. With this option, in CONFIG_PAGE_OWNER configured system, page_owner=off, stack_depot_disable in kernel command line, we could save the wasted memory for the hashtable. [akpm@linux-foundation.org: fix CONFIG_STACKDEPOT=n build] Link: https://lkml.kernel.org/r/1611749198-24316-2-git-send-email-vjitta@codeaurora.org Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org> Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org> Cc: Alexander Potapenko <glider@google.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Yogesh Lal <ylal@codeaurora.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
		
			
				
	
	
		
			33 lines
		
	
	
	
		
			768 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
	
		
			768 B
		
	
	
	
		
			C
		
	
	
	
	
	
/* SPDX-License-Identifier: GPL-2.0-or-later */
 | 
						|
/*
 | 
						|
 * A generic stack depot implementation
 | 
						|
 *
 | 
						|
 * Author: Alexander Potapenko <glider@google.com>
 | 
						|
 * Copyright (C) 2016 Google, Inc.
 | 
						|
 *
 | 
						|
 * Based on code by Dmitry Chernenkov.
 | 
						|
 */
 | 
						|
 | 
						|
#ifndef _LINUX_STACKDEPOT_H
 | 
						|
#define _LINUX_STACKDEPOT_H
 | 
						|
 | 
						|
typedef u32 depot_stack_handle_t;
 | 
						|
 | 
						|
depot_stack_handle_t stack_depot_save(unsigned long *entries,
 | 
						|
				      unsigned int nr_entries, gfp_t gfp_flags);
 | 
						|
 | 
						|
unsigned int stack_depot_fetch(depot_stack_handle_t handle,
 | 
						|
			       unsigned long **entries);
 | 
						|
 | 
						|
unsigned int filter_irq_stacks(unsigned long *entries, unsigned int nr_entries);
 | 
						|
 | 
						|
#ifdef CONFIG_STACKDEPOT
 | 
						|
int stack_depot_init(void);
 | 
						|
#else
 | 
						|
static inline int stack_depot_init(void)
 | 
						|
{
 | 
						|
	return 0;
 | 
						|
}
 | 
						|
#endif	/* CONFIG_STACKDEPOT */
 | 
						|
 | 
						|
#endif
 |