Le 04/12/2014 00:49, Carsten Haitzler (The Rasterman) a écrit : >> >> All the Telco product that I worked on before joining Intel, use that >> model. Checking has a cost. >> The trick is to ask for enough in one go to be able to take a decision >> on Kernel refusal without forcing the kernel to take action by itself. >> Not that nice, but works pretty well. >> Dominig > problem is that this won't work well on linux... All those products that I have in mind were running Linux. > > 1. swap - if you have it the above method won't be that great In my experience swap is never activated on embedded critical system. > 2. until you touch the pages (read or write) they don't exist so it will have > no impact I have not checked that detail with latest kernel. but is use to be that when the kernel was giving you the allocation, the RAM was there. Remember tha tI assume that there is no swap. > 3. a malloc won't give you linear/continuous memory. either will a mmap etc. > unless it's a specialized device guaranteeing that (i know of no general > device > providing that) > 4. due to linux doing overcommit to ensure we don't waste lots of memory any > allocation is never guaranteed. you can turn this off, but then you basically > need a chunk more real memory to make up for it. i might guess 50% to 100% > more > > you really need the kernel to give userspace more information. Kernel certainly has a better and more detailed view but you still need to extract that information to take decision in time.
-- Dominig ar Foll Senior Software Architect Intel Open Source Technology Centre _______________________________________________ Dev mailing list [email protected] https://lists.tizen.org/listinfo/dev
