Received: by 10.223.185.116 with SMTP id b49csp1050739wrg; Wed, 21 Feb 2018 11:12:45 -0800 (PST) X-Google-Smtp-Source: AH8x227stHFoBOLillZA5UCssUX/kKFhGeipzud6RvixwWn1YQzJeSvtQ7zG46KWtcPkm1kgF2lF X-Received: by 2002:a17:902:c24:: with SMTP id 33-v6mr4074556pls.24.1519240364970; Wed, 21 Feb 2018 11:12:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519240364; cv=none; d=google.com; s=arc-20160816; b=U6CYN/Lq1PoWGAKubqUvB/8I9m0khtFZTPvUyXdpH5kqvnvO3+G2y8gsyXb0C0vJK/ Em9/4vARj0smyWQnVi3DfirptUgKkwdqxN3R07/+p8Gvoo/eY+iYw0Im2Iu8gx++7Q/o dYBzw93tFDePiAns0Tsk6Kgizs6eXQlIeNBy9oZ4KpOGmvACOfsxjEBPLAjbu0etR4TI m7GOB9jf4ruqVL347/myINTIQJnIDvU+A7HiZwOWlj+EHcDI9s0asi7zC5kF6R/qkfpA +8o5UvzaZNxUhpUeuLawulA/WkYaxRuny4eGe2m9abtl7cVnhOoKy7uM+OPkIbmg2wxl BhTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=CfTZyj0Dsk3BPBhyHz00G6gyc4ysOLCY2aN+R+vbgHs=; b=QsbmnCG8LJWBWOXfoz5DbMSzuezb1WddC6h+6ywn4+ReYm0NZeVKmlfIvGeVxVvW3y o04dt5GIwfxHVZY/T23c3i+1v1qjvtG8YGVEPqqxJJ12utqkW19itDX48H3w0voBuQYD LB/osg0B6dIkm2iKVho/3MnPcOziKIxKDj3XBSPsU4F6kA8xq/v+0ca/4dh3+Q8KBo83 m8+qrQWw0sGckOIq85RrqZuL8NwJ28uIRajnkYUa0Q028nSGT+G4vDT57gUf1SmSfNbS RIUnak9aK23WYolcqP8Y5CcCFItr7izQ14FKhAOx83GOkdJ10HvZwPTSJHdPB2c4l+T+ DGdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c23-v6si249409plo.45.2018.02.21.11.12.30; Wed, 21 Feb 2018 11:12:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938700AbeBUR5w (ORCPT + 99 others); Wed, 21 Feb 2018 12:57:52 -0500 Received: from resqmta-ch2-11v.sys.comcast.net ([69.252.207.43]:36022 "EHLO resqmta-ch2-11v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932551AbeBUR5u (ORCPT ); Wed, 21 Feb 2018 12:57:50 -0500 Received: from resomta-ch2-10v.sys.comcast.net ([69.252.207.106]) by resqmta-ch2-11v.sys.comcast.net with ESMTP id oYeMeUXA9ynZEoYeMekEvB; Wed, 21 Feb 2018 17:57:50 +0000 Received: from gentwo.org ([98.222.162.64]) by resomta-ch2-10v.sys.comcast.net with SMTP id oYeJeIeOaP2ieoYeKeFV7g; Wed, 21 Feb 2018 17:57:49 +0000 Received: by gentwo.org (Postfix, from userid 1001) id 60B0511601C5; Wed, 21 Feb 2018 11:57:47 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 5D3091160054; Wed, 21 Feb 2018 11:57:47 -0600 (CST) Date: Wed, 21 Feb 2018 11:57:47 -0600 (CST) From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Shakeel Butt cc: Jan Kara , Amir Goldstein , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Greg Thelen , Johannes Weiner , Michal Hocko , Vladimir Davydov , Mel Gorman , Vlastimil Babka , linux-fsdevel , Linux MM , Cgroups , LKML Subject: Re: [PATCH v2 0/3] Directed kmem charging In-Reply-To: Message-ID: References: <20180221030101.221206-1-shakeelb@google.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfAhe/OtEzw9US2KrOeQnMDAXPXTwZkG4G/EP9RpXuGHdnASiARxcy0R6fXttn9tBYPb8cWx+pG3XqUnmYlepIodohgXBs7xt+rpx3+EcAcVpqvtb4Ipa 9f6CyQlc/SrUjGU6f/xNRK5wuQZa9ZTCnohRh+/HFJElxfP017G5XcC8icSDHTy8Ll2c6vjVq105z4o7oQIbrfi4/i8KBgvp138mHAEck6Sh1/E5HblpIejM gPUHD6QNRwGKNV9tjkGngge2DdEsM4lW9piKX4E91HV9sY98c4Zp/iXCbuF/hL7/petmJbCt05DgLZuxmnFicoKBKhAIy+YcnQlhYLRpoQuMQ61EytMuzTSQ co7QLtnHMMGyaFNryCN4DocTV6kpA6ySKMWvFXuZXV5HPnpCvDsike3MQq6evJOKsPuaNZqw9YMxfHg0UuAe7QuR2nxyW6zFLYByDh6EWFtFgd4cEq6fB8AC ubqbirQc4625dhoWCgQ4+FiVTYPU0AhtKH8tlkeZkOtvSeY/fa6I+G9paEuemsnNXtWa9Ab5lTENO0aJa5QkQb+ZkUe27sfki3mljvcOwR9+y/xZYox4uYeE 3UKAYlBqBI/isebYmoqveyE/x0kuW/sYoiPcCqsVatrts1/gWc4tWwk0oNUoBVM3f+0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Feb 2018, Shakeel Butt wrote: > On Wed, Feb 21, 2018 at 8:09 AM, Christopher Lameter 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? See include/linux/task_work.h. One use case is in mntput_no_expire() in linux/fs/namespace.c > > Are there really any other use cases beyond fsnotify? > > > > Another use case I have in mind and plan to upstream is to bind a > filesystem mount with a memcg. So, all the file pages (or anon pages > for shmem) and kmem (like inodes and dentry) will be charged to that > memcg. The mount logic already uses task_work.h. That may be the approach to expand there.