summaryrefslogtreecommitdiffstats
path: root/page_cache.c
Commit message (Collapse)AuthorAgeFilesLines
* migration: Plug memory leak in migrate-set-cache-size commandChen Gang2014-06-101-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>
* Fix two XBZRLE corruption issuesDr. David Alan Gilbert2014-02-251-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>
* Don't abort on memory allocation errorOrit Wasserman2014-02-041-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>
* Don't abort on out of memory when creating page cacheOrit Wasserman2014-02-041-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>
* remove some double-includesMichael Tokarev2013-05-181-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>
* page_cache: dup memory on insertPeter Lieven2013-03-111-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>
* page_cache: fix memory leakPeter Lieven2013-03-111-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>
* Fix cache_resize to keep old entry ageOrit Wasserman2013-03-111-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>
* Fix page_cache leak in cache_resizeOrit Wasserman2013-03-111-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>
* migration: move include files to include/migration/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Add cache handling functionsOrit Wasserman2012-08-081-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>
OpenPOWER on IntegriCloud