Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3856208pxy; Tue, 4 May 2021 11:25:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNZFcK2I10ydAgN3LBWXda/6FnVJkfLgfsPN+FS0CBPZjDv4ONuBZOagsF6aPo3XXM+WHK X-Received: by 2002:a17:90a:520f:: with SMTP id v15mr6691074pjh.205.1620152717427; Tue, 04 May 2021 11:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620152717; cv=none; d=google.com; s=arc-20160816; b=haN6Ph6qmJlvI2Nqb7U2bzVszAagh5M+UnPEAUv1LUNCdRRfk+jkznfFLoQi4RsHSg yGMPbKJNLk91cqx0IP1RuSRigHuyOIs5tkc1ad69e59hvXciqXBtPyfZl7mcuLDcAOiU B4E0dVCVP712gD8OS3wNZ0rw8qXYocnOTn1Czf3tdzbJc/2zpzXXpvfMhQjgJcc+uLvk QUwgk+qz+wbrpPYph54WdUA045YrlaFO59GAOsh9pZwCFKsFXDBGAsLcyKIN+7F52AJH tLRuPghoO27S8h9d5Zd8P+IsctCTL20yvpalNPZhwpeo/kXgPvCf4ZBIcWnPkLRsz8YJ DsJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Tf/R97YEf4cFzt1vZ9gUcx48NN8pR3KeiNJvsYkKg1c=; b=SUSzPqkDBdIHdmbWqtIKGp2Kprc5+uyAMR93qgyuh0ctuaNwfOadABbb2lSQagYzt4 Svq/hpq0h9MJIerc9g4sRQvZu8mtbNPPQkw4igdJ8p3PNniR3dI/snEwm7ZwdYf2t21d lUlbseL0yDmbXkUgIA2ZjBL8yeu67gA9IQVrUwWBXBFR7RZLoSbd3RAboWXcwVRVySSh qTZxNpHFjDbUIYmZk+iRt5UcYDlUvToNCFgnoh1Fp/4+dOCxq7q32IdMtx/4tn7NCTix 2qbkTV4ZGnwZkBLYWTwaj/MWOQjxjCILoOJDpten+3w/D4niY2uQgCuGgXs79+6WbveC fPYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QmkTJKvc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e12si3137178pgt.9.2021.05.04.11.24.57; Tue, 04 May 2021 11:25:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QmkTJKvc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231673AbhEDQJu (ORCPT + 99 others); Tue, 4 May 2021 12:09:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231529AbhEDQJt (ORCPT ); Tue, 4 May 2021 12:09:49 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1704FC061574 for ; Tue, 4 May 2021 09:08:54 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id e12so9519301ljn.2 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=FGTUgLOm0afNE466Vpqbe6nfq1e3AWscv2ZlPzy5KNR1Dz0GGO9hGX5GkSKapeWMvw 5+4l50MOIT9s0algWisZk31KGUa+kX2XOi/19BqPy3t5fYaLbfK0lsoXV4FecftdlnKj blxAGB3yfU+dIYi7wZWcIhIBaqGUZ+S2EcGn8lU+vo6SYiggH/xGwDXmzQo9u0eqXIE+ DhXWZtWFcWlsrWHQHyDXKsRO4hZCQpfoUK1KurQWzqVrYdsaT379gK6W48gAmD/1tLsr I3Azv9MgXePni4ypl5K47D0qf+9sxH7pKjy1sCj3BhX+jpDl7HP/kBI8z6nQe7tIXd8O wOYg== X-Gm-Message-State: AOAM531t5GimEthmdtAGCTCSAzy4ApPrFPe5IZZzUhGtBOoLNS9xptE1 Gk9lwnSYmY0xF1at30Qjt4GHvYVcXnOScn0R X-Received: by 2002:a2e:921a:: with SMTP id k26mr2612007ljg.149.1620144532420; Tue, 04 May 2021 09:08:52 -0700 (PDT) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com. [209.85.208.178]) by smtp.gmail.com with ESMTPSA id t1sm299833lfg.226.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-f178.google.com with SMTP id u20so11787351lja.13 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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