off-by: Vladimir Davydov
---
include/linux/slab.h | 10 +-
mm/memcontrol.c | 38 --
mm/slab_common.c | 39 ---
mm/vmscan.c |2 +-
4 files changed, 66 insertions(+), 23 deletions(-)
diff --
it for so long, wasting valuable entries
of memcg_cache_params->memcg_caches arrays. Therefore, to preserve cache
name uniqueness, let us switch to css->id.
Signed-off-by: Vladimir Davydov
---
mm/slab_common.c |6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/sla
arenting will fix it. After list_lru reparenting is done we
are free to release kmemcg_id saving a valuable slot in a per-memcg
array for new cgroups.
Signed-off-by: Vladimir Davydov
---
include/linux/list_lru.h |3 ++-
mm/list_lru.c| 46 +++
entry from the list, but also fix the nr_items counter, making sure
nr_items always reflects the actual number of elements on the list if
checked under the appropriate lock.
Signed-off-by: Vladimir Davydov
---
fs/dcache.c | 21 +++--
fs/gfs2/quota.c |
make them linked in the following patch.
That said, let us embed it.
Signed-off-by: Vladimir Davydov
---
include/linux/slab.h | 17 +++
include/linux/slab_def.h |2 +-
include/linux/slub_def.h |2 +-
mm/memcontrol.c | 11 ++--
mm/slab.h| 48
Drop this patch please. It needs a rebase. Will resend soon.
Thanks,
Vladimir
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
ree to avoid kmem cache name clashes
v1: https://lkml.org/lkml/2015/1/16/285
[1] https://lkml.org/lkml/2015/1/13/107
Thanks,
Vladimir Davydov (7):
slab: embed memcg_cache_params to kmem_cache
slab: link memcg caches of the same kind into a list
cgroup: release css->id after css_free
s
arenting will fix it. After list_lru reparenting is done we
are free to release kmemcg_id saving a valuable slot in a per-memcg
array for new cgroups.
Signed-off-by: Vladimir Davydov
---
include/linux/list_lru.h |3 ++-
mm/list_lru.c| 46 +++
entry from the list, but also fix the nr_items counter, making sure
nr_items always reflects the actual number of elements on the list if
checked under the appropriate lock.
Signed-off-by: Vladimir Davydov
---
fs/dcache.c | 21 +++--
fs/gfs2/quota.c |
cgroups, in this array, because it will be growing
beyond any bounds then. I'm going to wipe away dead caches from it to
save space. To still be able to perform iterations over all memcg caches
of the same kind, let us link them into a list.
Signed-off-by: Vladimir Davydov
---
include/linux/
h NULL.
Signed-off-by: Vladimir Davydov
---
kernel/cgroup.c | 10 +++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 6ffd3ae52bf8..7bd3e0f0f341 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4373,16 +4373,20 @@ static void c
make them linked in the following patch.
That said, let us embed it.
Signed-off-by: Vladimir Davydov
---
include/linux/slab.h | 17 +++
include/linux/slab_def.h |2 +-
include/linux/slub_def.h |2 +-
mm/memcontrol.c | 11 ++--
mm/slab.h| 48
off-by: Vladimir Davydov
---
include/linux/slab.h | 10 +-
mm/memcontrol.c | 38 --
mm/slab_common.c | 39 ---
3 files changed, 65 insertions(+), 22 deletions(-)
diff --git a/include/linux/slab.h b/incl
it for so long, wasting valuable entries
of memcg_cache_params->memcg_caches arrays. Therefore, to preserve cache
name uniqueness, let us switch to css->id.
Signed-off-by: Vladimir Davydov
---
mm/slab_common.c |6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/sla
to. The list_lru_node struct
is already cacheline aligned by definition.
So let us drop the cacheline aligned annotation in order not to waste
space in struct super_block.
Signed-off-by: Vladimir Davydov
---
include/linux/fs.h |9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)
di
Hi Tejun,
On Mon, Jan 19, 2015 at 09:30:01AM -0500, Tejun Heo wrote:
> On Mon, Jan 19, 2015 at 02:23:21PM +0300, Vladimir Davydov wrote:
> > Currently, we release css->id in css_release_work_fn, right before
> > calling css_free callback, so that when css_free is called, t
Hi Christoph,
On Mon, Jan 26, 2015 at 09:48:00AM -0600, Christoph Lameter wrote:
> On Mon, 26 Jan 2015, Vladimir Davydov wrote:
>
> > SLUB's kmem_cache_shrink not only removes empty slabs from the cache,
> > but also sorts slabs by the number of objects in-use to cope wit
On Mon, Jan 26, 2015 at 09:49:47AM -0600, Christoph Lameter wrote:
> On Mon, 26 Jan 2015, Vladimir Davydov wrote:
>
> > @@ -2400,11 +2400,16 @@ int __kmem_cache_shrink(struct kmem_cache *cachep)
> > return (ret ? 1 : 0);
> > }
> >
> > +void __kmem_ca
On Mon, Jan 26, 2015 at 12:24:49PM -0600, Christoph Lameter wrote:
> On Mon, 26 Jan 2015, Vladimir Davydov wrote:
>
> > Anyways, I think that silently relying on the fact that the allocator
> > never fails small allocations is kind of unreliable. What if this
>
> We are n
On Mon, Jan 26, 2015 at 12:26:57PM -0600, Christoph Lameter wrote:
> On Mon, 26 Jan 2015, Vladimir Davydov wrote:
>
> > __cache_shrink() is used not only in __kmem_cache_shrink(), but also in
> > SLAB's __kmem_cache_shutdown(), where we do need its return value to
> >
On Mon, Jan 26, 2015 at 01:55:14PM -0600, Christoph Lameter wrote:
> On Mon, 26 Jan 2015, Vladimir Davydov wrote:
>
> > Hmm, why? The return value has existed since this function was
> > introduced, but nobody seems to have ever used it outside the slab core.
> > Besides
On Mon, Jan 26, 2015 at 02:28:33PM -0600, Christoph Lameter wrote:
> On Mon, 26 Jan 2015, Vladimir Davydov wrote:
>
> > Right, but I just don't see why a subsystem using a kmem_cache would
> > need to check whether there are any objects left in the cache. I mean,
> >
Hi Joonsoo,
On Tue, Jan 27, 2015 at 05:00:09PM +0900, Joonsoo Kim wrote:
> On Mon, Jan 26, 2015 at 03:55:29PM +0300, Vladimir Davydov wrote:
> > @@ -3381,6 +3390,15 @@ void __kmem_cache_shrink(struct kmem_cache *s)
> > kmalloc(sizeof(struct list_head) * obje
Hi,
On Tue, Jan 27, 2015 at 07:12:43PM +1100, Stephen Rothwell wrote:
> In file included from mm/slab_common.c:26:0:
> mm/slab_common.c: In function 'kmem_cache_destroy':
> mm/slab.h:259:30: warning: right-hand operand of comma expression has no
> effect [-Wunused-value]
> for (iter = NULL, tmp
On Tue, Jan 27, 2015 at 06:21:14PM +0900, Joonsoo Kim wrote:
> 2015-01-27 17:23 GMT+09:00 Vladimir Davydov :
> > Hi Joonsoo,
> >
> > On Tue, Jan 27, 2015 at 05:00:09PM +0900, Joonsoo Kim wrote:
> >> On Mon, Jan 26, 2015 at 03:55:29PM +0300, Vladimir Davydov wro
On Mon, Jan 26, 2015 at 01:53:32PM -0600, Christoph Lameter wrote:
> On Mon, 26 Jan 2015, Vladimir Davydov wrote:
>
> > We could do that, but IMO that would only complicate the code w/o
> > yielding any real benefits. This function is slow and called rarely
> > anyway, s
t any ordering imposed on them.
Signed-off-by: Vladimir Davydov
---
mm/slub.c | 57 ++---
1 file changed, 30 insertions(+), 27 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index 1562955fe099..dbf9334b6a5c 100644
--- a/mm/slub.c
+++ b/mm/slub
race between put_cpu_partial reading ->cpu_partial and
kmem_cache_shrink updating it as proposed by Joonsoo
v1: https://lkml.org/lkml/2015/1/26/317
Thanks,
Vladimir Davydov (3):
slub: never fail to shrink cache
slub: fix kmem_cache_shrink return value
slub: make dead caches discard fr
On Wed, Jan 28, 2015 at 10:33:50AM -0600, Christoph Lameter wrote:
> On Wed, 28 Jan 2015, Vladimir Davydov wrote:
>
> > @@ -3419,6 +3420,9 @@ int __kmem_cache_shrink(struct kmem_cache *s)
> > for (i = SHRINK_PROMOTE_MAX - 1; i >= 0; i--)
> >
On Tue, Jan 27, 2015 at 11:02:12AM -0600, Christoph Lameter wrote:
> What you could do is simply put all slab pages with more than 32 objects
> available at the end of the list.
OK, got it, will redo. Thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of
.mm/118649/focus=118650
Signed-off-by: Vladimir Davydov
---
mm/slab.c|4 ++--
mm/slab.h|2 +-
mm/slab_common.c | 15 +--
mm/slob.c|2 +-
mm/slub.c| 31 ++-
5 files changed, 43 insertions(+), 11 deletions(-)
d
It is supposed to return 0 if the cache has no remaining objects and 1
otherwise, while currently it always returns 0. Fix it.
Signed-off-by: Vladimir Davydov
---
mm/slub.c |6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mm/slub.c b/mm/slub.c
index dbf9334b6a5c
On Wed, Jan 28, 2015 at 10:37:09AM -0600, Christoph Lameter wrote:
> On Wed, 28 Jan 2015, Vladimir Davydov wrote:
>
> > + /* We do not keep full slabs on the list */
> > + BUG_ON(free <= 0);
>
> Well sorry we do actually keep a n
On Thu, Mar 19, 2015 at 02:00:46PM +0100, Oleg Nesterov wrote:
> On 03/19, Vladimir Davydov wrote:
> >
> > Sending SI_TKILL from rt_[tg]sigqueueinfo was deprecated, so now we
> > issue a warning on the first attempt of doing it. We use WARN_ON_ONCE,
> > which is not inf
Memcg/kmem reclaim support has been finally merged. Reflect this in the
documentation.
Signed-off-by: Vladimir Davydov
---
Documentation/cgroups/memory.txt |8 +++-
init/Kconfig |6 --
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a
On Wed, Apr 01, 2015 at 04:44:31PM +0200, Jonathan Corbet wrote:
> On Wed, 1 Apr 2015 17:30:36 +0300
> Vladimir Davydov wrote:
>
> > Memcg/kmem reclaim support has been finally merged. Reflect this in the
> > documentation.
>
> So the text you've removed says no
/proc/kpagecgroup contains a 64-bit inode number of the memory cgroup
each page is charged to, indexed by PFN. Having this information is
useful for estimating a cgroup working set size.
The file is present if CONFIG_PROC_PAGE_MONITOR && CONFIG_MEMCG.
Signed-off-by: Vladimir
"
nidle = count_idle()
for dir, subdirs, files in os.walk(CGROUP_MOUNT):
ino = os.stat(dir)[stat.ST_INO]
print dir + ": " + str(nidle.get(ino, 0))
END SCRIPT
Comments are more than welcome.
Thanks,
Vladimir Davydov (3):
page flags when compiled on 32 bit.
Signed-off-by: Vladimir Davydov
---
Documentation/vm/pagemap.txt | 10 ++-
fs/proc/page.c | 154 ++
fs/proc/task_mmu.c |4 +-
include/linux/mm.h | 88
inc
end on
CONFIG_MEMCG instead of CONFIG_MEMCG_SWAP (I've no idea why it was made
dependant on CONFIG_MEMCG_SWAP initially).
Signed-off-by: Vladimir Davydov
---
include/linux/memcontrol.h |8 ++---
mm/hwpoison-inject.c |5 +--
mm/memcontrol.c
ave plenty of space for page flags. We could use
page_ext to accomodate new flags on 32BIT, but this is left for the
future work.
Signed-off-by: Vladimir Davydov
---
Documentation/vm/pagemap.txt | 17 -
fs/proc/page.c | 149 ++
fs/proc/
s Enter")
print "Counting idle pages..."
nidle = count_idle()
for dir, subdirs, files in os.walk(CGROUP_MOUNT):
ino = os.stat(dir)[stat.ST_INO]
print dir + ": " + str(nidle.get(ino, 0))
END SCRIPT
Comments are more than welcome.
Thanks,
/proc/kpagecgroup contains a 64-bit inode number of the memory cgroup
each page is charged to, indexed by PFN. Having this information is
useful for estimating a cgroup working set size.
The file is present if CONFIG_PROC_PAGE_MONITOR && CONFIG_MEMCG.
Signed-off-by: Vladimir
end on
CONFIG_MEMCG instead of CONFIG_MEMCG_SWAP (I've no idea why it was made
dependant on CONFIG_MEMCG_SWAP initially).
Signed-off-by: Vladimir Davydov
---
include/linux/memcontrol.h |8 ++---
mm/hwpoison-inject.c |5 +--
mm/memcontrol.c
Forgot to mention:
Originally, the patch for tracking idle memory was proposed back in 2011
by Michel Lespinasse (see http://lwn.net/Articles/459269/). The main
difference between Michel's patch and this one is that Michel
implemented a kernel space daemon for estimating idle memory size per
cgrou
to css id, it can be
easily obtained from userspace.
Signed-off-by: Vladimir Davydov
---
mm/slab_common.c |9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 999bb3424d44..e97bf3e04ed7 100644
--- a/mm/slab_common.c
+++ b/mm/sla
On Tue, Apr 07, 2015 at 01:38:19PM -0700, Andrew Morton wrote:
> On Tue, 7 Apr 2015 16:53:18 +0300 Vladimir Davydov
> wrote:
>
> > The name of a per memcg kmem cache consists of three parts: the global
> > kmem cache name, the cgroup name, and the css id. The latter is
On Wed, Apr 08, 2015 at 08:46:22AM -0500, Christoph Lameter wrote:
> On Wed, 8 Apr 2015, Vladimir Davydov wrote:
>
> > has its own copy of kmem cache. What if we decide to share the same kmem
> > cache among all memory cgroups one day? Of course, this will hardly ever
> &
Hi Minchan,
Thank you for taking a look at this patch set.
On Wed, Apr 29, 2015 at 12:57:22PM +0900, Minchan Kim wrote:
> On Tue, Apr 28, 2015 at 03:24:39PM +0300, Vladimir Davydov wrote:
> > * /proc/kpageidle. For each page this file contains a 64-bit number, which
> >equal
On Wed, Apr 29, 2015 at 01:57:59PM +0900, Minchan Kim wrote:
> On Tue, Apr 28, 2015 at 03:24:42PM +0300, Vladimir Davydov wrote:
> > @@ -69,6 +69,14 @@ There are four components to pagemap:
> > memory cgroup each page is charged to, indexed by PFN. Only available
> > when
On Wed, Apr 29, 2015 at 01:35:36PM +0900, Minchan Kim wrote:
> On Tue, Apr 28, 2015 at 03:24:42PM +0300, Vladimir Davydov wrote:
> > diff --git a/fs/proc/page.c b/fs/proc/page.c
> > index 70d23245dd43..cfc55ba7fee6 100644
> > --- a/fs/proc/page.c
> > +++ b/fs/proc/pa
On Thu, Apr 30, 2015 at 05:25:31PM +0900, Minchan Kim wrote:
> On Wed, Apr 29, 2015 at 12:12:48PM +0300, Vladimir Davydov wrote:
> > On Wed, Apr 29, 2015 at 01:35:36PM +0900, Minchan Kim wrote:
> > > On Tue, Apr 28, 2015 at 03:24:42PM +0300, Vladimir Davydov wrot
When trimming memcg consumption excess (see memory.high), we call
try_to_free_mem_cgroup_pages without checking if we are allowed to sleep
in the current context, which can result in a deadlock. Fix this.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: Michal Hocko
---
mm/memcontrol.c
/proc/kpagecgroup contains a 64-bit inode number of the memory cgroup
each page is charged to, indexed by PFN. Having this information is
useful for estimating a cgroup working set size.
The file is present if CONFIG_PROC_PAGE_MONITOR && CONFIG_MEMCG.
Signed-off-by: Vladimir
page flags when compiled on 32 bit.
Signed-off-by: Vladimir Davydov
---
Documentation/vm/pagemap.txt | 12 ++-
fs/proc/page.c | 178 +++
fs/proc/task_mmu.c | 4 +-
include/linux/mm.h | 88 +
include/
This function returns the inode number of the closest online ancestor of
the memory cgroup a page is charged to. It is required for exporting
information about which page is charged to which cgroup to userspace,
which will be introduced by a following patch.
Signed-off-by: Vladimir Davydov
be too costly to iterate
over all page mappings on each /proc/kpageflags read to provide an
up-to-date value. To make sure the flag is up-to-date one has to read
/proc/kpageidle first.
Signed-off-by: Vladimir Davydov
---
Documentation/vm/pagemap.txt | 6 ++
fs/proc/page.c
It is only used in mem_cgroup_try_charge, so fold it in and zap it.
Signed-off-by: Vladimir Davydov
---
include/linux/memcontrol.h | 6 --
mm/memcontrol.c| 48 --
2 files changed, 12 insertions(+), 42 deletions(-)
diff --git a
Hwpoison allows to filter pages by memory cgroup ino. Currently, it
calls try_get_mem_cgroup_from_page to obtain the cgroup from a page and
then its ino using cgroup_ino, but now we have an apter method for that,
page_cgroup_ino, so use it instead.
Signed-off-by: Vladimir Davydov
---
mm
e workload accesses its working set, then press Enter")
print "Counting idle pages..."
nr_idle = count_idle()
for dir, subdirs, files in os.walk(CGROUP_MOUNT):
ino = os.stat(dir)[stat.ST_INO]
print dir + ": " + str(nr_idle.get(ino, 0) * 4) + " KB"
END SCRI
On Sun, Jun 07, 2015 at 11:41:15AM +0530, Raghavendra KT wrote:
> Thanks for the patches, I was able test how the series is helpful to determine
> docker container workingset / idlemem with these patches. (tested on ppc64le
> after porting to a distro kernel).
Hi,
Thank you for using and testing
On Wed, Mar 28, 2018 at 01:30:20PM +0300, Kirill Tkhai wrote:
> On 27.03.2018 18:48, Vladimir Davydov wrote:
> > On Tue, Mar 27, 2018 at 06:09:20PM +0300, Kirill Tkhai wrote:
> >>>>>> diff --git a/mm/vmscan.c b/mm/vmscan.c
> >>>>>> index 8fcd9f8d7
On Tue, Apr 24, 2018 at 03:24:53PM +0300, Kirill Tkhai wrote:
> >> +int expand_shrinker_maps(int old_nr, int nr)
> >> +{
> >> + int id, size, old_size, node, ret;
> >> + struct mem_cgroup *memcg;
> >> +
> >> + old_size = old_nr / BITS_PER_BYTE;
> >> +
On Mon, May 14, 2018 at 12:03:38PM +0300, Kirill Tkhai wrote:
> On 13.05.2018 08:15, Vladimir Davydov wrote:
> > On Thu, May 10, 2018 at 12:52:18PM +0300, Kirill Tkhai wrote:
> >> The patch introduces shrinker::id number, which is used to enumerate
> >> memcg-aware shrin
On Mon, May 14, 2018 at 12:34:45PM +0300, Kirill Tkhai wrote:
> >> +static void memcg_free_shrinker_maps(struct mem_cgroup *memcg)
> >> +{
> >> + struct mem_cgroup_per_node *pn;
> >> + struct memcg_shrinker_map *map;
> >> + int nid;
> >> +
> >> + if (memcg == root_mem_cgroup)
> >> + re
On Thu, May 10, 2018 at 12:53:45PM +0300, Kirill Tkhai wrote:
> Introduce set_shrinker_bit() function to set shrinker-related
> bit in memcg shrinker bitmap, and set the bit after the first
> item is added and in case of reparenting destroyed memcg's items.
>
> This will allow next patch to make s
On Thu, May 10, 2018 at 12:53:55PM +0300, Kirill Tkhai wrote:
> Using the preparations made in previous patches, in case of memcg
> shrink, we may avoid shrinkers, which are not set in memcg's shrinkers
> bitmap. To do that, we separate iterations over memcg-aware and
> !memcg-aware shrinkers, and
On Thu, May 10, 2018 at 12:54:15PM +0300, Kirill Tkhai wrote:
> To avoid further unneed calls of do_shrink_slab()
> for shrinkers, which already do not have any charged
> objects in a memcg, their bits have to be cleared.
>
> This patch introduces a lockless mechanism to do that
> without races wi
On Tue, Apr 24, 2018 at 02:54:15PM +0100, Roman Gushchin wrote:
> > On Mon, Apr 23, 2018 at 01:36:10PM +0100, Roman Gushchin wrote:
> > > + memory.min
> > > + A read-write single value file which exists on non-root
> > > + cgroups. The default is "0".
> > > +
> > > + Hard memory protection. If t
Hello Roman,
On Wed, Apr 17, 2019 at 02:54:29PM -0700, Roman Gushchin wrote:
> There is however a significant problem with reparenting of slab memory:
> there is no list of charged pages. Some of them are in shrinker lists,
> but not all. Introducing of a new list is really not an option.
True, i
On 02/22/2014 04:11 AM, Andrew Morton wrote:
> On Thu, 20 Feb 2014 11:22:04 +0400 Vladimir Davydov
> wrote:
>
>> This patch cleanups the memcg cache creation path as follows:
>> - Move memcg cache name creation to a separate function to be called
>>from kmem
I need them initialized for cgroups that haven't got kmem accounting
initialized.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Glauber Costa
---
mm/memcontrol.c |5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/memcontrol.c
#x27;s fix this by appending the cache address to sysfs names of all
memcg caches so that they are guaranteed to have unique names.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Glauber Costa
Cc: Christoph Lameter
Cc: Pekka Enberg
---
mm/slub.c | 13 +++
We don't have a way to track kmalloc_large allocations so that charging
them makes kmemcg reparenting impossible. Since such allocations are
rare and can't be massively triggered from userspace, let's just ignore
them.
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Glauber Costa
Cc: Christoph Lameter
_caches, because the cache is
already empty when we release its last page. And if we drop the
reference taken by memcg in the work handler, we can detect who exactly
scheduled the worker - mem_cgroup_destroy_all_caches or
memcg_release_pages.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
we could uncharge thread_info on
task exit, but that wouldn't help us against fork bombs. So revert and
forget about this.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Glauber Costa
Cc: Frederic Weisbecker
---
include/linux/thread_info.h |2 --
kernel/fork
es an object to
a cache being reparented, he might see a pointer to the old memcg, but
that's OK, we only need to use RCU to protect against use-after-free.
Let's just do it.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Glauber Costa
---
mm/memc
here we should actually charge
kmem pages, why not just insert kmemcg charge/uncharge there passing on
the slab we are allocating from instead of introdudingh into the generic
allocation path. That's what this patch does.
Note, it does not remove the old code - it will be handled further.
Sig
No one uses it any more. Just get rid of it.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Glauber Costa
---
include/linux/gfp.h |5 --
include/linux/memcontrol.h | 90
include/trace/events/gfpflags.h |1 -
mm
can get a leaked kmem cache or, even worse,
an attempt to use after free.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Glauber Costa
---
mm/memcontrol.c | 32 +++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/mm
e from its memcg. That prevents the work from being rescheduled
from memcg offline path.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Glauber Costa
---
include/linux/memcontrol.h |2 +-
include/linux/slab.h |1 +
mm/memcontrol.c
to get a memcg. However, this is going to change when memcg
cache reparenting is introduced - only active (not dead) caches will
reside in this array. So let's organize all child caches of the same
root cache into a list on memcg_cache_params.
Signed-off-by: Vladimir Davydov
Cc: Johannes W
reparenting
of memcg caches is introduced. So let's embed a pointer back to the
memcg cache into the memcg_cache_params struct.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Glauber Costa
---
include/linux/slab.h |2 ++
mm/memcontrol.c | 28 +++
roposed the idea and kindly
outlined basic design principles.
Thanks,
Vladimir Davydov (12):
memcg: flush cache creation works before memcg cache destruction
memcg: fix race in memcg cache destruction path
memcg: fix root vs memcg cache destruction race
memcg: move slab caches list/mutex in
l, of course).
Many thanks to Johannes Weiner, who proposed the idea and kindly
outlined basic design principles.
Thanks,
Vladimir Davydov (12):
memcg: flush cache creation works before memcg cache destruction
memcg: fix race in memcg cache destruction path
memcg: fix root vs memcg cache dest
I need them initialized for cgroups that haven't got kmem accounting
initialized.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Glauber Costa
---
mm/memcontrol.c |5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/memcontrol.c
We don't have a way to track kmalloc_large allocations so that charging
them makes kmemcg reparenting impossible. Since such allocations are
rare and can't be massively triggered from userspace, let's just ignore
them.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: M
#x27;s fix this by appending the cache address to sysfs names of all
memcg caches so that they are guaranteed to have unique names.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Glauber Costa
Cc: Christoph Lameter
Cc: Pekka Enberg
---
mm/slub.c | 13 +++
No one uses it any more. Just get rid of it.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Glauber Costa
---
include/linux/gfp.h |5 --
include/linux/memcontrol.h | 90 --
include/trace/events/gfpflags.h |1
we could uncharge thread_info on
task exit, but that wouldn't help us against fork bombs. So revert and
forget about this.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Glauber Costa
Cc: Frederic Weisbecker
---
include/linux/thread_info.h |2 --
kernel/fork
_caches, because the cache is
already empty when we release its last page. And if we drop the
reference taken by memcg in the work handler, we can detect who exactly
scheduled the worker - mem_cgroup_destroy_all_caches or
memcg_release_pages.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
es an object to
a cache being reparented, he might see a pointer to the old memcg, but
that's OK, we only need to use RCU to protect against use-after-free.
Let's just do it.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Glauber Costa
---
mm/memc
to get a memcg. However, this is going to change when memcg
cache reparenting is introduced - only active (not dead) caches will
reside in this array. So let's organize all child caches of the same
root cache into a list on memcg_cache_params.
Signed-off-by: Vladimir Davydov
Cc: Johannes W
e from its memcg. That prevents the work from being rescheduled
from memcg offline path.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Glauber Costa
---
include/linux/memcontrol.h |2 +-
include/linux/slab.h |1 +
mm/memcontrol.c
reparenting
of memcg caches is introduced. So let's embed a pointer back to the
memcg cache into the memcg_cache_params struct.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Glauber Costa
---
include/linux/slab.h |2 ++
mm/memcontrol.c | 28 +++
can get a leaked kmem cache or, even worse,
an attempt to use after free.
Signed-off-by: Vladimir Davydov
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Glauber Costa
---
mm/memcontrol.c | 32 +++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/mm
here we should actually charge
kmem pages, why not just insert kmemcg charge/uncharge there passing on
the slab we are allocating from instead of introdudingh into the generic
allocation path. That's what this patch does.
Note, it does not remove the old code - it will be handled further.
Sig
Hi Johannes, Michal
Could you please take a look at this set when you have time?
Thank you.
On 02/26/2014 07:05 PM, Vladimir Davydov wrote:
> Hi,
>
> During my recent attempt to push kmemcg shrinkers, I was pointed out
> that current kmemcg implementation has a serious design fla
On 03/04/2014 07:21 PM, Michal Hocko wrote:
> On Tue 04-03-14 18:56:06, Vladimir Davydov wrote:
>> Hi Johannes, Michal
>>
>> Could you please take a look at this set when you have time?
> I plan to catch up with others as well. I was on vacation last week and
> now catc
On 03/17/2014 08:07 PM, Michal Hocko wrote:
> On Thu 13-03-14 19:06:39, Vladimir Davydov wrote:
>> When we get to memcg cache destruction, either from the root cache
>> destruction path or when turning memcg offline, there still might be
>> memcg cache creation works pendi
201 - 300 of 1505 matches
Mail list logo