From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E276C54798 for ; Tue, 27 Feb 2024 22:21:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DA76A6B016D; Tue, 27 Feb 2024 17:21:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D57276B0170; Tue, 27 Feb 2024 17:21:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BF77B6B0171; Tue, 27 Feb 2024 17:21:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id AEC916B016D for ; Tue, 27 Feb 2024 17:21:29 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 87D061A0D46 for ; Tue, 27 Feb 2024 22:21:29 +0000 (UTC) X-FDA: 81839006298.03.9F3C883 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) by imf19.hostedemail.com (Postfix) with ESMTP id CE17E1A000B for ; Tue, 27 Feb 2024 22:21:27 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=gnD5MWcU; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf19.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.185 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709072488; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=uwgQo6FDRri5QEfNjCzxF2Jb9a4VN388sKPexvzlY+s=; b=biwKBX96AtnpJpv8kcpUNvG1i4rIZQM6WukH3PcE747DrGn6WJE7UaGJ7B8I9ig6c/wKJt 4Cz/UgGkAaWGrwOVJsIp4gdTZBVGCf7JHemQ9MfD9VA57n2lhQ3H/ay/UNEggFebA71PFQ B7gh65OM3TZjs7+zoWdJSIvUQpAbuSM= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=gnD5MWcU; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf19.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.185 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709072488; a=rsa-sha256; cv=none; b=x75dD8SQmgnp8/ranOi44yJUmmyKNcbzA0En64gZ5RvJwruH4IZNcqK5q3+y4ceb34iyGd 2k+7xYXVXgLNLcwchFfdi67U15ORx6q/dfzCQnFDJO72a1tVHMmVTqVx1DUcX09ecIhl+n bNxdhIDPtMF3JasT4tMuFSnEfBAbrUg= Date: Tue, 27 Feb 2024 17:21:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1709072485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=uwgQo6FDRri5QEfNjCzxF2Jb9a4VN388sKPexvzlY+s=; b=gnD5MWcUFUZGk46B7cTR9rWkXEzxnfif0bRYTG3B0YZ4kIWu0e3/gzI6tPhivFQ9Z0RNn/ CN4mOcGHbaTPl4u/jnuOZnpwtcJe8dxxgXqOUQpcuiGsrQyAJbeWwv91Kn4drOxfN2H1fT p+05sqFjkpJFO7VKXHFjgjEfIN8eCPU= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Dave Chinner Cc: Luis Chamberlain , lsf-pc@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm , Daniel Gomez , Pankaj Raghav , Jens Axboe , Christoph Hellwig , Chris Mason , Johannes Weiner , Matthew Wilcox , Linus Torvalds Subject: Re: [LSF/MM/BPF TOPIC] Measuring limits and enhancing buffered IO Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: CE17E1A000B X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: o174tk94hyn9dq39ikpcweruxuobmgpg X-HE-Tag: 1709072487-169607 X-HE-Meta: U2FsdGVkX1/MIbUUv9udQtDCSNhEE8w2lPFJDFX80/Nl9YdVpw0yAow6rdiXAOTTtrK4e2vWUPZy5ZTXQWs2dhZNuHueRJpVKv+sDXq/Map6jOdJ0fzBHZ+ylaavrjT8SN1lp3KAmDezTWJ4Tj6Y2LhVqVWZdU9XphJ8y5WOoKsr5QMlL890V2fvP7WB8CwX2xauqVHO9jRSdzkVOXI3OKPuPXnZ/3fMQ7yQ5C90eK58CjWwl4QoB/rJ4lNFheq7182165IFHQCp8QS1D066qIk7hkFashf5G3hCWhOg3UmUH82oYKup1nDo1nfOe2cFF84XtKfNmJj+Se0V8e8V6T1qALBS0XqxQuBV+bQB2+zP9iNWJiVExSqrVBkR8I/FIiAAESrPCRY91/WeUiX9UVZbHBNgw9H6k6BGaDoWSkThyX7HOKyF90H1nQ9A53jLihhXEN6fK9vMB3A+JqFLVU2PzxDwj2q9+fWB+s5tWijubypOYmilCZUFBsMw+z/zjRvOUwhDvQDnhzVB47l/ZcLwMNHtVGUoeabGYK1C6rjzWaeNgMihcTr7CF5nLHO/bupDiNoOfR91kNWPGsjcM3T0uDv3j/3vC7fquBzOlhBj7C+6t26vUiyI+I7uYiEqCp03gSgkfRXVKWgJdz5T///YU/rHVuyw0OcYTmrcenUsAiSWrbtKrt7abiWIEbd7K3upY1rudnmJqJQaFzc9F4+XOUbNKZ8KsKLHWXQ4zVdaoUsOTsPY5RDfDHN+0LazzuocSnLlvG+ogeEFN31nCuXqGXYSbBF35oSjJJIgp6A= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, Feb 28, 2024 at 09:13:05AM +1100, Dave Chinner wrote: > On Tue, Feb 27, 2024 at 05:07:30AM -0500, Kent Overstreet wrote: > > AFAIK every filesystem allows concurrent direct writes, not just xfs, > > it's _buffered_ writes that we care about here. > > We could do concurrent buffered writes in XFS - we would just use > the same locking strategy as direct IO and fall back on folio locks > for copy-in exclusion like ext4 does. ext4 code doesn't do that. it takes the inode lock in exclusive mode, just like everyone else. > The real question is how much of userspace will that break, because > of implicit assumptions that the kernel has always serialised > buffered writes? What would break? > > If we do a short write because of a page fault (despite previously > > faulting in the userspace buffer), there is no way to completely prevent > > torn writes an atomicity breakage; we could at least try a trylock on > > the inode lock, I didn't do that here. > > As soon as we go for concurrent writes, we give up on any concept of > atomicity of buffered writes (esp. w.r.t reads), so this really > doesn't matter at all. We've already given up buffered write vs. read atomicity, have for a long time - buffered read path takes no locks.