Avi Kivity
7ac59dcc98
lsa: decay reserves
...
The log-structured allocator (LSA) reserves memory when performing
operations, since its operations are performed with reclaiming disabled
and if it runs out, it cannot evict cache to gain more. The amount of
memory to reserve is remembered across calls so that it does not have
to repeat the fail/increase-reserve/retry cycle for every operation.
However, we currently lack decaying the amount to reserve. This means
that if a single operation increased the reserve in the distant past,
all current operations also require this large reserve. Large reserves
are expensive since they can cause large amounts of cache to be evicted.
This patch adds reserve decay. The time-to-decay is inversely proportional
to reserve size: 10GB/reserve. This means that a 20MB reserve is halved
after 500 operations (10GB/20MB) while a 20kB reserve is halved after
500,000 operations (10GB/20kB). So large, expensive reserves are decayed
quickly while small, inexpensive reserves are decayed slowly to reduce
the risk of allocation failures and exceptions.
A unit test is added.
Fixes #325 .
2020-09-08 15:59:25 +03:00
..
2018-10-02 18:48:23 +01:00
2020-01-30 14:10:18 +02:00
2020-07-09 14:41:23 +03:00
2018-05-30 12:18:56 +02:00
2020-08-06 15:41:31 +03:00
2018-12-24 09:58:08 +02:00
2018-12-24 09:58:08 +02:00
2020-04-23 16:06:37 +03:00
2020-06-25 15:34:10 -07:00
2020-06-25 15:33:31 -07:00
2016-04-08 08:12:47 +03:00
2018-11-01 13:16:17 +00:00
2020-03-23 11:59:30 +02:00
2018-05-10 09:47:41 +03:00
2020-03-23 09:29:45 +02:00
2020-08-06 15:41:31 +03:00
2018-04-16 21:11:13 +02:00
2018-04-16 21:11:13 +02:00
2020-08-03 15:55:18 +03:00
2020-08-03 15:55:16 +03:00
2020-06-18 14:08:29 +03:00
2019-08-01 18:39:47 +03:00
2020-07-03 12:28:14 -07:00
2018-12-03 14:36:08 +01:00
2020-07-14 16:29:49 +03:00
2020-07-28 18:00:29 +03:00
2020-07-28 18:00:29 +03:00
2020-08-03 12:51:16 +03:00
2020-03-23 09:29:45 +02:00
2020-06-02 09:12:21 +03:00
2019-01-08 13:16:36 +02:00
2017-04-17 23:03:15 +03:00
2020-08-19 13:08:12 +03:00
2020-03-23 09:29:45 +02:00
2020-02-09 17:26:52 +02:00
2020-08-06 19:01:18 +03:00
2017-05-17 12:30:03 +03:00
2020-07-14 16:30:02 +03:00
2018-04-07 14:52:58 +03:00
2018-04-07 14:52:58 +03:00
2020-06-02 09:12:21 +03:00
2020-03-20 19:37:48 +01:00
2020-08-11 13:28:50 +03:00
2020-06-18 14:18:21 +03:00
2020-02-29 19:28:57 +02:00
2020-02-29 19:28:57 +02:00
2020-03-23 09:29:45 +02:00
2019-02-07 18:31:25 +02:00
2019-11-26 02:24:49 +03:00
2020-04-05 12:46:04 +03:00
2019-12-12 17:32:10 +03:00
2020-08-15 20:26:02 +03:00
2020-06-02 09:12:21 +03:00
2020-06-02 09:12:21 +03:00
2020-06-01 09:08:40 +03:00
2020-06-01 09:08:40 +03:00
2020-06-14 08:18:39 -07:00
2020-06-18 14:18:21 +03:00
2018-11-21 00:01:44 +02:00
2018-11-01 13:16:17 +00:00
2018-05-10 09:47:41 +03:00
2019-11-26 02:24:49 +03:00
2016-09-28 17:34:16 +03:00
2020-03-23 09:29:45 +02:00
2020-07-14 16:29:49 +03:00
2020-04-05 12:46:04 +03:00
2018-04-10 10:25:06 +03:00
2018-05-15 11:22:21 -04:00
2016-11-14 18:01:43 +02:00
2020-02-27 09:34:51 -05:00
2020-02-27 09:34:51 -05:00
2018-04-16 20:56:30 +02:00
2018-04-16 20:56:30 +02:00
2020-06-02 09:12:21 +03:00
2020-08-04 17:54:45 +03:00
2020-06-02 09:12:21 +03:00
2020-06-02 09:12:21 +03:00
2020-09-08 15:59:25 +03:00
2020-09-08 15:59:25 +03:00
2018-01-30 18:33:25 +01:00
2020-07-17 11:58:53 +03:00
2019-10-15 15:41:42 +03:00
2018-09-03 17:09:54 +03:00
2020-03-23 09:29:45 +02:00
2020-03-23 09:29:45 +02:00
2020-03-04 12:42:57 +02:00
2020-03-04 12:42:57 +02:00
2020-08-18 14:31:04 +03:00
2020-08-18 14:31:04 +03:00
2020-03-23 09:29:45 +02:00
2020-07-14 16:29:43 +03:00
2018-07-11 10:15:01 +01:00
2018-07-20 13:50:17 -07:00
2018-11-20 16:15:12 +00:00
2020-03-23 09:29:45 +02:00
2020-05-31 12:58:59 +03:00
2019-01-08 13:16:36 +02:00
2020-04-05 12:46:04 +03:00
2020-06-02 09:12:21 +03:00
2020-07-15 08:10:23 +00:00
2020-07-15 08:10:23 +00:00
2016-04-08 08:12:47 +03:00
2016-04-08 08:12:47 +03:00
2020-03-23 11:59:30 +02:00
2020-06-02 09:12:21 +03:00
2020-08-19 17:18:57 +03:00
2020-03-03 21:23:40 +02:00
2020-08-11 19:37:47 +08:00
2020-05-23 11:09:10 +03:00
2018-12-28 16:31:24 +01:00
2020-04-05 12:46:04 +03:00
2020-02-27 18:11:54 +02:00
2020-09-07 18:11:21 +03:00
2020-09-07 18:11:21 +03:00
2019-02-20 08:03:46 -08:00
2020-01-27 11:09:01 +02:00
2018-11-21 00:01:44 +02:00
2020-01-26 18:54:36 +02:00