public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: mingo@elte.hu, rusty@rustcorp.com.au, tglx@linutronix.de,
	x86@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com,
	efault@gmx.de, jaswinder@kernel.org, cooloney@kernel.org
Subject: [GIT PULL] x86, percpu: implement and use reserved percpu alloc
Date: Fri,  6 Mar 2009 15:46:20 +0900	[thread overview]
Message-ID: <1236321988-19457-1-git-send-email-tj@kernel.org> (raw)


Hello,

Please pull from the following git vector.

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git tj-percpu

This patchset implements reserved percpu alloc from the first chunk
and uses it for static perpcu variables in modules on x86_64.  This is
necessary because x86_64 expects symbols to be relocatable using 32bit
relocations but dynamic percpu allocation does not guarantee it
leading to relocation overflow during module load.

This can happen to any of the x86_64 percpu first chunk allocators but
the embedding allocator is most likely to trigger it as the first
chunk is located in the normal kernel memory allocation area while all
the other chunks will be allocated in the vmalloc area which is very
far from the first chunk.

This type of reservation will be necessary for other architectures too
where addressing mode used for percpu acess uses offsets with limited
range to access symbols (e.g. ia64 w/ the magic 64k percpu page).

This problem was first reported and bisected by Mike Galbraith[2].

This patchset is against the current x86/core/percpu[1] and contains
the following patches.

 0001-percpu-clean-up-percpu-constants.patch
 0002-percpu-cosmetic-renames-in-pcpu_setup_first_chunk.patch
 0003-percpu-improve-first-chunk-initial-area-map-handlin.patch
 0004-percpu-use-negative-for-auto-for-pcpu_setup_first_c.patch
 0005-x86-make-embedding-percpu-allocator-return-excessiv.patch
 0006-percpu-add-an-indirection-ptr-for-chunk-page-map-ac.patch
 0007-percpu-module-implement-reserved-allocation-and-us.patch
 0008-x86-percpu-setup-reserved-percpu-area-for-x86_64.patch

0001-0004 makes misc updates to percpu in preparation of later
changes.  0005 fixes a case where excessive memory can be set aside in
the first chunk when using the embedding allocator.  0006-0008
implement reserved allocation and use it for x86_64.

Bryan Wu, can you please review #0001?  It contains small change in
blackfin.  It's mostly trivial but just in case.

Diffstat follows.

 arch/blackfin/include/asm/percpu.h |   10 -
 arch/x86/kernel/setup_percpu.c     |   73 +++++++---
 include/linux/percpu.h             |   60 +++-----
 kernel/module.c                    |    2 
 mm/percpu.c                        |  267 ++++++++++++++++++++++++++-----------
 5 files changed, 274 insertions(+), 138 deletions(-)

Thanks.

--
tejun

[1] f254f3909efaf59ca2d0f408de2d044dace60706
[2] http://thread.gmane.org/gmane.linux.kernel/801799

             reply	other threads:[~2009-03-06  6:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-06  6:46 Tejun Heo [this message]
2009-03-06  6:46 ` [PATCH 1/8] percpu: clean up percpu constants Tejun Heo
2009-03-08  5:01   ` Bryan Wu
2009-03-06  6:46 ` [PATCH 2/8] percpu: cosmetic renames in pcpu_setup_first_chunk() Tejun Heo
2009-03-06  6:46 ` [PATCH 3/8] percpu: improve first chunk initial area map handling Tejun Heo
2009-03-06  6:46 ` [PATCH 4/8] percpu: use negative for auto for pcpu_setup_first_chunk() arguments Tejun Heo
2009-03-06  6:46 ` [PATCH 5/8] x86: make embedding percpu allocator return excessive free space Tejun Heo
2009-03-06  6:46 ` [PATCH 6/8] percpu: add an indirection ptr for chunk page map access Tejun Heo
2009-03-06  6:46 ` [PATCH 7/8] percpu, module: implement reserved allocation and use it for module percpu variables Tejun Heo
2009-03-06  6:46 ` [PATCH 8/8] x86, percpu: setup reserved percpu area for x86_64 Tejun Heo
2009-03-06  7:29 ` [GIT PULL] x86, percpu: implement and use reserved percpu alloc Mike Galbraith
2009-03-06  8:06 ` Ingo Molnar
2009-03-08  4:37 ` Bryan Wu

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=1236321988-19457-1-git-send-email-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=cooloney@kernel.org \
    --cc=efault@gmx.de \
    --cc=hpa@zytor.com \
    --cc=jaswinder@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox