[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180221125426.464f894d29a0b6e525b2e3be@linux-foundation.org>
Date: Wed, 21 Feb 2018 12:54:26 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Shakeel Butt <shakeelb@...gle.com>
Cc: Christopher Lameter <cl@...ux.com>, Jan Kara <jack@...e.cz>,
Amir Goldstein <amir73il@...il.com>,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Greg Thelen <gthelen@...gle.com>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>,
Vladimir Davydov <vdavydov.dev@...il.com>,
Mel Gorman <mgorman@...e.de>, Vlastimil Babka <vbabka@...e.cz>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Linux MM <linux-mm@...ck.org>,
Cgroups <cgroups@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 0/3] Directed kmem charging
On Wed, 21 Feb 2018 09:18:35 -0800 Shakeel Butt <shakeelb@...gle.com> wrote:
> On Wed, Feb 21, 2018 at 8:09 AM, Christopher Lameter <cl@...ux.com> wrote:
> > Another way to solve this is to switch the user context right?
> >
> > Isnt it possible to avoid these patches if do the allocation in another
> > task context instead?
> >
>
> Sorry, can you please explain what you mean by 'switch the user
> context'. Is there any example in kernel which does something similar?
>
> Another way is by adding a field 'remote_memcg_to_charge' in
> task_struct and set it before the allocation and in memcontrol.c,
> first check if current->remote_memcg_to_charge is set otherwise use
> the memcg of current. Also if we provide a wrapper to do that for the
> user, there will be a lot less plumbing.
>
> Please let me know if you prefer this approach.
That would be a lot simpler. Passing function arguments via
task_struct is a bit dirty but is sometimes sooo effective. You
should've seen how much mess task_struct.journal_info avoided! And
reclaim_state.
And one always wonders whether we should do a local save/restore before
modifying the task_struct field, so it nests.
What do others think?
Maybe we can rename task_struct.reclaim_state to `struct task_mm_state
*task_mm_state", add remote_memcg_to_charge to struct task_mm_state and
avoid bloating the task_struct?
Powered by blists - more mailing lists