| Date | Wed, 13 Mar 2024 15:44:13 +0100 | Subject | Re: [PATCH v5 20/37] mm: fix non-compound multi-order memory accounting in __free_pages | From | Vlastimil Babka <> |
| |
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 <vbabka@suse.cz> > Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
|