2021-02-21 | Paul Boddie | raw files shortlog changelog graph | Constrain the receive flexpage size to appropriate sizes. If the receive flexpage is constrained by the maximum offset to an intermediate size (not a power of two page size multiple such as 1, 2, 4, 8...) then too large a flexpage will be sent and the "hot spot" incorrectly divided, resulting in stray accesses to neighbouring pages. | |
flexpage.cc (file) |
1.1 --- a/flexpage.cc Thu Feb 18 00:53:38 2021 +0100 1.2 +++ b/flexpage.cc Sun Feb 21 23:08:06 2021 +0100 1.3 @@ -100,7 +100,10 @@ 1.4 offset_t receive_size; 1.5 1.6 if (max_offset) 1.7 - receive_size = std::min(size, max_offset - receive_base_offset); 1.8 + { 1.9 + receive_size = trunc_multiple(max_offset - receive_base_offset, PAGE_SIZE); 1.10 + receive_size = std::min(size, receive_size); 1.11 + } 1.12 else 1.13 receive_size = size; 1.14