Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1577374

Re: [PATCH v2 2/2] fork: make number of cached stacks (vmapped) configurable using Kbuild

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/2] fork: make number of cached stacks (vmapped) configurable using Kbuild
Date 2017-02-09 09:50 +0100
Message-ID <t8SAp-3UH-3@gated-at.bofh.it> (permalink)
References <t8On7-1bs-11@gated-at.bofh.it> <t8OwN-1eB-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu 09-02-17 13:03:47, Hoeun Ryu wrote:
> Introducing NR_VMAP_STACK_CACHE, the number of cached stacks for virtually
> mapped kernel stack can be configurable using Kbuild system.
> default value is 2.

This should really explain _why_ we want/need this. The config space is
really large already and there should better be a good reason to make it
even larger. Which workload will benefit from a different than default
cache size and why?

Without a really good reasons NACK from me.

> Signed-off-by: Hoeun Ryu <hoeun.ryu@gmail.com>
> ---
>  arch/Kconfig  | 8 ++++++++
>  kernel/fork.c | 2 +-
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/Kconfig b/arch/Kconfig
> index d49a8e6..066d111 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -849,6 +849,14 @@ config VMAP_STACK
>  	  the stack to map directly to the KASAN shadow map using a formula
>  	  that is incorrect if the stack is in vmalloc space.
>  
> +config NR_VMAP_STACK_CACHE
> +	int "Number of cached stacks"
> +	default "2"
> +	depends on VMAP_STACK
> +	help
> +	  This determines how many stacks can be cached for virtually
> +	  mapped kernel stacks.
> +
>  config ARCH_WANT_RELAX_ORDER
>  	bool
>  
> diff --git a/kernel/fork.c b/kernel/fork.c
> index 7911ed2..73ba1da 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -166,7 +166,7 @@ void __weak arch_release_thread_stack(unsigned long *stack)
>   * vmalloc() is a bit slow, and calling vfree() enough times will force a TLB
>   * flush.  Try to minimize the number of calls by caching stacks.
>   */
> -#define NR_CACHED_STACKS 2
> +#define NR_CACHED_STACKS CONFIG_NR_VMAP_STACK_CACHE
>  static DEFINE_PER_CPU(struct vm_struct *, cached_stacks[NR_CACHED_STACKS]);
>  #endif
>  
> -- 
> 2.7.4
> 

-- 
Michal Hocko
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 1/2] fork: free vmapped stacks in cache when cpus are offline Hoeun Ryu <hoeun.ryu@gmail.com> - 2017-02-09 05:20 +0100
  Re: [kernel-hardening] [PATCH v2 2/2] fork: make number of cached  stacks (vmapped) configurable using Kbuild Eric Biggers <ebiggers3@gmail.com> - 2017-02-09 05:30 +0100
  [PATCH v2 2/2] fork: make number of cached stacks (vmapped) configurable using Kbuild Hoeun Ryu <hoeun.ryu@gmail.com> - 2017-02-09 05:40 +0100
    Re: [PATCH v2 2/2] fork: make number of cached stacks (vmapped)  configurable using Kbuild Michal Hocko <mhocko@kernel.org> - 2017-02-09 09:50 +0100
      Re: [PATCH v2 2/2] fork: make number of cached stacks (vmapped)  configurable using Kbuild Hoeun Ryu <hoeun.ryu@gmail.com> - 2017-02-09 14:40 +0100
  Re: [kernel-hardening] [PATCH v2 1/2] fork: free vmapped stacks in  cache when cpus are offline Eric Biggers <ebiggers3@gmail.com> - 2017-02-09 06:00 +0100
    Re: [kernel-hardening] [PATCH v2 1/2] fork: free vmapped stacks in  cache when cpus are offline Hoeun Ryu <hoeun.ryu@gmail.com> - 2017-02-09 14:40 +0100
  Re: [PATCH v2 1/2] fork: free vmapped stacks in cache when cpus are  offline kbuild test robot <lkp@intel.com> - 2017-02-09 08:40 +0100
  Re: [PATCH v2 1/2] fork: free vmapped stacks in cache when cpus are  offline Michal Hocko <mhocko@kernel.org> - 2017-02-09 10:00 +0100
    Re: [PATCH v2 1/2] fork: free vmapped stacks in cache when cpus are offline Hoeun Ryu <hoeun.ryu@gmail.com> - 2017-02-09 14:40 +0100
  Re: [PATCH v2 1/2] fork: free vmapped stacks in cache when cpus are  offline kbuild test robot <lkp@intel.com> - 2017-02-09 11:20 +0100

csiph-web