Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp5498665imm; Tue, 26 Jun 2018 12:20:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpekDdiE/2eobq766QMuhUhMsyrmX7NyjNUwyCGyr9+DGwN54QubxdTgWCDYfxW0Q+of/qyH X-Received: by 2002:a62:b90f:: with SMTP id z15-v6mr2811175pfe.254.1530040816587; Tue, 26 Jun 2018 12:20:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530040816; cv=none; d=google.com; s=arc-20160816; b=WfP6mzIixiBCpc2eyXgxn+ApNybGgqhVoZEo9pp7ooltimT71KabbbaBdI5mmnl7NS 4oGnnFQyKn1Jj8cSsyMrjBiheYgpLn+Ei4C1SA79VZ4oPP1j0jCpA86bWIu13ezdrEls f/IM2/Bk/c86ZAWHaayyHOJ4AZFYPWnWeOMMhGVT+b3ERQySttK9++VqHnuiYHQmlDpU 59Fm1+J42vof2bdqKLosABR2yAoclsJe6WtzBBbLrwi5eVKxSv/M1UGvtofZxWlnpn1r 7vsZv2q4O0lR7cmJlMwLOUijwwIc8Ikku4IvspPMwvoItOBWq6w99Y+EqZfYMwohYdra 3lJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=6RXfo9Kz4LSycVlaA8XOUYuoUVPIG7oEWJvgtAmRMVA=; b=jy/91YVbgSXDVaHfGadI0G8c4SFfAoUAGiKuiJba5WkaKpf29zrQHGQZFaYhpbBIHB 9KQOLT9rYCvRvy7OasW29rbXYNejKblpGzbjcZ8zRFEtKmiBY4IUFYHiTCIt1HnzZnJz C7TNBt58+sUOnM5xbwpY8b++tBEk0svzNfhGct2PleVFkL2/k5QdEDk92Io9KO8mqXfa 5P03d+0m6Mro8OEuwGIIN3sATEqC7VLv8RYazT3CNWU+77HFk5lGQ9iT2LCEQLJJtsJJ v/2ZypkDJtRIrlyKNHjXd5jpTfQEoMc+fqfMQOue0V1C3jpSgZysPvnqzOXscx77DfPl CMLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@cmpxchg.org header.s=x header.b=y9mlVq4s; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s7-v6si1861510pgb.281.2018.06.26.12.20.01; Tue, 26 Jun 2018 12:20:16 -0700 (PDT) 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; dkim=fail header.i=@cmpxchg.org header.s=x header.b=y9mlVq4s; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934264AbeFZSze (ORCPT + 99 others); Tue, 26 Jun 2018 14:55:34 -0400 Received: from gum.cmpxchg.org ([85.214.110.215]:49338 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933897AbeFZSzc (ORCPT ); Tue, 26 Jun 2018 14:55:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cmpxchg.org ; s=x; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject: Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=6RXfo9Kz4LSycVlaA8XOUYuoUVPIG7oEWJvgtAmRMVA=; b=y9mlVq4sr/GfrJF40qjMR6tfmx 614mC32Bb3mMUn/UsCE9qvs5K3XoRsgQzYS0eoAtj2kjwxmRgpRKP0dLSg0tswdRmFLHv2Mhc+N9k WCccwZGi3UYNCWDqeGLZShOxV7ww1QXm2UWQ4kk0264mmo4FB1PyE04OZSodzoYT3nNY=; Date: Tue, 26 Jun 2018 14:57:24 -0400 From: Johannes Weiner To: Shakeel Butt Cc: Amir Goldstein , Andrew Morton , Michal Hocko , Vladimir Davydov , Jan Kara , Greg Thelen , Roman Gushchin , Alexander Viro , LKML , Cgroups , linux-fsdevel , Linux MM , Jan Kara Subject: Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg Message-ID: <20180626185724.GA3958@cmpxchg.org> References: <20180625230659.139822-1-shakeelb@google.com> <20180625230659.139822-2-shakeelb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 26, 2018 at 11:00:53AM -0700, Shakeel Butt wrote: > On Mon, Jun 25, 2018 at 10:49 PM Amir Goldstein wrote: > > > ... > > > > The verb 'unuse' takes an argument memcg and 'uses' it - too weird. > > You can use 'override'/'revert' verbs like override_creds or just call > > memalloc_use_memcg(old_memcg) since there is no reference taken > > anyway in use_memcg and no reference released in unuse_memcg. > > > > Otherwise looks good to me. > > > > Thanks for your feedback. Just using memalloc_use_memcg(old_memcg) and > ignoring the return seems more simple. I will wait for feedback from > other before changing anything. We're not nesting calls to memalloc_use_memcg(), right? So we don't have to return old_memcg and don't have to pass anything to unuse, it can always set current->active_memcg to NULL.