summaryrefslogtreecommitdiff
path: root/page_cache.c
AgeCommit message (Collapse)AuthorFilesLines
2014-06-10migration: Plug memory leak in migrate-set-cache-size commandChen Gang1-0/+1
We call g_free() after cache_fini() in migration_end(), but we don't call it after cache_fini() in xbzrle_cache_resize(), leaking the memory. cache_init() and cache_fini() are a pair. Since cache_init() allocates the cache, let cache_fini() free it. This plugs the leak. Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-02-25Fix two XBZRLE corruption issuesDr. David Alan Gilbert1-1/+1
Push zero'd pages into the XBZRLE cache A page that was cached by XBZRLE, zero'd and then XBZRLE'd again was being compared against a stale cache value Don't use 'qemu_put_buffer_async' to put pages from the XBZRLE cache Since the cache might change before the data hits the wire Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2014-02-04Don't abort on memory allocation errorOrit Wasserman1-5/+11
It is better to fail migration in case of failure to allocate new cache item Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2014-02-04Don't abort on out of memory when creating page cacheOrit Wasserman1-4/+14
Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-05-18remove some double-includesMichael Tokarev1-1/+0
Some source files #include the same header more than once for no good reason. Remove second #includes in such cases. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-03-11page_cache: dup memory on insertPeter Lieven1-1/+1
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 Lieven1-0/+3
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 Wasserman1-10/+9
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 Wasserman1-0/+1
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 Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-08-08Add cache handling functionsOrit Wasserman1-0/+218
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>