Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1150019lqt; Fri, 7 Jun 2024 09:18:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUYWeaBzkb8tISuW7lznrbDN2bTdikokS8jjQYRZLoIqKt6dvE9hI/r8a9lAl62v5EP2fbT8t2ZMJhOSOG3+sh5hPxi+IVoc3PKicostQ== X-Google-Smtp-Source: AGHT+IEwy/uc3BR2FkS2BL+Yjcbl+zb0uHhqSySTvtP5rSV65FRAHIgrbug9WQ1XyUln77mWJg+j X-Received: by 2002:a17:902:788e:b0:1f6:8ae4:510d with SMTP id d9443c01a7336-1f6d031372bmr25206365ad.39.1717777081288; Fri, 07 Jun 2024 09:18:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717777081; cv=pass; d=google.com; s=arc-20160816; b=lVPw2GiOHDrYadgpZf8yIKSb29N85ZOozEXGuS0LGGbKs58c7gDhKWde9tfwKe36tk l+t0LygXbeepZuRumbfcwtnXDY5K0H4etNak0cuuSyCduSlubQWINB1u3qFlcJblsZPf vugeOppr1ZNhi9usH7Q88tIb/1/LsZC4igWZqCNFXQpBMSnTuzX23RGO3c1ntJRaBDmO R1KSSDdvdlIWnUeOxgWF/oPMPTaPJvSWcWgaL+eG4HxLTttarFiK5+ZHgUb4W3voEEKD NAwlmlMS+pPHSRh8iB+RUbdKqVoleqPc4fBAy2JuvoW2bfV/+CwE5TWdArufGBGqE9ad uH3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=qkDEkc3600QydwZ7dLx85k/1FneEqzK/z4bkuCI+5S8=; fh=1yc15yNDWZcRAE2Q2trAhZSykKBx7ot0tY39SihpmMI=; b=BNxD1z2Ca/N4W0EZz67TOF6yiJJHkyVlHi2BGLhCoZoMb2hR/3bfSViiFdvJ8iZBwR FdW1r3vFvj96SUyKJEwc6oxSYQ9Rcxk2OBQt/jeqfYHQ7MiW2pwcw+RBiQkbE/FoJV8r FEsFtoYTE+fMqvWg6ZIJdBWhva7X0gUhk/Bd1WAPQqZ2U3+tPL/KjxBSxfa6IAk/KpdC aF6PoPtMNIkAQo4lA77Hx5cS5aiohvGRO2qAqF+XZzVrIy8RyejMCitblaTUJp2YymR1 Xo4YEjoQN3cDgtMCIM5JZ9gq32eSUYUxe7UdbGkcP89AGcSauQG/VFB58spKOidjSw9q 2Kcw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=BBIh0yCR; arc=pass (i=1 spf=pass spfdomain=deltatee.com dkim=pass dkdomain=deltatee.com dmarc=pass fromdomain=deltatee.com); spf=pass (google.com: domain of linux-kernel+bounces-206465-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206465-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=deltatee.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd7f354dsi10247385ad.460.2024.06.07.09.18.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 09:18:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206465-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=BBIh0yCR; arc=pass (i=1 spf=pass spfdomain=deltatee.com dkim=pass dkdomain=deltatee.com dmarc=pass fromdomain=deltatee.com); spf=pass (google.com: domain of linux-kernel+bounces-206465-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206465-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=deltatee.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E40EF289DF1 for ; Fri, 7 Jun 2024 16:18:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B2C219AD64; Fri, 7 Jun 2024 16:17:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=deltatee.com header.i=@deltatee.com header.b="BBIh0yCR" Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) (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 2624119AA63; Fri, 7 Jun 2024 16:17:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=204.191.154.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717777049; cv=none; b=DTseyb3ghVdANX5oLmXd5vMTGxzfb74SM702vlhL1vZF6zmnmvwUBVC9yT+yxAoFb5b3nnMljZfWcyXmWh7KatkvLAMV6dA0+uKQOWmgxf6+ThFaltItKFVhdn6bx67i39Cyd2yBD4HFGOMakfcEDXXdBlyKcOyCwkXALvKOnE8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717777049; c=relaxed/simple; bh=QfF9Bb7X32F8nICu81y4HThudduzWvXoFg1jEZTpPhE=; h=Message-ID:Date:MIME-Version:To:Cc:References:From:In-Reply-To: Content-Type:Subject; b=NjQlgc/e/wYsgH5HdTzU1q2tHcUZgYoWwBZlXwBS++87Z2uFLEWpSJQTdffGMna6AnHDztmYSolAohUvBvtrjE6ka2yYPDVbGAJInnZxoEzBUNUQlpR+NLSKxYuOqbm0IIR1RGoBxY6NaimzO5cFZlRaHOEEOy96R2wE/Ar9jF0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=deltatee.com; spf=pass smtp.mailfrom=deltatee.com; dkim=pass (2048-bit key) header.d=deltatee.com header.i=@deltatee.com header.b=BBIh0yCR; arc=none smtp.client-ip=204.191.154.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=deltatee.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=deltatee.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:In-Reply-To:From:References:Cc:To: MIME-Version:Date:Message-ID:content-disposition; bh=qkDEkc3600QydwZ7dLx85k/1FneEqzK/z4bkuCI+5S8=; b=BBIh0yCRXnuFy/KVqsXSN0Ylfu RvrfX04VdJB3Fw2avS7C17nDPoTwlpTf9XQi3wuBbfvzX3ZFNHVCl1NwYu2/PPOGLE7QkR2tET3Iq B5ktVUDPG8MF7I3G89kYngU4gEfVeHZXrG3i1NMqVinkvy8Pzh9+q9QZRhpQYxeYyvN+wwFTlmGHE dp7tguHBZtRWbAX+rITl46AsNMZ/uAofdIz8MGNGDSIF/A/sI6fT37NqJOUFeKQbzlybKJT1QWEIg rHMS8X2tz+58WNHlo7DNN9t+cGoZGKYId1dXBKtTy+E4tdiT3RNoJqNdo9RRG7v4Qe2GcxlNJg/eP VofAp7tA==; Received: from d104-157-31-28.abhsia.telus.net ([104.157.31.28] helo=[192.168.1.250]) by ale.deltatee.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1sFcHC-002ro5-1t; Fri, 07 Jun 2024 10:17:15 -0600 Message-ID: <69dc6610-e70a-46ca-a6e9-7ca183eb055c@deltatee.com> Date: Fri, 7 Jun 2024 10:16:58 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Christoph Hellwig , Greg Kroah-Hartman Cc: 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 References: <20240605192934.742369-1-martin.oliveira@eideticom.com> <20240605192934.742369-2-martin.oliveira@eideticom.com> <2024060658-ember-unblessed-4c74@gregkh> Content-Language: en-CA From: Logan Gunthorpe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 104.157.31.28 X-SA-Exim-Rcpt-To: hch@infradead.org, gregkh@linuxfoundation.org, martin.oliveira@eideticom.com, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-mm@kvack.org, jgg@ziepe.ca, leon@kernel.org, bhelgaas@google.com, tj@kernel.org, rafael@kernel.org, akpm@linux-foundation.org, mike.marciniszyn@intel.com, michaelgur@nvidia.com, dan.j.williams@intel.com, ardb@kernel.org, valesini@yandex-team.ru, lukas@wunner.de X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Level: Subject: Re: [PATCH 1/6] kernfs: create vm_operations_struct without page_mkwrite() X-SA-Exim-Version: 4.2.1 (built Wed, 06 Jul 2022 17:57:39 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) 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? Logan