Issue 31 in vtuner: page allocation failure

27 views
Skip to first unread message

vtu...@googlecode.com

unread,
Apr 13, 2013, 8:02:34 PM4/13/13
to vtuner-...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 31 by will.sca...@gmail.com: page allocation failure
http://code.google.com/p/vtuner/issues/detail?id=31

What steps will reproduce the problem?
1. Build latest version of vtuner apps, install vtunerd on TBS MOI
2. Build latest version of vtunerc kernel module on recent kernel (ex:
3.8.6)
3. Stream video for several hours

What is the expected output? What do you see instead?
After several hours the data copy thread of vtunerc is terminated by the
kernel:

vtunerc.x86_64: page allocation failure: order:4, mode:0x1040d0
Pid: 1760, comm: vtunerc.x86_64 Tainted: GF O 3.9.0-rc6 #1
Call Trace:
[<ffffffff81138429>] warn_alloc_failed+0xe9/0x150
[<ffffffff816567c8>] ? __alloc_pages_direct_compact+0x182/0x194
[<ffffffff8113c2f4>] __alloc_pages_nodemask+0x844/0xac0
[<ffffffff81179258>] alloc_pages_current+0xb8/0x190
[<ffffffff81137424>] __get_free_pages+0x14/0x50
[<ffffffff811847f9>] kmalloc_order_trace+0x39/0xb0
[<ffffffff81184a5d>] __kmalloc+0x1ed/0x210
[<ffffffffa0596763>] vtunerc_ctrldev_write+0x83/0x240 [vtunerc]
[<ffffffff8119bcfc>] vfs_write+0xac/0x180
[<ffffffff8119c192>] sys_write+0x52/0xa0
[<ffffffff81660579>] ? do_device_not_available+0x19/0x20
[<ffffffff81667b59>] system_call_fastpath+0x16/0x1b

What version of the product are you using? On what operating system?

Latest versions of vtuner apps, and vtuner linux-driver.
Failure occurs on recent kernels such as 3.8.6 and 3.9-rc6.
Failure does not occur on older kernels such as 3.4.39.

Please provide any additional information below.

The vtunerc kernel module uses kalloc() to allocate a kernel buffer, then
kfree()
to free the buffer for each call to vtunerc_ctrldev_write().
After many thousands of iterations the memory becomes fragmented, and the
buffer can no longer be allocated.

This problem was reported in dvbhdhomerun, see here:


http://sourceforge.net/p/dvbhdhomerun/discussion/1223414/thread/6070e0fa/

Version 0.15 of dvbhdhomerun was created to solve this problem.
The new version of dvbhdhomerun works around the memory fragmentation
problem
by allocating the buffer once (one buffer for each device), then re-using
the same buffer. The buffer is only re-allocated if the write size is
increased.

Here are the diffs to dvbhdhomerun:


http://dvbhdhomerun.cvs.sourceforge.net/viewvc/dvbhdhomerun/dvbhdhomerun/kernel/dvb_hdhomerun_data.c?r1=1.3&r2=1.4

I have made similar changes to the vtunerc module.
I have attached a new vtuner_ctrldev.c, vtuner_main.c and vtuner_priv.h
in case you would like to add these changes to the repository.
After making these changes to the vtunerc module the vtunerc application
no longer dies.


Attachments:
vtunerc_ctrldev.c 10.9 KB
vtunerc_main.c 9.9 KB
vtunerc_priv.h 2.7 KB

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

vtu...@googlecode.com

unread,
Apr 18, 2013, 9:22:05 AM4/18/13
to vtuner-...@googlegroups.com

Comment #1 on issue 31 by lenjurik...@gmail.com: page allocation failure
http://code.google.com/p/vtuner/issues/detail?id=31

I test your improvements for two days and it works, the channel switching
is faster and the video/audio sync after channel switching is also faster
(mostly nearly not seen).

We'll put it into repo, thanks.

Ales

vtu...@googlecode.com

unread,
Apr 18, 2013, 5:26:08 PM4/18/13
to vtuner-...@googlegroups.com
Updates:
Status: Fixed

Comment #2 on issue 31 by jpetrous: page allocation failure
http://code.google.com/p/vtuner/issues/detail?id=31

Nice contribution, thanks!

Already applied for driver version 1.4.
Reply all
Reply to author
Forward
0 new messages