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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F1C8C433B4 for ; Tue, 4 May 2021 16:08:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D85AF61176 for ; Tue, 4 May 2021 16:08:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D85AF61176 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 43B0F6B0036; Tue, 4 May 2021 12:08:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E9B16B006E; Tue, 4 May 2021 12:08:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B1836B0070; Tue, 4 May 2021 12:08:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0007.hostedemail.com [216.40.44.7]) by kanga.kvack.org (Postfix) with ESMTP id 11F7B6B0036 for ; Tue, 4 May 2021 12:08:56 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id AEA0A98B0 for ; Tue, 4 May 2021 16:08:55 +0000 (UTC) X-FDA: 78104032230.03.4328505 Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by imf16.hostedemail.com (Postfix) with ESMTP id 7637E80192E9 for ; Tue, 4 May 2021 16:08:47 +0000 (UTC) Received: by mail-lf1-f51.google.com with SMTP id t11so12571148lfl.11 for ; Tue, 04 May 2021 09:08:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Tf/R97YEf4cFzt1vZ9gUcx48NN8pR3KeiNJvsYkKg1c=; b=QmkTJKvcsfPZuv1JX6swOXoEYeVJtK7+DCp0ngbQEG3HB5/LVcPjTPzZ9A8lpto6n/ QbWdo2r7oFJ3iacS0C3orXwTHSICzrAgU8oJoG2xfbmps9bFuL2wzDyjhLdmTFdvHpSZ f8F5C21S2/HxUHwhfQp1Afe+T+NPCqQ1VjaLY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Tf/R97YEf4cFzt1vZ9gUcx48NN8pR3KeiNJvsYkKg1c=; b=Zl1/PxrzzsbfIztST9gqbbAmSBO5SI0OxFACn5PgH+eOFkRiAJOl9s2htEnICRPSD6 gsytmY2dPAhOnqCpsoCZoXlMkw16DiLWIGTWjpWCObeJM6sYVbmHbPsNdUOtHUiJxLyA rtA+5vjJDWoRzYgECaBdWCab0zLg6NIkmwiPkyaswQj72alH/nya2CVC/jyBQsfifJFj K1FicGS6PK2/u60YgRDNzdxI5aSNok/Yh9FpWBULsIbO44twq9XzBDY/2xeCZRt6zkDd zGTzgqaccy9iFI5r6immQ6OTx7gs3+eOj4C4VNsMUu8eNLGJi02nXfsdfn72ZscB1ZkB DqZA== X-Gm-Message-State: AOAM532gtyOf3q7vEVZxEBxyZjXhnnvUx+pBoQYJYS6mYAcG/HBRNuas dU6QX+LS5uKK+rePE0quvTE6Ioq+PCXcDQJ7 X-Google-Smtp-Source: ABdhPJwQh4wC0BfEr4OAUhq8kkQudn7O8PMQ7nWQTsjO0H6pw4MW4vhBmVLbXbDn1/IHBuTQCe9E8w== X-Received: by 2002:a05:6512:c0e:: with SMTP id z14mr13030017lfu.539.1620144533190; Tue, 04 May 2021 09:08:53 -0700 (PDT) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com. [209.85.208.169]) by smtp.gmail.com with ESMTPSA id a17sm300416lfl.228.2021.05.04.09.08.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 May 2021 09:08:50 -0700 (PDT) Received: by mail-lj1-f169.google.com with SMTP id u25so11840101ljg.7 for ; Tue, 04 May 2021 09:08:49 -0700 (PDT) X-Received: by 2002:a05:651c:33a:: with SMTP id b26mr18071486ljp.220.1620144529516; Tue, 04 May 2021 09:08:49 -0700 (PDT) MIME-Version: 1.0 References: <20210429154807.hptls4vnmq2svuea@box> <20210429183836.GF8339@xz-x1> In-Reply-To: From: Linus Torvalds Date: Tue, 4 May 2021 09:08:33 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Sealed memfd & no-fault mmap To: Simon Ser Cc: Peter Xu , "Kirill A. Shutemov" , Matthew Wilcox , Dan Williams , "Kirill A. Shutemov" , Will Deacon , Linux Kernel Mailing List , David Herrmann , "linux-mm@kvack.org" , Greg Kroah-Hartman , "tytso@mit.edu" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=QmkTJKvc; dmarc=none; spf=pass (imf16.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.167.51 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 7637E80192E9 X-Stat-Signature: 73ncpiijacfyop6rrt4sfz681dzfjotu Received-SPF: none (linuxfoundation.org>: No applicable sender policy available) receiver=imf16; identity=mailfrom; envelope-from=""; helo=mail-lf1-f51.google.com; client-ip=209.85.167.51 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620144527-479073 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: On Tue, May 4, 2021 at 2:29 AM Simon Ser wrote: > > The remaining 10% is when the compositor needs a writable mapping for > things like screen capture. It doesn't seem like a SIGBUS handler can > be avoided in this case then=E2=80=A6 Oh well. So as Peter Xu mentioned, if we made it a "per inode" thing, we probably could make such an inode do the zero page fill on its own, and it might be ok for certain cases even for shared mappings. However, realistically I think it's a horrible idea for the generic situation, because I think that basically requires the filesystem itself to buy into it. And we have something like 60+ different filesystems. Is there some very specific and targeted pattern for that "shared mapping" case? For example, if it's always a shared anonymous mapping with no filesystem backing, then that would possibly be a simpler case than the "random arbitrary shared file descriptor". But maybe that simpler (if untested) VM patch is fine if 90% of the time it's a plain normal non-shared mapping, and you have to have the SIGBUS case for backwards compatibility anyway, but at least some _benign_ cases are now handled without pain... Linus