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]
Message-ID: <482BE82C.4010004@cosmosbay.com>
Date:	Thu, 15 May 2008 09:37:16 +0200
From:	Eric Dumazet <dada1@...mosbay.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	linux kernel <linux-kernel@...r.kernel.org>
Subject: [PATCH] percpu: Introduce DEFINE_PER_CPU_PAGE_ALIGNED()

While examining  percpu section on i386 I found we were wasting about 
8000 bytes
because of two large holes :

c05dd000 D __per_cpu_start
c05dd000 D per_cpu__current_task
c05dd004 D per_cpu__cpu_number
c05dd008 D per_cpu__irq_regs
c05dd00c D per_cpu__x86_cpu_to_apicid
c05dd010 d per_cpu__cpu_devices
c05dd044 D per_cpu__cyc2ns
*HOLE* of 4Kbytes
c05de000 d per_cpu__cpuid4_info
c05de004 d per_cpu__cache_kobject
c05de008 d per_cpu__index_kobject
*HOLE* of 4Kbytes
c05df000 D per_cpu__gdt_page
c05e0000 d per_cpu__next_check
c05e0008 d per_cpu__thermal_throttle_count

This is because gdt_page is a percpu variable, defined with a page 
alignement,
and linker is doing its job, two times because of .o nesting in the 
build process,
mixing variables with quite different alignment requirements.

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

# size -A vmlinux.old vmlinux | grep percpu
.data.percpu                22272   3227373568
.data.percpu                30336   3227373568

Thats 8064 bytes saved for each CPU (plus one for the .data.percpu 
storage itself)

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


View attachment "percpu_page_aligned.patch" of type "text/plain" (2533 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ