Re: How to measure performance inside Kernel?

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

 



Hi Mulyadi,

> I read your code and I think kmalloc can be streamlined here. I
> recommend that kmalloc() allocate total memory needed to handle whole
> q->buf[] array. something like (CMIIW):
>
> q->buf=kmalloc(sizeof(struct vb_buffer)*q->num_buffers,GFP_KERNEL)
>
> then access q->buf[1], q->buf[2] etc.
>
struct vb2_queue {
	struct vb2_buffer		*bufs[VIDEO_MAX_FRAME];
	unsigned int			num_buffers;
};

bufs is an array of pointers to struct vb2_buffer. I was not able to
use your kmalloc code. I get incompatible types errors when trying it.
Any ideas?

-- 
Peter Senna Tschudin
peter.senna@xxxxxxxxx
gpg id: 48274C36

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux