Thread (14 messages) 14 messages, 4 authors, 2017-08-21

Re: kernel panic on null pointer on page->mem_cgroup

From: Johannes Weiner <hannes@cmpxchg.org>
Date: 2017-08-21 13:02:27
Also in: linux-mm, lkml

On Thu, Aug 10, 2017 at 01:56:05PM +0200, Michal Hocko wrote:
On Wed 09-08-17 14:38:25, Johannes Weiner wrote:
quoted
The issue is that writeback doesn't hold a page reference and the page
might get freed after PG_writeback is cleared (and the mapping is
unlocked) in test_clear_page_writeback(). The stat functions looking
up the page's node or zone are safe, as those attributes are static
across allocation and free cycles. But page->mem_cgroup is not, and it
will get cleared if we race with truncation or migration.
Is there anything that prevents us from holding a reference on a page
under writeback?
Hm, I'm hesitant to add redundant life-time management to the page
there just for memcg, which is not always configured in.

Pinning the memcg instead is slightly more complex, but IMO has the
complexity in a preferrable place.

Would you agree?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help