lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 01 Jan 2008 17:55:53 +0100
From:	Eric Dumazet <dada1@...mosbay.com>
To:	Ingo Molnar <mingo@...e.hu>
CC:	Linux kernel <linux-kernel@...r.kernel.org>,
	Andi Kleen <ak@...e.de>
Subject: [PATCH] X86 : Introduce DEFINE_PER_CPU_PAGE_ALIGNED() macro for x86
 arch to shrink percpu section

Hi Ingo

Here is a patch against linux-2.6-x86 git

Thank you

[PATCH] X86 : Introduce DEFINE_PER_CPU_PAGE_ALIGNED() macro for x86 arch to 
shrink percpu section

While examining holes in percpu section I found this :

c0659008 D per_cpu__cpu_number
c065900c D per_cpu__irq_regs
<BIG HOLE of about 4000 bytes>
c065a000 D per_cpu__gdt_page
c065b000 d per_cpu__next_check

This is because gdt_page is a percpu variable, defined with
a page alignement, and linker is doing its job.

I introduced a new macro DEFINE_PER_CPU_PAGE_ALIGNED() to avoid
wasting this space. All page aligned variables are put in a separate
subsection .data.percpu.page_aligned

This macro is defined for x86/generic architectures only
but could be added to other arches if needed.

Before patch :

# size -A vmlinux | grep percpu
.data.percpu                26144   3227328512

After patch :

# size -A vmlinux | grep percpu
.data.percpu                22048   3227328512


Signed-off-by: Eric Dumazet <dada1@...mosbay.com>

  arch/x86/kernel/cpu/common.c      |    2 +-
  arch/x86/kernel/vmlinux_32.lds.S  |    1 +
  include/asm-generic/percpu.h      |    4 ++++
  include/asm-generic/vmlinux.lds.h |    1 +
  include/asm-x86/percpu_32.h       |    4 ++++
  include/asm-x86/percpu_64.h       |    4 ++++
  6 files changed, 15 insertions(+), 1 deletion(-)


View attachment "percpu.patch" of type "text/plain" (3357 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ