Thread (89 messages) 89 messages, 5 authors, 2015-07-08

Re: [PATCH 26/51] writeback: let balance_dirty_pages() work on the matching cgroup bdi_writeback

From: Tejun Heo <tj@kernel.org>
Date: 2015-07-02 01:26:51
Also in: linux-fsdevel, linux-mm, lkml

Hello, Jan.

On Tue, Jun 30, 2015 at 04:31:00PM +0200, Jan Kara wrote:
...
quoted
+	if (inode_cgwb_enabled(inode))
+		wb = wb_get_create_current(bdi, GFP_KERNEL);
+	if (!wb)
+		wb = &bdi->wb;
+
So this effectively adds a radix tree lookup (of wb belonging to memcg) for
every set_page_dirty() call. That seems relatively costly to me. And all
Hmmm... idk, radix tree lookups should be cheap especially when
shallow and set_page_dirty().  It's a glorified array indexing.  If
not, we should really be improving radix tree implementation.  That
said,
that just to check wb->dirty_exceeded. Cannot we just use inode_to_wb()
instead? I understand results may be different if multiple memcgs share an
inode and that's the reason why you use wb_get_create_current(), right?
But for dirty_exceeded check it may be good enough?
Yeah, that probably should work.  I'll think more about it.

Thanks.

-- 
tejun

--
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