Revision 619b0488038224391e64fa03854651ca0f5efe56 authored by Raistlin on 26 June 2008, 16:54:09 UTC, committed by Ingo Molnar on 01 July 2008, 06:23:24 UTC
Here it is another little Oops we found while configuring invalid values
via cgroups:

echo 0 > /dev/cgroups/0/cpu.rt_period_us
or
echo 4294967296 > /dev/cgroups/0/cpu.rt_period_us

[  205.509825] divide error: 0000 [#1]
[  205.510151] Modules linked in:
[  205.510151]
[  205.510151] Pid: 2339, comm: bash Not tainted (2.6.26-rc8 #33)
[  205.510151] EIP: 0060:[<c030c6ef>] EFLAGS: 00000293 CPU: 0
[  205.510151] EIP is at div64_u64+0x5f/0x70
[  205.510151] EAX: 0000389f EBX: 00000000 ECX: 00000000 EDX: 00000000
[  205.510151] ESI: d9800000 EDI: 00000000 EBP: c6cede60 ESP: c6cede50
[  205.510151]  DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
[  205.510151] Process bash (pid: 2339, ti=c6cec000 task=c79be370 task.ti=c6cec000)
[  205.510151] Stack: d9800000 0000389f c05971a0 d9800000 c6cedeb4 c0214dbd 00000000 00000000
[  205.510151]        c6cede88 c0242bd8 c05377c0 c7a41b40 00000000 00000000 00000000 c05971a0
[  205.510151]        c780ed20 c7508494 c7a41b40 00000000 00000002 c6cedebc c05971a0 ffffffea
[  205.510151] Call Trace:
[  205.510151]  [<c0214dbd>] ? __rt_schedulable+0x1cd/0x240
[  205.510151]  [<c0242bd8>] ? cgroup_file_open+0x18/0xe0
[  205.510151]  [<c0214fe4>] ? tg_set_bandwidth+0xa4/0xf0
[  205.510151]  [<c0215066>] ? sched_group_set_rt_period+0x36/0x50
[  205.510151]  [<c021508e>] ? cpu_rt_period_write_uint+0xe/0x10
[  205.510151]  [<c0242dc5>] ? cgroup_file_write+0x125/0x160
[  205.510151]  [<c0232c15>] ? hrtimer_interrupt+0x155/0x190
[  205.510151]  [<c02f047f>] ? security_file_permission+0xf/0x20
[  205.510151]  [<c0277ad8>] ? rw_verify_area+0x48/0xc0
[  205.510151]  [<c0283744>] ? dupfd+0x104/0x130
[  205.510151]  [<c027838c>] ? vfs_write+0x9c/0x160
[  205.510151]  [<c0242ca0>] ? cgroup_file_write+0x0/0x160
[  205.510151]  [<c027850d>] ? sys_write+0x3d/0x70
[  205.510151]  [<c0203019>] ? sysenter_past_esp+0x6a/0x91
[  205.510151]  =======================
[  205.510151] Code: 0f 45 de 31 f6 0f ad d0 d3 ea f6 c1 20 0f 45 c2 0f 45 d6 89 45 f0 89 55 f4 8b 55 f4 31 c9 8b 45 f0 39 d3 89 c6 77 08 89 d0 31 d2 <f7> f3 89 c1 83 c4 08 89 f0 f7 f3 89 ca 5b 5e 5d c3 55 89 e5 56
[  205.510151] EIP: [<c030c6ef>] div64_u64+0x5f/0x70 SS:ESP 0068:c6cede50

The attached patch solves the issue for me.

I'm checking as soon as possible for the period not being zero since, if
it is, going ahead is useless. This way we also save a mutex_lock() and
a read_lock() wrt doing it inside tg_set_bandwidth() or
__rt_schedulable().

Signed-off-by: Dario Faggioli <raistlin@linux.it>
Signed-off-by: Michael Trimarchi <trimarchimichael@yahoo.it>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 79c5379
History
File Mode Size
mach-bf527
mach-bf533
mach-bf537
mach-bf548
mach-bf561
mach-common
.gitignore -rw-r--r-- 6 bytes
Kbuild -rw-r--r-- 65 bytes
a.out.h -rw-r--r-- 697 bytes
atomic.h -rw-r--r-- 3.0 KB
auxvec.h -rw-r--r-- 62 bytes
bfin-global.h -rw-r--r-- 4.2 KB
bfin5xx_spi.h -rw-r--r-- 3.4 KB
bfin_simple_timer.h -rw-r--r-- 446 bytes
bfin_sport.h -rw-r--r-- 4.6 KB
bitops.h -rw-r--r-- 4.4 KB
blackfin.h -rw-r--r-- 1.6 KB
bug.h -rw-r--r-- 301 bytes
bugs.h -rw-r--r-- 239 bytes
byteorder.h -rw-r--r-- 1.1 KB
cache.h -rw-r--r-- 593 bytes
cacheflush.h -rw-r--r-- 3.2 KB
checksum.h -rw-r--r-- 2.5 KB
cplb-mpu.h -rw-r--r-- 1.8 KB
cplb.h -rw-r--r-- 3.9 KB
cplbinit.h -rw-r--r-- 2.5 KB
cpumask.h -rw-r--r-- 139 bytes
cputime.h -rw-r--r-- 130 bytes
current.h -rw-r--r-- 612 bytes
delay.h -rw-r--r-- 1.3 KB
device.h -rw-r--r-- 129 bytes
div64.h -rw-r--r-- 31 bytes
dma-mapping.h -rw-r--r-- 2.9 KB
dma.h -rw-r--r-- 6.2 KB
dpmc.h -rw-r--r-- 2.5 KB
early_printk.h -rw-r--r-- 995 bytes
elf.h -rw-r--r-- 4.2 KB
emergency-restart.h -rw-r--r-- 152 bytes
entry.h -rw-r--r-- 1.8 KB
errno.h -rw-r--r-- 106 bytes
fb.h -rw-r--r-- 205 bytes
fcntl.h -rw-r--r-- 405 bytes
fixed_code.h -rw-r--r-- 501 bytes
flat.h -rw-r--r-- 1.5 KB
futex.h -rw-r--r-- 82 bytes
gpio.h -rw-r--r-- 11.4 KB
gptimers.h -rw-r--r-- 5.5 KB
hardirq.h -rw-r--r-- 1.0 KB
hw_irq.h -rw-r--r-- 86 bytes
ide.h -rw-r--r-- 1.0 KB
io.h -rw-r--r-- 5.9 KB
ioctl.h -rw-r--r-- 31 bytes
ioctls.h -rw-r--r-- 2.6 KB
ipcbuf.h -rw-r--r-- 696 bytes
irq.h -rw-r--r-- 2.6 KB
irq_handler.h -rw-r--r-- 1005 bytes
irq_regs.h -rw-r--r-- 34 bytes
kdebug.h -rw-r--r-- 32 bytes
kgdb.h -rw-r--r-- 4.1 KB
kmap_types.h -rw-r--r-- 275 bytes
kvm.h -rw-r--r-- 107 bytes
l1layout.h -rw-r--r-- 766 bytes
linkage.h -rw-r--r-- 113 bytes
local.h -rw-r--r-- 122 bytes
mem_map.h -rw-r--r-- 181 bytes
mman.h -rw-r--r-- 1.7 KB
mmu.h -rw-r--r-- 666 bytes
mmu_context.h -rw-r--r-- 4.6 KB
module.h -rw-r--r-- 421 bytes
msgbuf.h -rw-r--r-- 972 bytes
mutex.h -rw-r--r-- 308 bytes
namei.h -rw-r--r-- 343 bytes
nand.h -rw-r--r-- 1.2 KB
page.h -rw-r--r-- 2.4 KB
page_offset.h -rw-r--r-- 104 bytes
param.h -rw-r--r-- 354 bytes
pci.h -rw-r--r-- 3.8 KB
percpu.h -rw-r--r-- 141 bytes
pgalloc.h -rw-r--r-- 161 bytes
pgtable.h -rw-r--r-- 2.7 KB
poll.h -rw-r--r-- 438 bytes
portmux.h -rw-r--r-- 15.9 KB
posix_types.h -rw-r--r-- 1.6 KB
processor.h -rw-r--r-- 3.3 KB
ptrace.h -rw-r--r-- 3.1 KB
reboot.h -rw-r--r-- 457 bytes
resource.h -rw-r--r-- 119 bytes
scatterlist.h -rw-r--r-- 733 bytes
sections.h -rw-r--r-- 134 bytes
segment.h -rw-r--r-- 134 bytes
semaphore.h -rw-r--r-- 29 bytes
sembuf.h -rw-r--r-- 695 bytes
serial.h -rw-r--r-- 90 bytes
setup.h -rw-r--r-- 405 bytes
shmbuf.h -rw-r--r-- 1.1 KB
shmparam.h -rw-r--r-- 147 bytes
sigcontext.h -rw-r--r-- 1.2 KB
siginfo.h -rw-r--r-- 1.1 KB
signal.h -rw-r--r-- 3.5 KB
socket.h -rw-r--r-- 1.2 KB
sockios.h -rw-r--r-- 372 bytes
spinlock.h -rw-r--r-- 125 bytes
stat.h -rw-r--r-- 1.3 KB
statfs.h -rw-r--r-- 111 bytes
string.h -rw-r--r-- 3.2 KB
system.h -rw-r--r-- 5.4 KB
termbits.h -rw-r--r-- 4.7 KB
termios.h -rw-r--r-- 2.6 KB
thread_info.h -rw-r--r-- 4.2 KB
time.h -rw-r--r-- 1.2 KB
timex.h -rw-r--r-- 464 bytes
tlb.h -rw-r--r-- 389 bytes
tlbflush.h -rw-r--r-- 904 bytes
topology.h -rw-r--r-- 143 bytes
trace.h -rw-r--r-- 2.2 KB
traps.h -rw-r--r-- 5.0 KB
types.h -rw-r--r-- 811 bytes
uaccess.h -rw-r--r-- 6.8 KB
ucontext.h -rw-r--r-- 413 bytes
unaligned.h -rw-r--r-- 310 bytes
unistd.h -rw-r--r-- 11.6 KB
user.h -rw-r--r-- 3.5 KB

back to top