lkml.org 
[lkml]   [2018]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/3] mm: rework memcg kernel stack accounting
On Thu 23-08-18 09:23:50, Roman Gushchin wrote:
> On Wed, Aug 22, 2018 at 04:12:13PM +0200, Michal Hocko wrote:
[...]
> > > @@ -248,9 +253,20 @@ static unsigned long *alloc_thread_stack_node(struct task_struct *tsk, int node)
> > > static inline void free_thread_stack(struct task_struct *tsk)
> > > {
> > > #ifdef CONFIG_VMAP_STACK
> > > - if (task_stack_vm_area(tsk)) {
> > > + struct vm_struct *vm = task_stack_vm_area(tsk);
> > > +
> > > + if (vm) {
> > > int i;
> > >
> > > + for (i = 0; i < THREAD_SIZE / PAGE_SIZE; i++) {
> > > + mod_memcg_page_state(vm->pages[i],
> > > + MEMCG_KERNEL_STACK_KB,
> > > + -(int)(PAGE_SIZE / 1024));
> > > +
> > > + memcg_kmem_uncharge(vm->pages[i],
> > > + compound_order(vm->pages[i]));
> >
> > when do we have order > 0 here?
>
> I guess, it's not possible, but hard-coded 1 looked a bit crappy.
> Do you think it's better?

I guess you meant 0 here. Well, I do not mind, I was just wondering
whether I am missing something.
--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2018-08-24 09:52    [W:0.071 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site