linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Pavel Emelyanov <xemul@parallels.com>
Cc: Suleiman Souhlal <suleiman@google.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	balbir@linux.vnet.ibm.com, Ying Han <yinghan@google.com>,
	linux-mm@kvack.org
Subject: Re: memcg: slab control
Date: Tue, 1 Dec 2009 14:29:11 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.00.0912011421260.27500@chino.kir.corp.google.com> (raw)
In-Reply-To: <4B14F06D.1000901@parallels.com>

On Tue, 1 Dec 2009, Pavel Emelyanov wrote:

> > pdflush has been removed, they should all be allocated in process context.
> 
> OK, but the try_to_free_pages() concern still stands.
> 

Yes, we lack mappings between the per-bdi flusher kthreads back to the 
user cgroup that initiated the writeback.  Since all of these kthreads are 
descendents of kthreadd, they'll be accounted for within that thread's 
cgroup unless we pass along the current context.

> >> We implement support for accounting based on a bit on a kmem_cache
> >> structure and mark all kmalloc caches as not-accountable. Then we grep
> >> the kernel to find all kmalloc-s and think - if a kmalloc is to be
> >> accounted we turn this into kmem_cache_alloc() with dedicated
> >> kmem_cache and mark it as accountable.
> >>
> > 
> > That doesn't work with slab cache merging done in slub.
> 
> Surely we'll have to change it a bit.
> 

We can't add a cache flag passed to kmem_cache_create() to identify caches 
that should be accounted versus those that shouldn't, there are allocs 
done in both process context and irq context from the same caches and we 
don't want to inhibit accounting with an additional flag passed to 
kmem_cache_alloc() if that cache has accounting enabled.

A vast majority of slab caches get merged into each other based on object 
size and alignment with slub; we could prevent that merging by checking 
the accounting bit for a cache, but that would come at a performance cost 
(nullifying many hot object allocs), increased fragmentation, and 
increased memory consumption.

In other words, we don't want to make it an attribute of the cache itself, 
we need to make it an attribute of the context in which the allocation is 
done; there're many more cases where we'll want to have accounting enabled 
by default, so we'll need to add a bit passed on alloc to inhibit 
accounting for those objects.

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

  reply	other threads:[~2009-12-01 22:29 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-25 23:08 David Rientjes
2009-11-26  1:14 ` KAMEZAWA Hiroyuki
2009-11-26  8:50   ` Balbir Singh
2009-11-26  8:56     ` KAMEZAWA Hiroyuki
2009-11-26  9:10       ` Pavel Emelyanov
2009-11-26  9:33         ` KAMEZAWA Hiroyuki
2009-11-26  9:56           ` Pavel Emelyanov
2009-11-26 10:24             ` Suleiman Souhlal
2009-11-26 12:31               ` Pavel Emelyanov
2009-11-26 12:52                 ` Suleiman Souhlal
2009-12-01  7:40                   ` Balbir Singh
2009-11-27  7:15                 ` Ying Han
2009-11-27  9:45                   ` Pavel Emelyanov
2009-12-01  5:14                   ` KOSAKI Motohiro
2009-11-30 22:57                 ` David Rientjes
2009-12-01 10:31                   ` Pavel Emelyanov
2009-12-01 22:29                     ` David Rientjes [this message]
2009-12-01  7:36             ` Balbir Singh
2009-12-01 10:40               ` Pavel Emelyanov
2009-12-01 15:14                 ` Balbir Singh
2009-12-02 10:14                   ` Pavel Emelyanov
2009-12-02 10:19                     ` Balbir Singh
2009-12-02 10:51                       ` Pavel Emelyanov
2009-11-30 22:55         ` David Rientjes
2009-12-01 10:39           ` Pavel Emelyanov
2009-11-26 10:13     ` Suleiman Souhlal
2009-11-30  9:17       ` Balbir Singh
2009-11-30 22:45   ` David Rientjes
2009-11-26  1:17 ` KAMEZAWA Hiroyuki
2009-11-26 10:01   ` Suleiman Souhlal
2009-11-26  2:35 ` KOSAKI Motohiro
2009-11-27  7:01   ` Ying Han
2009-11-27  9:48     ` Pavel Emelyanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.0912011421260.27500@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=suleiman@google.com \
    --cc=xemul@parallels.com \
    --cc=yinghan@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox