From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1241EC433EF for ; Tue, 19 Apr 2022 15:29:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8A7CD8D007A; Tue, 19 Apr 2022 11:29:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 856B58D0047; Tue, 19 Apr 2022 11:29:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 71F9E8D007A; Tue, 19 Apr 2022 11:29:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 618378D0047 for ; Tue, 19 Apr 2022 11:29:03 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 2A78362326 for ; Tue, 19 Apr 2022 15:29:03 +0000 (UTC) X-FDA: 79374011766.11.E431A98 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by imf18.hostedemail.com (Postfix) with ESMTP id 876271C0008 for ; Tue, 19 Apr 2022 15:29:01 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id E880C1F42793 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1650382141; bh=rkSlUoutshtFn7WULyLopKxe+pkuypNyxiYzPULXXDo=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=etypumsnGOftZGZlaZ9aPNEXT/pg2J3N26P5EnmS06+ecDayKjCXfdAERAawJOq3s idglqCkBzpGltCBuxSunkA+BXjtdvFSZAmLfnvcJwbD08Nr5UL9+2Ydbt5chVCTFGq kvypFviLwX1h5vq0bWs9YLXLFIrL8qsVzP5eAqAa94v8hFHXmiOg6fOGxIrXlpeO7l MXv6XYSS+0pVr+OAybcTCstRRCGViUasyW23r75A0UgU4dLSU/wUoWcCWhOkOEbn70 EytP2qWAlKQ6mpplPR/5fJTEFP3K21I6BEdblfHZogpXkxoX+ndC1bnRgdbkHAdZxB k4UrkEtshEKKw== From: Gabriel Krisman Bertazi To: Andrew Morton Cc: hughd@google.com, amir73il@gmail.com, viro@zeniv.linux.org.uk, kernel@collabora.com, Khazhismel Kumykov , Linux MM , linux-fsdevel Subject: Re: [PATCH v3 0/3] shmem: Allow userspace monitoring of tmpfs for lack of space. Organization: Collabora References: <20220418213713.273050-1-krisman@collabora.com> <20220418204204.0405eda0c506fd29e857e1e4@linux-foundation.org> Date: Tue, 19 Apr 2022 11:28:56 -0400 In-Reply-To: <20220418204204.0405eda0c506fd29e857e1e4@linux-foundation.org> (Andrew Morton's message of "Mon, 18 Apr 2022 20:42:04 -0700") Message-ID: <87h76pay87.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 876271C0008 X-Stat-Signature: uspn4a1sox4f5nkpbdkcwh1m1xao57wk Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=etypumsn; dmarc=pass (policy=none) header.from=collabora.com; spf=pass (imf18.hostedemail.com: domain of krisman@collabora.com designates 46.235.227.227 as permitted sender) smtp.mailfrom=krisman@collabora.com X-HE-Tag: 1650382141-574066 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Andrew Morton writes: Hi Andrew, > On Mon, 18 Apr 2022 17:37:10 -0400 Gabriel Krisman Bertazi wrote: > >> When provisioning containerized applications, multiple very small tmpfs > > "files"? Actually, filesystems. In cloud environments, we have several small tmpfs associated with containerized tasks. >> are used, for which one cannot always predict the proper file system >> size ahead of time. We want to be able to reliably monitor filesystems >> for ENOSPC errors, without depending on the application being executed >> reporting the ENOSPC after a failure. > > 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. A system administrator can then use this feature to monitor a fleet of containerized applications in a uniform way, detect provisioning issues caused by different reasons and address the deployment. I originally submitted this as a new fanotify event, but given the specificity of shmem, Amir suggested the interface I'm implementing here. We've raised this discussion originally here: https://lore.kernel.org/linux-mm/CACGdZYLLCqzS4VLUHvzYG=rX3SEJaG7Vbs8_Wb_iUVSvXsqkxA@mail.gmail.com/ > Whatever that action is, I see no user-facing documentation which > guides the user info how to take advantage of this? I can follow up with a new version with documentation, if we agree this feature makes sense. Thanks, -- Gabriel Krisman Bertazi