summary refs log tree commit diff stats
path: root/migration/ram-compress.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* migration: Rename ram_compressed_pages() to compress_ram_pages()Juan Quintela2023-10-301-1/+1
| | | | | | | | | We are moving to have all functions exported from ram-compress.c to start with compress_. Reviewed-by: Fabiano Rosas <farosas@suse.de> Signed-off-by: Juan Quintela <quintela@redhat.com> Message-ID: <20231019110724.15324-12-quintela@redhat.com>
* migration: Merge flush_compressed_data() and compress_flush_data()Juan Quintela2023-10-301-11/+6
| | | | | | Reviewed-by: Fabiano Rosas <farosas@suse.de> Signed-off-by: Juan Quintela <quintela@redhat.com> Message-ID: <20231019110724.15324-11-quintela@redhat.com>
* migration: Move ram_flush_compressed_data() to ram-compress.cJuan Quintela2023-10-301-0/+9
| | | | | | | | As we export it, rename it compress_flush_data(). Reviewed-by: Fabiano Rosas <farosas@suse.de> Signed-off-by: Juan Quintela <quintela@redhat.com> Message-ID: <20231019110724.15324-10-quintela@redhat.com>
* migration: Create compress_update_rates()Juan Quintela2023-10-301-1/+41
| | | | | | | | | | | So we can move more compression_counters stuff to ram-compress.c. Create compression_counters struct to add the stuff that was on MigrationState. Reviewed-by: Lukas Straub <lukasstraub2@web.de> Reviewed-by: Fabiano Rosas <farosas@suse.de> Signed-off-by: Juan Quintela <quintela@redhat.com> Message-ID: <20231019110724.15324-8-quintela@redhat.com>
* migration: Move busy++ to migrate_with_multithreadJuan Quintela2023-10-301-0/+1
| | | | | | | | | And now we can simplify save_compress_page(). Reviewed-by: Lukas Straub <lukasstraub2@web.de> Reviewed-by: Fabiano Rosas <farosas@suse.de> Signed-off-by: Juan Quintela <quintela@redhat.com> Message-ID: <20231019110724.15324-7-quintela@redhat.com>
* migration: Simplify compress_page_with_multithread()Juan Quintela2023-10-301-24/+24
| | | | | | | | | Move the goto to a while true. Reviewed-by: Lukas Straub <lukasstraub2@web.de> Reviewed-by: Fabiano Rosas <farosas@suse.de> Signed-off-by: Juan Quintela <quintela@redhat.com> Message-ID: <20231019110724.15324-6-quintela@redhat.com>
* migration: Make compress_data_with_multithreads return boolJuan Quintela2023-10-301-7/+10
| | | | | | | Reviewed-by: Lukas Straub <lukasstraub2@web.de> Reviewed-by: Fabiano Rosas <farosas@suse.de> Signed-off-by: Juan Quintela <quintela@redhat.com> Message-ID: <20231019110724.15324-5-quintela@redhat.com>
* migration: Use "i" as an for index in ram-compress.cJuan Quintela2023-10-171-31/+25
| | | | | | | | | It is used everywhere else in C. Once there, make sure that we don't use the index outside of the for declaring the variable there. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Lukas Straub <lukasstraub2@web.de> Message-ID: <20230613145757.10131-15-quintela@redhat.com>
* migration: Simplify decompress_data_with_multi_threads()Juan Quintela2023-10-171-6/+2
| | | | | | | | | Doing a break to do another break is just confused. Just call return when we know we want to return. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Lukas Straub <lukasstraub2@web.de> Message-ID: <20230613145757.10131-14-quintela@redhat.com>
* migration: Move update_compress_threads_counts() to ram-compress.cJuan Quintela2023-10-171-0/+17
| | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Lukas Straub <lukasstraub2@web.de> Message-ID: <20230613145757.10131-9-quintela@redhat.com>
* migration: Create ram_compressed_pages()Juan Quintela2023-10-171-0/+6
| | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Lukas Straub <lukasstraub2@web.de> Message-ID: <20230613145757.10131-8-quintela@redhat.com>
* migration: Create populate_compress()Juan Quintela2023-10-171-0/+13
| | | | | | | | | So we don't have to access compression_counters from outside ram-compress.c. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Lukas Straub <lukasstraub2@web.de> Message-ID: <20230613145757.10131-7-quintela@redhat.com>
* migration: Move compression_counters cleanup ram-compress.cJuan Quintela2023-10-171-0/+5
| | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Lukas Straub <lukasstraub2@web.de> Message-ID: <20230613145757.10131-6-quintela@redhat.com>
* ram-compress.c: Make target independentLukas Straub2023-05-081-7/+10
| | | | | | | | | Make ram-compress.c target independent. Signed-off-by: Lukas Straub <lukasstraub2@web.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
* ram compress: Assert that the file buffer matches the resultLukas Straub2023-05-081-0/+5
| | | | | | | | | | | Before this series, "nothing to send" was handled by the file buffer being empty. Now it is tracked via param->result. Assert that the file buffer state matches the result. Signed-off-by: Lukas Straub <lukasstraub2@web.de> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
* ram.c: Move core decompression code into its own fileLukas Straub2023-05-081-0/+203
| | | | | | | | | No functional changes intended. Signed-off-by: Lukas Straub <lukasstraub2@web.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
* ram.c: Move core compression code into its own fileLukas Straub2023-05-081-0/+274
No functional changes intended. Signed-off-by: Lukas Straub <lukasstraub2@web.de> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>