Page allocation issue

Hirofumi Momose <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
Hello, 
I am totally newbie to this ML. 

I am developping web camera on ARM-9 platform.
It works fine for a while, but finally got following error.

------------ Kernel message --------------
webcam: page allocation failure. order:5, mode:0x0
[<c002a434>] (dump_stack+0x0/0x14) from [<c006ed70>] (__alloc_pages+0x2b4/0x2c8)
[<c006eabc>] (__alloc_pages+0x0/0x2c8) from [<c002bd78>] (__dma_alloc+0x188/0x3dc)
[<c002bbf0>] (__dma_alloc+0x0/0x3dc) from [<c002c01c>] (dma_alloc_coherent+0x24/0x2c)
[<c002bff8>] (dma_alloc_coherent+0x0/0x2c) from [<c0249350>] (hcd_buffer_alloc+0x8c/0x94)
[<c02492c4>] (hcd_buffer_alloc+0x0/0x94) from [<c02407b8>] (usb_buffer_alloc+0x24/0x30)
 r5:c07c2030 r4:c0aff400
[<c0240794>] (usb_buffer_alloc+0x0/0x30) from [<bf018500>] (uvc_init_video+0x15c/0x3b0 [uvcv

[<bf0183a4>] (uvc_init_video+0x0/0x3b0 [uvcvideo]) from [<bf0187bc>] (uvc_video_enable+0x68/

[<bf018754>] (uvc_video_enable+0x0/0x6c [uvcvideo]) from [<bf0181b8>] (uvc_v4l2_do_ioctl+0xc

 r6:c07c2030 r5:c4185e74 r4:40045612
[<bf017544>] (uvc_v4l2_do_ioctl+0x0/0xda4 [uvcvideo]) from [<bf00e930>] (video_usercopy+0x21

[<bf00e720>] (video_usercopy+0x0/0x33c [videodev]) from [<bf016f20>] (uvc_v4l2_ioctl+0x54/0x

[<bf016ecc>] (uvc_v4l2_ioctl+0x0/0x64 [uvcvideo]) from [<c009552c>] (do_ioctl+0x68/0x78)
 r7:00000003 r6:40045612 r5:000250a4 r4:40045612
[<c00954c4>] (do_ioctl+0x0/0x78) from [<c009579c>] (vfs_ioctl+0x260/0x288)
 r5:000250a4 r4:c279a200
[<c009553c>] (vfs_ioctl+0x0/0x288) from [<c0095804>] (sys_ioctl+0x40/0x60)
 r7:c279a200 r6:40045612 r5:000250a4 r4:00000003
[<c00957c4>] (sys_ioctl+0x0/0x60) from [<c0025fa0>] (ret_fast_syscall+0x0/0x2c)
 r7:00000036 r6:000250a4 r5:00000000 r4:00000000
Mem-info:
DMA per-cpu:
CPU    0: Hot: hi:   42, btch:   7 usd:   5   Cold: hi:   14, btch:   3 usd:  13
Active:5931 inactive:22401 dirty:158 writeback:0 unstable:0
 free:1021 slab:1351 mapped:1075 pagetables:70 bounce:0
DMA free:4084kB min:1440kB low:1800kB high:2160kB active:23724kB inactive:89604kB present:13
able

lowmem_reserve[]: 0 0
DMA: 467*4kB 85*8kB 28*16kB 8*32kB 11*64kB 1*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096k
 = 4084kB
Swap cache: add 0, delete 0, find 0/0, race 0+0
--------------End of Kernel message --------------

I think this might be caused by shortage of large pages.
Just after booted, there are several large pages, and camera works fine.
As time passes, large pages are split into many small pages, and camera
fails.

I changed buffer.c as follows, it improved some extent. But I don't
know if this modification is right.

---------------Patch----------------
*** linux-2.6.22/drivers/usb/core/buffer.c Thu Sep 13 00:31:41 2007
--- ./buffer.c  Tue Oct  9 22:57:40 2007
***************
*** 117,123 ****
                if (size <= pool_max [i])
                        return dma_pool_alloc(hcd->pool [i], mem_flags, dma);
        }
!       return dma_alloc_coherent(hcd->self.controller, size, dma, 0);
  }

  void hcd_buffer_free(
--- 117,123 ----
                if (size <= pool_max [i])
                        return dma_pool_alloc(hcd->pool [i], mem_flags, dma);
        }
!       return dma_alloc_coherent(hcd->self.controller, size, dma, __GFP_WAIT);
  }

  void hcd_buffer_free(
-------------END---------------------

Does anyone have good idea ?

System I am using is:
 ARM-920T (EP9307 cirrus)
 32MB of RAM, NO HDD,
 Kernel-2.6.22

Regards,

-- 
Hirofumi Momose <[email protected]>


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.