Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1250647lqt; Fri, 7 Jun 2024 12:18:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUSp+f9N5oUrozQ6vfZ+kZYABA2n6rfajJMnpHTYhgA1IsmnDDR2j6wF0FpVfmmi3rVsgl0cfFC1izx/noxTt02dSv0Zv5S4F0Q+tNsUw== X-Google-Smtp-Source: AGHT+IE3xiaTx8Pw4OsHUjCJNn99Hgt7bXQ4LGf70L7HfTcHcy6P+mTScaPYMv1ix4zEhbYR6GIM X-Received: by 2002:a05:6870:968e:b0:24f:cfbd:70ad with SMTP id 586e51a60fabf-254643e1f70mr4001398fac.9.1717787920518; Fri, 07 Jun 2024 12:18:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717787920; cv=pass; d=google.com; s=arc-20160816; b=nxdnD32HQRqfMiRmmJA+GFKsjXE09BGTnv32QAyzK+Dd2gNt/CxfHdzqhownhxLZE+ nJ3eIlUj6MjIvA4Hp9evhNfccbcf8PmJvthJJXmraw7IT5nZdJ8NAN5hTpxuXGuPDZA8 QHvmO1Z91l+ikBG/ao2V4uPVni6uf6esM1jjHyrjabhdvKHo6100Jl90j/r2Yox0bNpY iqMfMKAdR40/iBn+BmwmLZAU+d0Xse79sxWz4e0NefZsJnZ7FWPRGk5hR5DJTbnO5EGB LjGkoVBA3U6TLgHDyMbGyjFC3cvYbiLoSeUV+d1OG5QLEsMXekeScCip/xmZ1FsiNu5o wCmA== 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=b9IYMOU4SD1OWT7nQYrFoerChL4QXQ9Rg1NA63lI1K4=; fh=kUAyKP30SuAVQvEuTzW3W2TQHzl5S0QHio+EhZqaXkc=; b=b4eY/TwONHlNqgn7vpSa91WpGwCbUyuL5IcY4Duk7LVMzRpqvQ4u28RcviVdII+esz eGRyjmzO3TsJVFAs+LRYdEvaArlYuYDF0dW7YXLQguSIDYGz8Tpt1mA7ZxNEdklUvQyP sj7s+cXVdE2ht8q/fvP/khLBYKvAuDeLDf2ndQ1cXWlUdcxXahjVadEa/IGyNec9vS2V DTHlVzDcyGCbqLs6e8YpbJbwP0Y3t0LCHhHX3dpbbDFglJujcS/J6/M+IOh374iwVApq /NBicPeSp7wnFHQ/6PPAY4zke7vSyRZviJn0nFNd3cgaLg+jt26XUcFOcYJK+/jfiypY AYiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jYrXTcVt; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-206656-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206656-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-44038a6f932si47789681cf.149.2024.06.07.12.18.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 12:18:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206656-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jYrXTcVt; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-206656-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206656-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 310B31C21354 for ; Fri, 7 Jun 2024 19:18:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B2E4114D2B5; Fri, 7 Jun 2024 19:18:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="jYrXTcVt" 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 D387C139588; Fri, 7 Jun 2024 19:18:06 +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=1717787886; cv=none; b=itrrWQ03OYdY3ckAzalCB7zV7/xaYUQqrJBWnbpxbRnIGMWmKtaGCxkQR6Hve1Fn4/i7rYJlaEkC1/CfPiLS7fEKh/CnqZPh1D/yXLBjK1BC8XQqvAH1nGhJ86rYEvrkbDiGhKhXePiozSstA0c2r52JnYVNHA61MLntvWEHUyE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717787886; c=relaxed/simple; bh=l2TuVuG5EfkG98JENqnCwFuIerVqcUyCRo5aD5PVxpw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=n/sn/4e2wqt1SIvnOm8BllnkY3WgLVwjbXgw0jFtQhFcH4uynMtf3tbALOBSILdc3TIsy1UJD7PLGZyOxy2sTMrtdvt6eAf7WDo3K/4y+iQ0qFLOFKFPIIAwjZcAhh3bgCe2Yx9cIu0NnCANBR8YCqdu2zpHjc4JHGJPx1qhBlE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jYrXTcVt; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FE86C2BBFC; Fri, 7 Jun 2024 19:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1717787886; bh=l2TuVuG5EfkG98JENqnCwFuIerVqcUyCRo5aD5PVxpw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jYrXTcVtp+1UVrzguQzrm278C0/EpbOO3MlDJqNv1hK0Bedkt7ZbaWgfHzWaHoi3D /9V4Kd7tpSIK/SWejp6BOcYOVyjvSjQWT1wycjFkeubwHKddtzBkQQ2Po4ruKLmdTx YwULqF186a190ebh5hC/cFAZqwgjgrjtkja6MvaA= Date: Fri, 7 Jun 2024 21:18:04 +0200 From: Greg Kroah-Hartman To: Logan Gunthorpe Cc: Christoph Hellwig , Martin Oliveira , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-mm@kvack.org, Jason Gunthorpe , Leon Romanovsky , Bjorn Helgaas , Tejun Heo , "Rafael J. Wysocki" , Andrew Morton , Mike Marciniszyn , Michael Guralnik , Dan Williams , Ard Biesheuvel , Valentine Sinitsyn , Lukas Wunner Subject: Re: [PATCH 1/6] kernfs: create vm_operations_struct without page_mkwrite() Message-ID: <2024060755-stimuli-unworthy-61a8@gregkh> References: <20240605192934.742369-1-martin.oliveira@eideticom.com> <20240605192934.742369-2-martin.oliveira@eideticom.com> <2024060658-ember-unblessed-4c74@gregkh> <69dc6610-e70a-46ca-a6e9-7ca183eb055c@deltatee.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <69dc6610-e70a-46ca-a6e9-7ca183eb055c@deltatee.com> On Fri, Jun 07, 2024 at 10:16:58AM -0600, Logan Gunthorpe wrote: > > > On 2024-06-06 23:03, Christoph Hellwig wrote: > > On Thu, Jun 06, 2024 at 10:54:06PM +0200, Greg Kroah-Hartman wrote: > >> On Wed, Jun 05, 2024 at 01:29:29PM -0600, Martin Oliveira wrote: > >>> The standard kernfs vm_ops installs a page_mkwrite() operator which > >>> modifies the file update time on write. > >>> > >>> This not always required (or makes sense), such as in the P2PDMA, which > >>> uses the sysfs file as an allocator from userspace. > >> > >> That's not a good idea, please don't do that. sysfs binary files are > >> "pass through", why would you want to use this as an allocator? > > > > I think the real question is why sysfs binary files implement > > page_mkwrite by default. page_mkwrite is needed for file systems that > > need to allocate space from a free space pool, which seems odd for > > sysfs. > > The default page_mkwrite in kernfs just calls file_update_time() but, as > I understand it, the fault code should call file_update_time() if > page_mkwrite isn't set. So perhaps the easiest thing is to simply not > add a page_mkwrite unless the vm_ops adds one. > > It's not the easiest thing to trace, but as best as I can tell there are > no kernfs binary attributes that use page_mkwrite. So alternatively, > perhaps we could just disallow page_mkwrite in kernfs entirely? Sure, let's do that.