linux/drivers
Parag Warudkar 79da472111 x86: fix DMI out of memory problems
People with HP Desktops (including me) encounter couple of DMI errors
during boot - dmi_save_oem_strings_devices: out of memory and
dmi_string: out of memory.

On some HP desktops the DMI data include OEM strings (type 11) out of
which only few are meaningful and most other are empty. DMI code
religiously creates copies of these 27 strings (65 bytes each in my
case) and goes OOM in dmi_string().

If DMI_MAX_DATA is bumped up a little then it goes and fails in
dmi_save_oem_strings while allocating dmi_devices of sizeof(struct
dmi_device) corresponding to these strings.

On x86_64 since we cannot use alloc_bootmem this early, the code uses a
static array of 2048 bytes (DMI_MAX_DATA) for allocating the memory DMI
needs. It does not survive the creation of empty strings and devices.

Fix this by detecting and not newly allocating empty strings and instead
using a one statically defined dmi_empty_string.

Also do not create a new struct dmi_device for each empty string - use
one statically define dmi_device with .name=dmi_empty_string and add
that to the dmi_devices list.

On x64 this should stop the OOM with same current size of DMI_MAX_DATA
and on x86 this should save a good amount of (27*65 bytes +
27*sizeof(struct dmi_device) bootmem.

Compile and boot tested on both 32-bit and 64-bit x86.

Signed-off-by: Parag Warudkar <parag.warudkar@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-01-30 13:31:59 +01:00
..
acorn/char
acpi
amba
ata libata: Change "write_data" to "rw" for some function documentations 2008-01-29 08:48:17 +11:00
atm [ATM]: [he] fixing compilation when you define USE_RBPS_POOL/USE_RBPL_POOL 2008-01-28 15:00:15 -08:00
auxdisplay
base convert drivers/base/power/Makefile to ccflags 2008-01-28 23:14:35 +01:00
block cciss: fix bug in overriding ->data_len before completion 2008-01-29 21:55:18 +01:00
bluetooth
cdrom Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 2008-01-29 08:52:50 +11:00
char x86: clean up drivers/char/rtc.c 2008-01-30 13:31:09 +01:00
clocksource
connector [NETNS]: Consolidate kernel netlink socket destruction. 2008-01-28 15:08:07 -08:00
cpufreq
cpuidle
crypto [S390] crypto: move s390 Kconfig options. 2008-01-26 14:11:17 +01:00
dca
dio
dma
edac
eisa
firewire
firmware x86: fix DMI out of memory problems 2008-01-30 13:31:59 +01:00
hid HID: ADS/Tech Radio si470x needs blacklist entry 2008-01-28 14:51:23 +01:00
hwmon
i2c Merge branch 'orion' into devel 2008-01-28 13:21:30 +00:00
ide blk_end_request: changing ide-cd (take 4) 2008-01-28 10:37:06 +01:00
ieee1394 Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-01-25 17:19:08 -08:00
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.25 2008-01-29 22:54:01 +11:00
input x86: replace outb_p() with udelay(2) in drivers/input/mouse/pc110pad.c 2008-01-30 13:31:24 +01:00
isdn
kvm x86: get rid of _MASK flags 2008-01-30 13:31:27 +01:00
leds
lguest x86: use generic register name in the thread and tss structures 2008-01-30 13:31:02 +01:00
macintosh i2c: Kill rogue driver IDs 2008-01-27 18:14:47 +01:00
mca
md
media i2c: Drivers stop using the redundant client list 2008-01-27 18:14:51 +01:00
message blk_end_request: changing i2o_block (take 4) 2008-01-28 10:36:50 +01:00
mfd [ARM] Fix class_device damage caused by 0c55445f20 2008-01-28 10:59:09 +00:00
misc
mmc Merge branch 'blk-end-request' of git://git.kernel.dk/linux-2.6-block 2008-01-29 08:51:32 +11:00
mtd
net Mostly revert "e1000/e1000e: Move PCI-Express device IDs over to e1000e" 2008-01-30 09:54:54 +11:00
nubus
of
oprofile
parisc [PARISC]: Fix build after ipv4_is_*() changes. 2008-01-28 14:58:20 -08:00
parport
pci
pcmcia [ARM] pxa: move memory controller registers into pxa2xx-regs.h 2008-01-26 15:07:54 +00:00
pnp
power
ps3
rapidio remove __attribute_used__ 2008-01-28 23:21:18 +01:00
rtc Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 2008-01-29 08:52:50 +11:00
s390 [VLAN]: Turn VLAN_DEV_INFO into inline function 2008-01-28 15:08:32 -08:00
sbus
scsi [NETNS]: Consolidate kernel netlink socket destruction. 2008-01-28 15:08:07 -08:00
serial Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 2008-01-29 08:52:50 +11:00
sh
sn
spi [ARM] pxa: make pxa2xx_spi driver use ssp_request()/ssp_free() 2008-01-26 15:07:52 +00:00
ssb ssb: Add boardflags_hi field to the sprom data structure 2008-01-28 15:09:52 -08:00
tc
telephony
uio
usb Merge branch 'pxa-plat' into devel 2008-01-28 13:21:38 +00:00
video Merge branches 'at91', 'ep93xx', 'iop', 'kprobes', 'ks8695', 'misc', 'msm', 's3c2410', 'sa1100' and 'vfp' into devel 2008-01-28 13:21:21 +00:00
virtio
w1 i2c: normal_i2c can be made const (remaining drivers) 2008-01-27 18:14:47 +01:00
watchdog
xen
zorro
Kconfig
Makefile