linux_dsm_epyc7002/drivers/media/usb
Mauro Carvalho Chehab 57208e5e25 [media] media: convert links from array to list
The entire logic that represent graph links were developed on a
time where there were no needs to dynamic remove links. So,
although links are created/removed one by one via some
functions, they're stored as an array inside the entity struct.

As the array may grow, there's a logic inside the code that
checks if the amount of space is not enough to store
the needed links. If it isn't the core uses krealloc()
to change the size of the link, with is bad, as it
leaves the memory fragmented.

So, convert links into a list.

Also, currently,  both source and sink entities need the link
at the graph traversal logic inside media_entity. So there's
a logic duplicating all links. That makes it to spend
twice the memory needed. This is not a big deal for today's
usage, where the number of links are not big.

Yet, if during the MC workshop discussions, it was said that
IIO graphs could have up to 4,000 entities. So, we may
want to remove the duplication on some future. The problem
is that it would require a separate linked list to store
the backlinks inside the entity, or to use a more complex
algorithm to do graph backlink traversal, with is something
that the current graph traversal inside the core can't cope
with. So, let's postpone a such change if/when it is actually
needed.

It should also be noticed that the media_link structure uses
44 bytes on 32-bit architectures and 84 bytes on 64-bit
architecture. It will thus be allocated out of the 64-bytes and
96-bytes pools respectively. That's a 12.5% memory waste on
64-bit architectures and 31.25% on 32-bit architecture.
A linked list is less efficient than an array in this case, but
this could later be optimized if we can get rid of the reverse
links (with would reduce memory allocation by 50%).

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11 12:18:46 -02:00
..
airspy [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
as102 [media] as102: fix potential double free in as102_fw_upload() 2015-11-19 09:16:10 -02:00
au0828 [media] media: convert links from array to list 2016-01-11 12:18:46 -02:00
b2c2 [media] drivers: media: usb: b2c2: use usb_*_coherent() instead of pci_*_consistent() in flexcop-usb.c 2013-10-17 11:26:41 -03:00
cpia2 [media] media: fix waitqueue_active without memory barrier in cpia2 driver 2015-11-17 14:55:06 -02:00
cx231xx [media] media: convert links from array to list 2016-01-11 12:18:46 -02:00
dvb-usb [media] use https://linuxtv.org for LinuxTV URLs 2015-12-04 10:38:59 -02:00
dvb-usb-v2 [media] rtl28xxu: return demod reg page from driver cache 2015-12-23 14:11:02 -02:00
em28xx [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
go7007 [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
gspca [media] gspca: ov534/topro: prevent a division by 0 2015-11-17 14:54:25 -02:00
hackrf [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
hdpvr [media] v4l2-dv-timings: add new arg to v4l2_match_dv_timings 2015-12-03 11:26:14 -02:00
msi2500 [media] vb2: drop v4l2_format argument from queue_setup 2015-12-18 13:48:19 -02:00
pvrusb2 [media] media/usb/pvrusb2: Support for V4L2_CTRL_WHICH_DEF_VAL 2015-11-17 14:46:44 -02:00
pwc [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
s2255 [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
siano [media] siano: avoid a linkedit error if !MC 2015-03-02 14:17:01 -03:00
stk1160 [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
stkwebcam [media] stk-webcam: Delete an unnecessary check before the function call "vfree" 2015-03-02 14:53:27 -03:00
tm6000 [media] include/media: split I2C headers from V4L2 core 2015-11-17 06:57:11 -02:00
ttusb-budget [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
ttusb-dec [media] ttusb-dec: constify ttusbdecfe_config structure 2015-11-19 11:22:15 -02:00
usbtv [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
usbvision [media] usbvision: fix crash on detecting device with invalid configuration 2015-11-19 11:36:02 -02:00
uvc [media] uvcvideo: create pad links after subdev registration 2016-01-11 12:18:46 -02:00
zr364xx [media] usb drivers: use BUG_ON() instead of if () BUG 2015-06-09 18:30:09 -03:00
Kconfig [media] tlg2300: move to staging in preparation for removal 2014-12-16 23:21:43 -02:00
Makefile [media] tlg2300: move to staging in preparation for removal 2014-12-16 23:21:43 -02:00