RE: CPU consumption is going as high as 95% on ARM Cortex A8

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Russell King - ARM Linux [mailto:linux@xxxxxxxxxxxxxxxx]
> Sent: Monday, December 21, 2009 4:20 PM
> To: Hiremath, Vaibhav
> Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; linux-mm@xxxxxxxxx; linux-
> omap@xxxxxxxxxxxxxxx
> Subject: Re: CPU consumption is going as high as 95% on ARM Cortex
> A8
> 
> On Mon, Dec 21, 2009 at 02:51:13PM +0530, Hiremath, Vaibhav wrote:
> > > On Mon, Dec 21, 2009 at 11:56:23AM +0530, Hiremath, Vaibhav
> wrote:
<snip>...

> >
> > If I comment the line completely then I am seeing
> > CPU consumption similar to when I was setting
> PAGE_READONLY/PAGE_SHARED
> > flag, which is 25-32%.
> >
> > > I suspect that will "solve" the problem - but you'll then no
> longer
> > > have
> > > DMA coherency with userspace, so its not really a solution.
> 
> So it _is_ down to purely the amount of time it takes to read from a
> non-cacheable buffer.  I think you need to investigate the userspace
> program and see whether it's doing anything silly - I don't think
> the
> lack of performance is a kernel problem as such.
> 
[Hiremath, Vaibhav] The User space application program is pretty simple, doing nothing as such - 

It is a loopback application where the captured frame is copied to display buffer -

/*Display buffer mmap*/
display_buff_info[i].start = mmap(NULL, buf.length,
			PROT_READ | PROT_WRITE, MAP_SHARED, *display_fd, 
			buf.m.offset);
/*Capture Buffer mmap*/
capture_buff_info[i].start = mmap(NULL, buf.length,
			PROT_READ | PROT_WRITE, MAP_SHARED, *capture_fd,
			buf.m.offset);
while (1)
	DEQUEUE BUFFER (blocking call)

	for (h = 0; h < display_fmt.fmt.pix.height; h++) {
		memcpy(dis_ptr, cap_ptr, display_fmt.fmt.pix.width * 2);
		cap_ptr += capture_fmt.fmt.pix.width * 2;
		dis_ptr += display_fmt.fmt.pix.width * 2;
	}

	QUEUE BUFFER
}

I will again review the application one more time and see whether I could get anything.

> How large is this buffer? 
[Hiremath, Vaibhav] The buffer size is 720x480x2, and we have 3 such buffers used in queue/dequeue operation.

> What userspace program is reading from
> it?
[Hiremath, Vaibhav] Simple loopback application doing memcpy.

> Could the userspace program be unnecessarily re-reading from the
> multiple times for the same frame?
[Hiremath, Vaibhav] Let me re-visit the code for both application and driver with respect to this suggestion, but I don't think application is reading twice.

Thanks,
Vaibhav

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux