From: Gabriel Krisman Bertazi <krisman@collabora.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Hugh Dickins <hughd@google.com>,
Al Viro <viro@zeniv.linux.org.uk>,
kernel@collabora.com, Khazhismel Kumykov <khazhy@google.com>,
Linux MM <linux-mm@kvack.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Theodore Tso <tytso@mit.edu>
Subject: Re: [PATCH v3 0/3] shmem: Allow userspace monitoring of tmpfs for lack of space.
Date: Thu, 21 Apr 2022 18:37:09 -0400 [thread overview]
Message-ID: <87levyoyga.fsf@collabora.com> (raw)
In-Reply-To: <CAOQ4uxhjvwwEQo+u=TD-CJ0xwZ7A1NjkA5GRFOzqG7m1dN1E2Q@mail.gmail.com> (Amir Goldstein's message of "Thu, 21 Apr 2022 08:33:56 +0300")
Amir Goldstein <amir73il@gmail.com> writes:
> On Tue, Apr 19, 2022 at 6:29 PM Gabriel Krisman Bertazi
> <krisman@collabora.com> wrote:
>> > Well that sucks. We need a kernel-side workaround for applications
>> > that fail to check and report storage errors?
>> >
>> > We could do this for every syscall in the kernel. What's special about
>> > tmpfs in this regard?
>> >
>> > Please provide additional justification and usage examples for such an
>> > extraordinary thing.
>>
>> For a cloud provider deploying containerized applications, they might
>> not control the application, so patching userspace wouldn't be a
>> solution. More importantly - and why this is shmem specific -
>> they want to differentiate between a user getting ENOSPC due to
>> insufficiently provisioned fs size, vs. due to running out of memory in
>> a container, both of which return ENOSPC to the process.
>>
>
> Isn't there already a per memcg OOM handler that could be used by
> orchestrator to detect the latter?
Hi Amir,
Thanks for the added context. I'm actually not sure if an OOM handler
completely solves the latter case. If shmem_inode_acct_block fails, it
happens before the allocation. The OOM won't trigger and we won't know
about it, as far as I understand. I'm not sure it's real problem for
Google's use case. Khazhy is the expert on their implementation and
might be able to better discuss it.
I wanna mention that, for the insufficiently-provisioned-fs-size case,
we still can't rely just on statfs. We need a polling interface -
generic or tmpfs specific - to make sure we don't miss these events, I
think.
Thanks,
--
Gabriel Krisman Bertazi
next prev parent reply other threads:[~2022-04-21 22:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-18 21:37 [PATCH v3 0/3] shmem: Allow userspace monitoring of tmpfs for lack of space Gabriel Krisman Bertazi
2022-04-18 21:37 ` [PATCH v3 1/3] shmem: Keep track of out-of-memory and out-of-space errors Gabriel Krisman Bertazi
2022-04-18 21:37 ` [PATCH v3 2/3] shmem: Introduce /sys/fs/tmpfs support Gabriel Krisman Bertazi
2022-04-22 9:54 ` Dan Carpenter
2022-04-18 21:37 ` [PATCH v3 3/3] shmem: Expose space and accounting error count Gabriel Krisman Bertazi
2022-04-19 3:42 ` [PATCH v3 0/3] shmem: Allow userspace monitoring of tmpfs for lack of space Andrew Morton
2022-04-19 15:28 ` Gabriel Krisman Bertazi
2022-04-21 5:33 ` Amir Goldstein
2022-04-21 22:37 ` Gabriel Krisman Bertazi [this message]
2022-04-21 23:19 ` Khazhy Kumykov
2022-04-22 9:02 ` Amir Goldstein
2022-05-05 21:16 ` Gabriel Krisman Bertazi
2022-05-12 20:00 ` Gabriel Krisman Bertazi
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=87levyoyga.fsf@collabora.com \
--to=krisman@collabora.com \
--cc=akpm@linux-foundation.org \
--cc=amir73il@gmail.com \
--cc=hughd@google.com \
--cc=kernel@collabora.com \
--cc=khazhy@google.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=tytso@mit.edu \
--cc=viro@zeniv.linux.org.uk \
/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).