linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Shakeel Butt <shakeelb@google.com>
Cc: Jan Kara <jack@suse.cz>, Yang Shi <yang.s@alibaba-inc.com>,
	Michal Hocko <mhocko@kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Linux MM <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-api@vger.kernel.org
Subject: Re: [PATCH v2] fs: fsnotify: account fsnotify metadata to kmemcg
Date: Wed, 14 Feb 2018 10:38:09 +0200	[thread overview]
Message-ID: <CAOQ4uxifddquri4BNqBSKv6O_b13=C08kKYinTo9+m56z1n+aQ@mail.gmail.com> (raw)
In-Reply-To: <CALvZod4SNwWHYZQsphB90cY-wc8WSLurKsA2kNxfVKV-upwy9A@mail.gmail.com>

On Wed, Feb 14, 2018 at 3:59 AM, Shakeel Butt <shakeelb@google.com> wrote:
> On Tue, Feb 13, 2018 at 2:20 PM, Shakeel Butt <shakeelb@google.com> wrote:
[...]
>>>>> Something like FAN_GROUP_QUEUE  (better name is welcome)
>>>>> which is mutually exclusive (?) with FAN_UNLIMITED_QUEUE.
>>>>>
>>
>> How about FAN_CHARGE_MEMCG?
>>

I am not crazy about this name.
Imagine a user that writes a file system listener that is going to run
inside a container.
The user doesn't need to know about the container or what is memcg
and what is memcg charging.
IMO, we need to hide those implementation details from the user and
yet encourage user to opt-in for memcg charging... or do we?

>
> Also should there be a similar flag for inotify_init1() as well?
>

This question changed my perspective on the fanotify_init() flag.
Unlike with fanotify, for inotify, is it the sysadmin that determines
the size of the queue of future listeners by setting
/proc/sys/fs/inotify/max_queued_events

IMO, there is little justification for a program to opt-out of memcg
charging if the sysadmin opts-in for memcg charging.
Anyone disagrees with that claim?

So how about /proc/sys/fs/inotify/charge_memcg
which defaults to CONFIG_INOTIFY_CHARGE_MEMCG
which defaults to N.

Then sysadmin can opt-in/out of new behavior and distro can
opt-in for new behavior by default and programs don't need to
be recompiled.

I think that should be enough to address the concern of changing
existing behavior.

The same logic could also apply to fanotify, excpet we may want to
use sysfs instead of procfs.
The question is: do we need a separate knob for charging memcg
for inotify and fanotify or same knob can control both?

I can't think of a reason why we really need 2 knobs, but maybe
its just nicer to have the inotify knob next to the existing
max_queued_events knob.

Thanks,
Amir.

  reply	other threads:[~2018-02-14  8:38 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-27 18:22 [PATCH v2] fs: fsnotify: account fsnotify metadata to kmemcg Yang Shi
2017-10-28 14:19 ` Amir Goldstein
2017-10-29  2:39   ` Matthew Wilcox
2017-10-30 12:43 ` Jan Kara
2017-10-30 16:39   ` Yang Shi
2017-10-31 10:12     ` Jan Kara
2017-10-31 16:44       ` Yang Shi
2017-11-01 15:15         ` Jan Kara
2017-11-09 13:54       ` Michal Hocko
2017-11-13 19:10         ` Yang Shi
2017-11-14  9:39           ` Michal Hocko
2017-11-14 17:32             ` Yang Shi
2017-11-15  9:31               ` Jan Kara
2018-01-19 15:02                 ` Shakeel Butt
2018-01-22 20:31                   ` Amir Goldstein
2018-01-24 10:34                     ` Jan Kara
2018-01-24 11:12                       ` Amir Goldstein
2018-01-25  1:08                         ` Shakeel Butt
2018-01-25  1:54                           ` Al Viro
2018-01-25  2:15                             ` Shakeel Butt
2018-01-25  7:51                           ` Amir Goldstein
2018-01-25 20:20                             ` Shakeel Butt
2018-01-25 20:36                               ` Amir Goldstein
2018-02-13  6:30                                 ` Amir Goldstein
2018-02-13 21:10                                   ` Shakeel Butt
2018-02-13 21:54                                     ` Amir Goldstein
2018-02-13 22:20                                       ` Shakeel Butt
2018-02-14  1:59                                         ` Shakeel Butt
2018-02-14  8:38                                           ` Amir Goldstein [this message]
2018-02-19 13:50                                             ` Jan Kara
2018-02-19 19:07                                               ` Amir Goldstein
2018-02-20 12:43                                                 ` Jan Kara
2018-02-20 19:20                                                   ` Shakeel Butt
2018-02-20 20:30                                                   ` Amir Goldstein
2018-02-14  9:00                                         ` Amir Goldstein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOQ4uxifddquri4BNqBSKv6O_b13=C08kKYinTo9+m56z1n+aQ@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=shakeelb@google.com \
    --cc=yang.s@alibaba-inc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).