Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp577912lqr; Wed, 5 Jun 2024 14:47:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVWB93SEh3E2fn4RJoWEf7bucdIzmHd7F7kQHn9OWsteP7GAil8UTxoxUZfwVUq/CZPsbjQCMTxacKGSn/7Qa4LJqIVjOE7DUK1ER8UAw== X-Google-Smtp-Source: AGHT+IGFQYPVOQ8EdF7/TfYDVR4Ei16NpErpuUi7aaaaAq5/RP1mD9aAs3YF2NGPlQlI/+sNyu99 X-Received: by 2002:a17:903:22c3:b0:1f6:782e:da23 with SMTP id d9443c01a7336-1f6a5a84e4emr47972245ad.63.1717624032380; Wed, 05 Jun 2024 14:47:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717624032; cv=pass; d=google.com; s=arc-20160816; b=tXH/Ev/2TPyRPf3NM5nfkwfyFrvAizU9nWsIg8XWg8b+nTmwon/q5HqcS7v8cvg4Ps H7qp8IrM6x5ixUyxj/lMi0Hyb3kCJ6WeYTG33qhXdHmbDlKHG4mJEZphUIDSwv/haOCS 6afzJU8ePV6MYqBohR2BdVgFMA5dB4AzAmgDfPXjl2B4x8Rz/CXXmU2rDX1AyQe7jakc YLsxxMiLLhHoVWJeyS39B3kCYs1HQa7m0r4KS10B4tYg7K3Kl1TjrO1KHmv5QYUEdwNK EQ+/K+hIXrda/vvykKqaO0n9Ju0xHcZKXXp86UKa625X839bMgRulWqlz3AdAfpaKU5h eABQ== 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:message-id:subject:cc:to:from :date:dkim-signature; bh=Td0yDgwEbarSZhb+pJTh1VpaTH6Fk9ZcWqk8nc3uFrI=; fh=V1tVKsNeNj17HkDU4xZWUcFFy8DX3lL+jHx06Li3s3k=; b=pLajh+EAJkayS9RguchNDRJUmDp4J8kl/nhydr6GFZog5GHo2AFsrdFMqXt5T7QcnK 3mgPMjeQT1Uw1Pu+YEYAz9Y/7Qghknbl3/6yw1djetzhP4BRbYrSq+rw8tEY/8Cejs2g R7XfjTZH8RFeg6oqyDbI9/H+2dT2mfc5mRgAE9U1Ya8oTxtDHOcfLvg838rvbW2hS8vY jvAYlL8304eWKZ5PgMPCfv9Icn2rTvzurBgUSlOTnMyhOZX/kOjXcP9zB+RqxYT2a1m0 aDv83neGy7wnfjwOu9O/Sde4A6sfpo7VFFIR5/DrzQaK88wz2RKX/v9BasdZR4LSLCxL v34A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tBmwCejs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-203319-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203319-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd76072dsi362385ad.86.2024.06.05.14.47.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 14:47:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203319-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tBmwCejs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-203319-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203319-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 4A43D282C6E for ; Wed, 5 Jun 2024 21:43:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC34715FA77; Wed, 5 Jun 2024 21:43:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tBmwCejs" 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 078081373; Wed, 5 Jun 2024 21:43:45 +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=1717623825; cv=none; b=q3+He4rPj7lXgWvC/fnGmCvgigqeRMgI7qExCRQ7iiEs0Ak/BRJbSBE9Kwyd5WP7xPtggBrCCCneRVVvaRxyvaOy1eUOvy1t/IgSjfwLl2Av0S3qmhlCF8k9Wcjwss8FbVC1IKb9aZUP04xCIUQbTNafIJ4JY2wqnxfZr1kNzlM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717623825; c=relaxed/simple; bh=aFVcd3geGR9oREiYgD4RepVhm5hzoZ0e1xsgwtZ3xEw=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=mrysDJB+hB8sEpCfru+SNVr2HzAVbP6Y9ypiv2lNpQAAvmy9/ZNROVCMQcLuMzqm5YDs7bRCQUtUIy8in7ONLagJZO9HTmuRKEIn1OpH5w4MjCm1SyUvrSGEiYFibD5Yg1bQz7ue2uzx5drePm4QRKYQpL3aZ2wnM6ty6pQGh6w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tBmwCejs; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 904ABC2BD11; Wed, 5 Jun 2024 21:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717623824; bh=aFVcd3geGR9oREiYgD4RepVhm5hzoZ0e1xsgwtZ3xEw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=tBmwCejsGiyfz8GhEMM/IndBJanR8YLNfWrKeFEHMrJUPX9uFGMbTXvKhSM2N9bEj T3RDKX8Z9a4+iQh1pnrALyE/u4xHgywxRjeRSD7kDqcCVl1bvgaT6KxyCQVr2oy0YQ siRX7jpVZ89wLhWSg/dpeEGOlpFtOz708FZuatdJgKnfxiGN6CmsXv6aDHYPVAssV/ CE7CJBlnK7kSQzg9ZZgPAkcxbfI6mwlocsnZttS3wQJxY+vkW2eL7E5YTivdvdLS+r +9nDx0YJ75qtco7aoWAi1VO0EmvPlwZy4wYivMmln5BBfsKs+7BOTO2WaD4goThKqw /Rcp3PwNdWIyQ== Date: Wed, 5 Jun 2024 16:43:42 -0500 From: Bjorn Helgaas To: Martin Oliveira Cc: 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 , Logan Gunthorpe , Greg Kroah-Hartman , 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: <20240605214342.GA781723@bhelgaas> 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: <20240605192934.742369-2-martin.oliveira@eideticom.com> 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 s/This/This is/ ? > uses the sysfs file as an allocator from userspace. > > Furthermore, having the page_mkwrite() operator causes > writable_file_mapping_allowed() to fail due to > vma_needs_dirty_tracking() on the gup flow, which is a pre-requisite for > enabling P2PDMA over RDMA. > > Fix this by adding a new boolean on kernfs_ops to differentiate between > the different behaviours. > + * Use the file as an allocator from userspace. This disables > + * page_mkwrite() to prevent the file time from being updated on write > + * which enables using GUP with FOLL_LONGTERM with memory that's been > + * mmaped. "mmaped" does seem more commonly used in Linux than "mmapped", but the base word "mapped" definitely requires "pp", so "mmaped" looks funny to me.