Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1254508lqh; Mon, 6 May 2024 01:45:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVtrL6C58uUplBtivhPAAAjoulmmRAq0d3Qff4oCS0P7IQa6xKeV/hi0Tb3vBsqaBs+XHfeoDS46HM4SiaYiCM0uLPrJkPMv5QndMA6Xw== X-Google-Smtp-Source: AGHT+IHWB44izTFaaFJRtMxVed/nOM4Z9GTw9Ekjzp+3i97xFTzEKUIIb3pgMy00+HU85b8dNroA X-Received: by 2002:a05:622a:1393:b0:43a:f7fb:9698 with SMTP id o19-20020a05622a139300b0043af7fb9698mr13025029qtk.41.1714985149763; Mon, 06 May 2024 01:45:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714985149; cv=pass; d=google.com; s=arc-20160816; b=a9s4RsLCuVcHp2sJ67rNlKRSAqa5rIdMOTV4c1OHVXcUEr2WF4IlNSd452KnZ0N7ou jiaUfIDi48Duq90FFtFQjaZnI89MTkrhjY8YHc70dW7cwMLU32W4ct3nxbb84Wvg/bGy rvGx+zNXDgLpAQ4nFw2R6Pi+4/JI3lF6S1zfSV3DchesI7QMYdC0QPGCQpETslnsdDs0 J7/1BDaSKyKxU2i1yjR9syQaDjyxMLbjx9RTfwKJ+sKrPpNxTis7xG/n0/U0loukwMtW fmIEuAeulEiuwpYZy7nn4gi8+MuaZNXFO6RorGYZ6Hv7Ydz/A8dXu6Nyd+ev1ja1eKNx utsQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=dJ9zuyrdQMElrOzde31P4H08+N2W3DV9j7dWCbVqR4k=; fh=K+u6k4LeW50YAlFBITh17z6/Kw8sjFmvdXtpOlBV5c8=; b=SpFcq3W0AbID8pYEQr6FuliTayPK9avJfPL4+i5/sgzcE+lLlSR5W6iFJQM8/nfbmD HNhbfrVRNO4nvz4LMiAZYJ8E7dCFgpwBgpzw9/T4/Jk19owNfkaAX8TrL8y3S7Y1Mtlk Rm6QInnsKsmefYayPwuDt67aB7LXxJPr9S/zl7CjBHz+1wWAK60N+XhiPnmkyhz45yHg LadUO/za4/qXvb6AOdwQeDvI1HLaB12Su8g/KaVgMN4/hQFFt+0BSZbKQjkZ1DEgVCQ+ H1HfeE5Sgr3yHqKNakcDP+SQGnud+4x53i5eGL+iXMkCFpMtapNsFtZcBieCCUpcCerV omig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WiQEaAXK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id e15-20020ac85dcf000000b0043ae7068a00si9138575qtx.27.2024.05.06.01.45.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 01:45:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WiQEaAXK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 74C2E1C219CE for ; Mon, 6 May 2024 08:45:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8492C1422A7; Mon, 6 May 2024 08:45:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WiQEaAXK" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B35C6CDAC; Mon, 6 May 2024 08:45:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714985135; cv=none; b=lCIbM550VK17YX4egchPYfRsw9cQXAIsl5eFKxsZTALPxKYfGlS5k1c8IIZa1mQZZRSY2b3cbB8MHtHFu3p2rYFwTbIFtKKgqaIxoo/io0orZFAQU2lI+1GXFdMvue6sd4iRalZt6F+0nbi34V8aHImnzzZdbOF2q8A4fDZ0Ato= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714985135; c=relaxed/simple; bh=dJ9zuyrdQMElrOzde31P4H08+N2W3DV9j7dWCbVqR4k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Pn0glFOlCOoWG/hthTj35BPtSPdxAb3AHtVAW5MMWdN0kmrCKQuFQ3HMdgy/5SYgu17es+2jzMYz1g9Pjj5+qVYB1YiQ4N0t/Q1oaMc24LqZi2gI0tSiLVsw6pdvgqX2RSOTSR9RFpvjfEanoMRpPNeSIJ/VH7+DsNyXBxrC/oo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WiQEaAXK; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E24BC116B1; Mon, 6 May 2024 08:45:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714985135; bh=dJ9zuyrdQMElrOzde31P4H08+N2W3DV9j7dWCbVqR4k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WiQEaAXK+d3VZO4xZnfaaIE7Sfh/pbjnMpO2gmWdDzHwWYp4rCrmzMwXPbAuSq2D8 fH+uA4HbPL5yqyI2GI4Xc1nJoimiQWf+O2OZbhl4eYWFSaH6g9e91opm+dSgDUUjAo cG3n3hq8hLlCm6ZsuoLuvkOvcM+NPydIKO2b4EhgiC3t07V0qaT/mPyvfrKo2du0XH JKiCZbDEcy7JnFsbVJDyor6eEcRM3VC21/p2XQujBcHzxcTTufWj4iOIv1ZXu3TpfD Gedh6JD88bRDWqWtwfa4IVCiDN3PyGp/pVOTPWZ2724+lohSOjT706b6NsDbMz5iyb wPCurUHMEdlsw== Date: Mon, 6 May 2024 10:45:27 +0200 From: Christian Brauner To: Linus Torvalds Cc: Al Viro , keescook@chromium.org, axboe@kernel.dk, christian.koenig@amd.com, dri-devel@lists.freedesktop.org, io-uring@vger.kernel.org, jack@suse.cz, laura@labbott.name, linaro-mm-sig@lists.linaro.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, minhquangbui99@gmail.com, sumit.semwal@linaro.org, syzbot+045b454ab35fd82a35fb@syzkaller.appspotmail.com, syzkaller-bugs@googlegroups.com Subject: Re: [PATCH] epoll: try to be a _bit_ better about file lifetimes Message-ID: <20240506-injizieren-administration-f5900157566a@brauner> References: <202405031110.6F47982593@keescook> <20240503211129.679762-2-torvalds@linux-foundation.org> <20240503212428.GY2118490@ZenIV> <20240504-wohngebiet-restwert-6c3c94fddbdd@brauner> <20240505-gelehnt-anfahren-8250b487da2c@brauner> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: > The fact is, it's not dma-buf that is violating any rules. It's epoll. I agree that epoll() not taking a reference on the file is at least unexpected and contradicts the usual code patterns for the sake of performance and that it very likely is the case that most callers of f_op->poll() don't know this. Note, I cleary wrote upthread that I'm ok to do it like you suggested but raised two concerns a) there's currently only one instance of prolonged @file lifetime in f_op->poll() afaict and b) that there's possibly going to be some performance impact on epoll(). So it's at least worth discussing what's more important because epoll() is very widely used and it's not that we haven't favored performance before. But you've already said that you aren't concerned with performance on epoll() upthread. So afaict then there's really not a lot more to discuss other than take the patch and see whether we get any complaints.