aboutsummaryrefslogtreecommitdiff
path: root/page_cache.c
AgeCommit message (Collapse)Author
2013-03-11page_cache: dup memory on insertPeter Lieven
The page cache frees all data on finish, on resize and if there is collision on insert. So it should be the caches responsibility to dup the data that is stored in the cache. Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-03-11page_cache: fix memory leakPeter Lieven
XBZRLE encoded migration introduced a MRU page cache meachnism. Unfortunately, cached items where never freed in case of a collision in the page cache on cache_insert(). This lead to out of memory conditions during XBZRLE migration if the page cache was small and there where a lot of collisions in the cache. Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-03-11Fix cache_resize to keep old entry ageOrit Wasserman
Instead of using cache_insert do the update itself Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-03-11Fix page_cache leak in cache_resizeOrit Wasserman
Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-12-19migration: move include files to include/migration/Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-08-08Add cache handling functionsOrit Wasserman
Add MRU page cache mechanism. The page are accessed by their address. Signed-off-by: Benoit Hudzia <benoit.hudzia@sap.com> Signed-off-by: Petter Svard <petters@cs.umu.se> Signed-off-by: Aidan Shribman <aidan.shribman@sap.com> Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>