linux_dsm_epyc7002/drivers/media/dvb-core
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
..
demux.h [media] demux.h: Some documentation fixups for the header 2015-11-17 06:39:00 -02:00
dmxdev.c [media] dvb: get rid of enum dmx_success 2015-10-06 19:53:02 -03:00
dmxdev.h [media] remove include/linux/dvb/dmx.h 2012-10-19 07:29:17 -03:00
dvb_ca_en50221.c [media] DocBook: add dvb_ca_en50221.h to documentation 2015-08-22 07:09:29 -03:00
dvb_ca_en50221.h [media] dvb_ca_en50221.h: Make checkpatch.pl happy 2015-10-06 18:40:01 -03:00
dvb_demux.c [media] dvb: get rid of enum dmx_success 2015-10-06 19:53:02 -03:00
dvb_demux.h [media] demux.h: Remove duplicated enum 2013-04-08 06:53:15 -03:00
dvb_filter.c
dvb_filter.h
dvb_frontend.c [media] media: convert links from array to list 2016-01-11 12:18:46 -02:00
dvb_frontend.h [media] dvb_frontend.h: improve documentation for struct dvb_tuner_ops 2015-11-17 06:46:42 -02:00
dvb_math.c
dvb_math.h [media] DocBook: add dvb_math.h to documentation 2015-08-22 09:05:40 -03:00
dvb_net.c [media] dvb: get rid of enum dmx_success 2015-10-06 19:53:02 -03:00
dvb_net.h [media] dvb: push down ioctl lock in dvb_usercopy 2012-12-27 15:44:21 -02:00
dvb_ringbuffer.c [media] ngene: properly handle __user ptr 2014-09-08 10:00:52 -03:00
dvb_ringbuffer.h [media] DocBook: add dvb_ringbuffer.h to documentation 2015-08-22 09:05:45 -03:00
dvb-usb-ids.h [media] Add support for dvb usb stick Hauppauge WinTV-soloHD 2015-11-19 11:34:32 -02:00
dvbdev.c [media] media: rename the function that create pad links 2016-01-11 12:18:43 -02:00
dvbdev.h [media] dvbdev: Remove two cut-and-paste errors 2015-10-01 09:18:09 -03:00
Kconfig
Makefile