Received: by 10.223.185.116 with SMTP id b49csp175491wrg; Thu, 22 Feb 2018 19:17:51 -0800 (PST) X-Google-Smtp-Source: AH8x225oFSIccbSH2XoE7xHi9NWWk2f15IiIMsCAUk+NKxT8kfg3tXr9Dg+x5K9Hpyg2g9qOXzo4 X-Received: by 10.99.43.73 with SMTP id r70mr227490pgr.316.1519355871806; Thu, 22 Feb 2018 19:17:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519355871; cv=none; d=google.com; s=arc-20160816; b=lWukdUZw0DYzrEcAGJNfGaet28Th8XrDKGwAJ63LQSg9iXiajDsuRtgRpiN+dtCH9j 0L/xcGR72BCH+rFvkNxisJqI6HnDRNhM6q423fNfT5L3vk3JiE2brQuendvDDPWD1SpZ CXfBxhxxs+Qla41k9rB3mW6E5ptphK3Lv1t4Rgpw17PfrpAj83qLvd2lndTuwV+6lzkC O49sSm2eVNrgYYK+8FKX3+elGh8y9A+7Cn77grJz+/3bZrLCgHm3/tcC6TxxdFemT6QR WAps/IqJzIodfm8knWHTsPe6Sxv56duAaiA3LIir5026pbhHiT0huqfglwKhnK5IU8Xm KCVQ== 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=jkZMwomWbcnaX6gHUnouQXhs/GUJEY8J6MnOWn6xWhw=; b=Qun79yDRk+UreBX2+Vj1pdAVgHeLyGJUICeMrL22fFEe7leZlL+Ac2tbasvS1RAj/+ k/JVhWr+ZLZbK4TdWu20ZHtSK/e/21JdzVIiw0JOvopkQTvoMuJ1gMpJzfy/FZKY6wUx N4JYtqMW1K37lN3lQeUQCgyFQu+yr48fKS1vQtwEQJ22T2jbIgl0EaypOYum+ISQiD0B lXYF49Hvys5sqRjSrvOlN1NL43JImwPxeUhJp2ZxzFrGQ9qi9y7iG41YcqcuvoEVUqzg u/ZbJkLNa312MM9oCsDCFe0N0Jj4iTpyFSIS6ozuaEMCF3Ksu+Z+VUBNRcI90eKdzuk1 MMUA== 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 64-v6si1053092plb.472.2018.02.22.19.17.36; Thu, 22 Feb 2018 19:17:51 -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 S1751411AbeBWDRB (ORCPT + 99 others); Thu, 22 Feb 2018 22:17:01 -0500 Received: from resqmta-ch2-05v.sys.comcast.net ([69.252.207.37]:44168 "EHLO resqmta-ch2-05v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751376AbeBWDQ6 (ORCPT ); Thu, 22 Feb 2018 22:16:58 -0500 Received: from resomta-ch2-12v.sys.comcast.net ([69.252.207.108]) by resqmta-ch2-05v.sys.comcast.net with ESMTP id p3qzeOsgk3HEkp3qzerDXI; Fri, 23 Feb 2018 03:16:57 +0000 Received: from gentwo.org ([98.222.162.64]) by resomta-ch2-12v.sys.comcast.net with SMTP id p3qxe7R5kjXZqp3qyevwwt; Fri, 23 Feb 2018 03:16:57 +0000 Received: by gentwo.org (Postfix, from userid 1001) id 65042116017D; Thu, 22 Feb 2018 21:16:55 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 60CDF1160059; Thu, 22 Feb 2018 21:16:55 -0600 (CST) Date: Thu, 22 Feb 2018 21:16:55 -0600 (CST) From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Jan Kara cc: Shakeel Butt , 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: <20180222135345.epm6e34cvxzaxn74@quack2.suse.cz> Message-ID: References: <20180221030101.221206-1-shakeelb@google.com> <20180222135345.epm6e34cvxzaxn74@quack2.suse.cz> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfG4efywwZbDSLUBTISmJIiGOHWAp02/z1A99jj3WFfdjjSOSk5OCBZeaTAzRy7gqs/uMaDTVJkMae7oDR9YivpyatIZpQodgieRCsU2RmMpjCbc9M1gj FMSMKhmnTfiVSPHtDMGLRjG4/V6n0/qd7WClzqHMtt4fGcz3uSeVCq0Qb1k+OASKgno9S0/4qBFO7261sOB18AObUVC1O66l4NEUXqTfY+t7sLWSIKAcZ8bv 9VNk6wFeH48GSLiVagKgIGRukiYR4K4OHgXVe6mW0rQlZjrfyG5bKoi52hSqHhN4kh9tmUPWhowO6sRCtu5WDdbeqHf0NpNSRA0tj+QnvN65RV0M1KQe1ENk 8mvZcRgGJx9e5YH5En+GGVyivtt4GC9Yir8dSG5al9fMKrjDSTMH+nT+9T91m+PpeB0GFVTm0phCw4HrltiF/W49Jlv0EVgyulyc23O+sGkIP9KHKpvKLftf MxPHrsiZNlMw6S9DYBdChJ4S1YIH3+LpRunKPwxzcaIC8alZK8I6wHY9AlX/8o99UVEEZH9OxIVPOBMn6VslwOz/Qy7fwj+WJ4Q5HjcM9j/S4Fcvd2d1C6ox GRODKprNprLbGrZ/ayebOZM620QIiNhlK2HW29zDBfwyfXDPT4LAg9IGZJ1gjal5wMo= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 22 Feb 2018, Jan Kara wrote: > I don't see how task work can be used here. Firstly I don't know of a case > where task work would be used for something else than the current task - > and that is substantial because otherwise you have to deal with lots of > problems like races with task exit, when work gets executed (normally it > gets executed once task exits to userspace) etc. Or do you mean that you'd > queue task work for current task and then somehow magically switch memcg > there? In that case this magic switching isn't clear to me... Thats surprising since one can specify the task. If its only for current then why do you need a parameter? I think a capability of executing a function in the context of another running task could simplify a lot. In particular if something triggers behavior that is related to another task from the kernel like whats happening here. It should not be that difficult to do proper synchronization on the list of work and then set some flag (maybe SIGPENDING) to make the task execute whats on the tasklist. Signal delivery is after all similar.