All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: ShuoX Liu <shuox.liu@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Yanmin Zhang <yanmin_zhang@linux.intel.com>
Subject: Re: [PATCH] mm: percpu: Add PCPU_FC_FIXED to pcpu_fc for setting fixed pcpu_atom_size.
Date: Wed, 25 Apr 2012 15:24:29 -0700	[thread overview]
Message-ID: <20120425222429.GE8989@google.com> (raw)
In-Reply-To: <4F97BA98.6010001@intel.com>

Hello, ShouX.

On Wed, Apr 25, 2012 at 04:49:28PM +0800, ShuoX Liu wrote:
> From: ShuoX Liu <shuox.liu@intel.com>
> 
> We are enabling Android on Medfield. On i386, if the board has more
> physical memory, it means the vmalloc space is small. If the vmalloc
> space is big, it means physical memory is small. Dynamic percpu
> allocation is based on VM space. On i386, by default, the chunk size
> is 4MB. As vmalloc space is <= 128M, percpu allocation often fails.

Can you please provide more details - which kernel/user split was
used, how much memory was there and so on?  Also, can you please
attach boot log and the output of "cat /proc/vmallocinfo"?

> If using PERCPU_FC_PAGE, system can't go to deep sleep states.

Why?

> diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
> index 71f4727..824bc41 100644
> --- a/arch/x86/kernel/setup_percpu.c
> +++ b/arch/x86/kernel/setup_percpu.c
> @@ -185,9 +185,13 @@ void __init setup_per_cpu_areas(void)
>  #endif
>  	rc = -EINVAL;
>  	if (pcpu_chosen_fc != PCPU_FC_PAGE) {
> -		const size_t atom_size = cpu_has_pse ? PMD_SIZE : PAGE_SIZE;
> +		size_t atom_size;
>  		const size_t dyn_size = PERCPU_MODULE_RESERVE +
>  			PERCPU_DYNAMIC_RESERVE - PERCPU_FIRST_CHUNK_RESERVE;
> +		if (pcpu_chosen_fc == PCPU_FC_FIXED && pcpu_atom_size)
> +			atom_size = pcpu_atom_size;
> +		else
> +			atom_size = cpu_has_pse ? PMD_SIZE : PAGE_SIZE;
>  
>  		rc = pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE,
>  					    dyn_size, atom_size,

Umm... this is way too hacky.  atom_size can't be an arbitrary value
and the param is meaningful only to x86 yet defined globally.  Also,
while atom_size has effect on vmalloc area usage, way more important
factor is distance between units.  What we probably need to do is
tighten the rejection criteria of pcpu_embed_first_chunk() and fix
whatever problem FC_PAGE is causing.

Thanks.

-- 
tejun

  reply	other threads:[~2012-04-25 22:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-25  8:49 [PATCH] mm: percpu: Add PCPU_FC_FIXED to pcpu_fc for setting fixed pcpu_atom_size ShuoX Liu
2012-04-25 22:24 ` Tejun Heo [this message]
2012-04-26  2:01   ` Yanmin Zhang
2012-04-26 22:49     ` Tejun Heo
2012-04-27  1:09       ` Yanmin Zhang
2012-04-27  8:56         ` Yanmin Zhang
2012-04-27 16:53           ` [PATCH] percpu, x86: don't use PMD_SIZE as embedded atom_size on 32bit Tejun Heo
2012-04-27 17:17             ` H. Peter Anvin
2012-04-27 17:27               ` Tejun Heo
2012-04-27 17:21             ` Christoph Lameter
2012-04-27 17:27               ` Tejun Heo
2012-04-27 17:39             ` [PATCH v2] " Tejun Heo
2012-04-27 17:51               ` H. Peter Anvin
2012-04-27 17:53                 ` Tejun Heo
2012-04-28  2:18             ` [PATCH] " ShuoX Liu
2012-04-27 16:34         ` [PATCH] mm: percpu: Add PCPU_FC_FIXED to pcpu_fc for setting fixed pcpu_atom_size Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120425222429.GE8989@google.com \
    --to=tj@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shuox.liu@intel.com \
    --cc=yanmin_zhang@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.