[lkml]   [2021]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] fs: buffer: use raw page_memcg() on locked page
On Tue, Feb 9, 2021 at 11:01 AM Johannes Weiner <> wrote:
> alloc_page_buffers() currently uses get_mem_cgroup_from_page() for
> charging the buffers to the page owner, which does an rcu-protected
> page->memcg lookup and acquires a reference. But buffer allocation has
> the page lock held throughout, which pins the page to the memcg and
> thereby the memcg - neither rcu nor holding an extra reference during
> the allocation are necessary. Use a raw page_memcg() instead.
> This was the last user of get_mem_cgroup_from_page(), delete it.
> Reported-by: Muchun Song <>
> Signed-off-by: Johannes Weiner <>

Reviewed-by: Shakeel Butt <>

 \ /
  Last update: 2021-02-10 01:49    [W:0.055 / U:1.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site