Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp6068410imm; Wed, 27 Jun 2018 01:27:45 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIsp1Q94yL1LFdjlFNXStGZ7XKrFALvwEMrNst46FvtREXxqbueaJLkGnyA+rwgbMZewm8z X-Received: by 2002:a17:902:3041:: with SMTP id u59-v6mr5167724plb.208.1530088065165; Wed, 27 Jun 2018 01:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530088065; cv=none; d=google.com; s=arc-20160816; b=nqG1u+8waf8RvFLyI72QndsO5Yw8K1bxRY+SnYwBdXqE8nk3kJz9YoTqxuTL0r8lmu KfqaDSGaHe60raMBh6cdIVqNHiwMglKCzct3rWLbuwZC6DrUBOAiYOwtnKAjBY0BZGza yMfHvZunwibYJ55a8uMdg4X4xYDAq1ty4toTIeZ+lAbiKllwzdjx14MXj+H4A02M9J5O vzk7R7BX0IAlKLzIJvT/q14/PsvBGWRv2zPcTzc992uCzmGHre9WFrhnJQ2/sNi00abS LuYPpMCvVj+1YyJYZuxoa4kdtHXgZf+NMMzNNNaf9YNPF2x2Lh1AfESzG9F98NaY0cvK bkVA== 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:arc-authentication-results; bh=JFL9Oms7cw9svxZA3+NDe+PC7bb4yY8dDIFW3tQlbSM=; b=XIoaP2tSrV20X+ZkUDSRJ8Jw4w+h4jgGGRd5CunbjCD3lW8tBcCyULj3zW2DF8Jfkv LDneTgPjbjtpxSJSCNCe72IuxTKSdh+dj12IQ0bhrFJP8WDKf/l1JKsVrgeytpuBckd7 T9+tLXmwfNJvgkcg2W8SShU2ZLyGmkVGfZWHQPTweZ8xRYuhUOqvYY799b5Todc20Y4n U7LXkViq2UPJKh0/LV4IIXs+X+IMPRxMFyDklECGb1xAC+ZlI6/x0E4au3UiGa6KQOyT B+w95VoMRzjgl7yMEv/rYL2hr4AcYtWMhynItJSAz9JUz6WnNnyijV28at5WUKxyAMR0 ayow== 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 k14-v6si3639585pls.477.2018.06.27.01.27.28; Wed, 27 Jun 2018 01:27:45 -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; 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 S1753091AbeF0Hbu (ORCPT + 99 others); Wed, 27 Jun 2018 03:31:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:39048 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751268AbeF0Hbs (ORCPT ); Wed, 27 Jun 2018 03:31:48 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id ED0CEAFFC; Wed, 27 Jun 2018 07:31:46 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 028BC1E3BFD; Wed, 27 Jun 2018 09:31:45 +0200 (CEST) Date: Wed, 27 Jun 2018 09:31:45 +0200 From: Jan Kara To: Shakeel Butt Cc: Johannes Weiner , 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: <20180627073145.yyviq53ntkdkfv3w@quack2.suse.cz> References: <20180625230659.139822-1-shakeelb@google.com> <20180625230659.139822-2-shakeelb@google.com> <20180626185724.GA3958@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 26-06-18 12:07:57, Shakeel Butt wrote: > On Tue, Jun 26, 2018 at 11:55 AM Johannes Weiner wrote: > > > > 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. > > For buffer_head, the allocation is done with GFP_NOFS. So, I think > there is no chance of nesting. The fsnotify uses GFP_KERNEL but based > on my limited understanding of fsnotify, there should not be any > nesting i.e. the allocation triggering reclaim which trigger fsnotify > events. Though I would like Amir or Jan to confirm there is no nesting > possible. You are correct. Fsnotify events are generated only as a result of some syscall, not due to reclaim or stuff like that. Honza -- Jan Kara SUSE Labs, CR