Thread (127 messages) 127 messages, 9 authors, 2012-10-08

Re: [PATCH v3 07/13] mm: Allocate kernel pages to the right memcg

From: Mel Gorman <mgorman@suse.de>
Date: 2012-09-28 13:28:59
Also in: linux-mm, lkml

On Fri, Sep 28, 2012 at 01:43:47PM +0400, Glauber Costa wrote:
On 09/27/2012 05:50 PM, Mel Gorman wrote:
quoted
quoted
+void __free_accounted_pages(struct page *page, unsigned int order)
quoted
+{
+	memcg_kmem_uncharge_page(page, order);
+	__free_pages(page, order);
+}
+
+void free_accounted_pages(unsigned long addr, unsigned int order)
+{
+	if (addr != 0) {
+		VM_BUG_ON(!virt_addr_valid((void *)addr));
This is probably overkill. If it's invalid, the next line is likely to
blow up anyway. It's no biggie.
So this is here because it is in free_pages() as well. If it blows, at
least we know precisely why (if debugging), and VM_BUG_ON() is only
compiled in when CONFIG_DEBUG_VM.
Ah, I see.
But I'm fine with either.
Should it stay or should it go ?
It can stay. It makes sense that it look similar to free_pages() and as
you say, it makes debugging marginally easier.


-- 
Mel Gorman
SUSE Labs

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