[PATCH v4 2/2] mm: Better handling of adding new regions

2022-10-15 Thread Zhang Boyang
Previously, there are two problems of the handling of adding new regions. First, it doesn't take region management cost into account. Adding a memory area of `x` bytes will result in a heap region of less than `x` bytes avaliable. Thus, the new region might not adequate for current allocation reque

[PATCH v4 0/2] mm: Better handling of adding new regions

2022-10-15 Thread Zhang Boyang
Hi, Changes in V3 -> V4: * [PATCH v4 1/2] mm: Try invalidate disk caches last when out of memory Added "Reviewed-by" tags. * [PATCH v4 2/2] mm: Better handling of adding new regions Made this patch standalone. Moved (and renamed back) new constants to "mm_private.h" from "mm.h". Document

[PATCH v4 1/2] mm: Try invalidate disk caches last when out of memory

2022-10-15 Thread Zhang Boyang
Previously, every heap grow will cause all disk caches invalidated, which decreases performance severely. This patch moves disk cache invalidation code to the last of memory squeezing measures, so disk caches are released only when no other ways to get free memory. Signed-off-by: Zhang Boyang Rev

[PATCH] multiboot: fix memory leak

2022-10-15 Thread t.feng via Grub-devel
follow up the commit: eb33e61b31902a5493468895aaf83fa0b4f5f59d it seems that old commit can not fix memory leak completely. --- grub-core/loader/multiboot_elfxx.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/grub-core/loader/multiboot_elfxx.c b/grub-core

Re: [PATCH v2] grub-core/disk/cryptodisk.c: Fix unintentional integer overflow

2022-10-15 Thread Patrick Steinhardt
On Fri, Oct 14, 2022 at 05:47:08PM -0400, Alec Brown wrote: > In the function grub_cryptodisk_endecrypt(), a for loop is incrementing the > variable i by (1U << log_sector_size). The variable i is of type grub_size_t > which is a 64-bit unsigned integer on x86_64 architecture. On the other hand, >

Re: [RFC PATCH v3 2/2] mm: Separate different types of allocations into different regions

2022-10-15 Thread Patrick Steinhardt
On Thu, Oct 13, 2022 at 09:29:19AM +0800, Zhang Boyang wrote: > This patch add type infomation to heap regions. Currently there are four > types: GRUB_MM_SIZE_SMALL, GRUB_MM_SIZE_LARGE, GRUB_MM_CLASS_DATA, > GRUB_MM_CLASS_MODULE. Each heap region can have its own mask of > acceptable memory allocat

Re: [RFC PATCH v3 1/2] mm: Try invalidate disk caches last when out of memory

2022-10-15 Thread Patrick Steinhardt
On Thu, Oct 13, 2022 at 09:29:18AM +0800, Zhang Boyang wrote: > Previously, every heap grow will cause all disk caches invalidated, > which decreases performance severely. This patch moves disk cache > invalidation code to the last of memory squeezing measures, so disk > caches are released only wh