Thread (60 messages) 60 messages, 8 authors, 2024-03-15

Re: [PATCH v5 20/37] mm: fix non-compound multi-order memory accounting in __free_pages

From: Vlastimil Babka <hidden>
Date: 2024-03-13 14:43:30
Also in: linux-arch, linux-doc, linux-fsdevel, linux-iommu, linux-mm, linux-modules, lkml


On 3/6/24 19:24, Suren Baghdasaryan wrote:
When a non-compound multi-order page is freed, it is possible that a
speculative reference keeps the page pinned. In this case we free all
pages except for the first page, which will be freed later by the last
put_page(). However put_page() ignores the order of the page being freed,
treating it as a 0-order page. This creates a memory accounting imbalance
because the pages freed in __free_pages() do not have their own alloc_tag
and their memory was accounted to the first page. To fix this the first
page should adjust its allocation size counter when "tail" pages are freed.

Reported-by: Vlastimil Babka <redacted>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Vlastimil Babka <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help