Avi Kivity
5f92f54f06
Merge 'utils: cached_file: Fix alloc-dealloc mismatch during eviction' from Tomasz Grabiec
...
cached_page::on_evicted() is invoked in the LSA allocator context, set in the
reclaimer callback installed by the cache_tracker. However,
cached_pages are allocated in the standard allocator context (note:
page content is allocated inside LSA via lsa_buffer). The LSA region
will happily deallocate these, thinking that they these are large
objects which were delegated to the standard allocator. But the
_non_lsa_memory_in_use metric will underflow. When it underflows
enough, shard_segment_pool.total_memory() will become 0 and memory
reclamation will stop doing anything, leading to apparent OOM.
The fix is to switch to the standard allocator context inside
cached_page::on_evicted(). evict_range() was also given the same
treatment as a precaution, it currently is only invoked in the
standard allocator context.
The series also adds two safety checks to LSA to catch such problems earlier.
Fixes #10056
\cc @slivne @bhalevy
Closes #10130
* github.com:scylladb/scylla:
lsa: Abort when trying to free a standard allocator object not allocated through the region
lsa: Abort when _non_lsa_memory_in_use goes negative
tests: utils: cached_file: Validate occupancy after eviction
test: sstable_partition_index_cache_test: Fix alloc-dealloc mismatch
utils: cached_file: Fix alloc-dealloc mismatch during eviction
(cherry picked from commit ff2cd72766 )
2022-02-26 11:28:53 +02:00
..
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-10-05 12:57:54 +02:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-09-06 08:26:09 +03:00
2021-08-31 12:23:49 +03:00
2021-06-06 19:18:49 +03:00
2021-07-27 20:06:53 +03:00
2022-02-26 11:28:53 +02:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-10-05 12:58:55 +02:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-07-02 19:02:14 +02:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-11-29 14:56:48 +00:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-10-20 17:54:17 +03:00
2021-07-19 14:42:38 +02:00
2021-06-07 15:58:35 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-08-08 08:01:19 +02:00
2021-11-04 09:54:00 -03:00
2021-08-22 21:21:46 +03:00
2021-10-27 17:02:00 +03:00
2021-06-06 19:18:49 +03:00
2021-09-15 12:55:54 +03:00
2021-10-27 17:02:00 +03:00
2021-07-08 17:52:34 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-09-13 18:05:11 +03:00
2021-08-22 21:21:46 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-08-08 08:01:19 +02:00
2021-09-29 12:15:48 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-08-24 16:30:51 +03:00
2021-10-13 13:01:25 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-10-24 11:29:23 +03:00
2021-09-15 11:04:34 +02:00
2021-06-06 19:18:49 +03:00
2021-11-23 11:22:00 +02:00
2021-06-06 19:18:49 +03:00
2021-06-07 21:41:08 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-08-08 08:01:19 +02:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-08-22 16:49:40 +03:00
2021-06-06 19:18:49 +03:00
2021-08-22 21:11:52 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-11-04 16:19:54 +01:00
2021-10-05 11:57:02 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-09-14 12:20:28 +02:00
2021-09-29 12:15:48 +03:00
2021-09-29 12:15:48 +03:00
2021-09-28 13:09:39 +02:00
2021-11-02 12:24:37 +02:00
2021-07-26 17:27:03 +02:00
2021-10-13 16:10:06 +03:00
2021-07-28 13:28:51 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-09-29 12:15:48 +03:00
2021-08-08 08:01:19 +02:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-07-28 13:28:51 +03:00
2021-06-06 19:18:49 +03:00
2022-01-20 12:35:21 +02:00
2021-10-10 18:17:53 +03:00
2021-09-30 07:23:43 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-08-24 16:30:51 +03:00
2021-09-22 18:55:25 +03:00
2021-09-20 15:44:14 +03:00
2021-09-07 15:47:22 +03:00
2021-06-06 19:18:49 +03:00
2021-08-08 08:01:19 +02:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-10-01 10:20:28 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-11-04 09:35:49 -03:00
2021-11-04 09:35:49 -03:00
2021-10-11 16:54:01 +03:00
2021-09-20 15:44:14 +03:00
2021-10-11 11:03:29 +03:00
2021-06-06 19:18:49 +03:00
2021-09-20 15:44:14 +03:00
2022-02-26 11:28:53 +02:00
2021-11-04 09:35:49 -03:00
2021-09-20 15:44:14 +03:00
2021-08-24 16:30:51 +03:00
2021-07-21 16:45:30 +03:00
2021-07-01 19:16:11 +03:00
2021-09-24 11:05:53 +02:00
2021-06-06 19:18:49 +03:00
2021-08-02 22:26:26 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-07-28 13:30:32 +03:00
2021-06-06 19:18:49 +03:00
2021-06-06 19:18:49 +03:00
2021-07-28 13:19:24 +03:00
2021-06-06 19:18:49 +03:00
2021-09-24 11:05:53 +02:00
2020-10-21 11:14:44 +03:00
2021-09-09 11:49:05 +03:00
2021-09-14 12:20:28 +02:00
2021-11-04 09:54:00 -03:00
2021-10-27 17:02:00 +03:00
2021-10-27 17:02:00 +03:00
2021-10-27 17:02:00 +03:00
2021-06-06 19:18:49 +03:00
2021-10-27 17:02:00 +03:00
2021-08-24 16:30:51 +03:00
2021-06-06 19:18:49 +03:00