Em Tue, 25 Aug 2015 16:48:56 -0600 Shuah Khan <shuahkhan@xxxxxxxxx> escreveu: > On Sun, Aug 23, 2015 at 2:17 PM, Mauro Carvalho Chehab > <mchehab@xxxxxxxxxxxxxxx> wrote: > > 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. > > > > Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxxxx> > > > > I think it makes sense to add remove support in phase2 after the > patches 1-15 in this > series that add the graph object and the API changes that go with it > through some > use-cases before adding support for remove. Sorry, I'm totally lost with the above comment. This patch series is a "pre-phase 1"[1]. It is the minimal amount of stuff for us to start playing with the new API and testing/debugging the graph creation. We can only work on userspace cases after having the foundation provided by this patchset (plus the 3 additional patches I sent on Sunday), e. g. after implementing the MEDIA_IOC_G_TOPOLOGY ioctl. [1] For a "phase 1", we also need the 3 additional patches I sent on Sunday, plus a patch that will create the indirect interface->entities links at the V4L2 side. > That way we have confidence in the patch set 1-15 and then we can > build on top with > solid foundation. Regards, Mauro -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html