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 5D4C5C47DD9 for ; Mon, 26 Feb 2024 01:03:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 90D31940009; Sun, 25 Feb 2024 20:03:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8BF0D940008; Sun, 25 Feb 2024 20:03:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 784FF940009; Sun, 25 Feb 2024 20:03:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 681AF940008 for ; Sun, 25 Feb 2024 20:03:02 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 19B6A40638 for ; Mon, 26 Feb 2024 01:03:02 +0000 (UTC) X-FDA: 81832155804.05.616CFF6 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) by imf06.hostedemail.com (Postfix) with ESMTP id 1A98B18001B for ; Mon, 26 Feb 2024 01:02:59 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=FAXnDyda; spf=pass (imf06.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.182 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708909380; 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=CRDocoIq5L5VL7T7kFqFldfUmNPgeWeF71pW5MECIhM=; b=wie4pUeuP0I7bBlAtFvs/IGhlzcG7NTHgzLdZvodOYAXM7NyS2ZljMbTtkFjt/p9Xo5YR2 MakrZku+H8vWuQu5+SIUr4sbBFU+ZalO+IIIORAABODUA7Pp5dEgRJRLt3l5S2xTFrPHoF sB0OvaoNAnKJrxRLv2R+rI0jEvF+qwA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708909380; a=rsa-sha256; cv=none; b=VaX3WGX89owuM/Yvwyb/GWSXmhq1emSScVMoxV7HxIozwNQX0cYfP1OCcJA/QQYAzS7XYu AMzq6tzqF8wVRItduTkGc61ptoshE2ULAl+dx7qOzGyhXmaS5YMNKo21ikSMHlhhCA8j3G 2IeYYQCm+29kGMn6C1sqJVo/WNMOTUc= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=FAXnDyda; spf=pass (imf06.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.182 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev Date: Sun, 25 Feb 2024 20:02:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1708909377; 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=CRDocoIq5L5VL7T7kFqFldfUmNPgeWeF71pW5MECIhM=; b=FAXnDydagYHVkuck7VKRFcdjy2RLbMHqzE7QLwk5tK3SaP7afsd0VCs/sNjlrcMqNGb/52 RKqalU0K1Fb7T8OTxtw38rHJV/Oz+OC2uN+CP/HWsa3NvbitBgxAKfRjW50mwx9lgfPA8D M1Fk0XAR7QbhTsw8yzVS4ykyquCGcqk= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Linus Torvalds Cc: Matthew Wilcox , Luis Chamberlain , lsf-pc@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm , Daniel Gomez , Pankaj Raghav , Jens Axboe , Dave Chinner , Christoph Hellwig , Chris Mason , Johannes Weiner 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: 1A98B18001B X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 7hqqqbewmfzwiuimewhcmon73wq7fas1 X-HE-Tag: 1708909379-95559 X-HE-Meta: U2FsdGVkX1/YPrGAn6bPvSeUp3m248/44U5n7CCgDKoOHZdgCPACe+9ae3QUdK0tKOhX2WogTqWJQIaKb0ASBMl802xz2cg+Y8cBjxuJTAeN3pfyUdxtmCRhUlWfR/paXVC4pCDYJqgSNOOWNvDexhAlK9PsvYT4JksZXWcMM1uvwAnA28eZhv1NWtsYz0WbZpu6ReZpgCjyeN9mq0pQBqCVRhT74FE9gVa7wHam9yBu3U2Umy+ZoZs17IgzD38yzpVvSeOqeZBvvKGVmubzVTxdgRx7c3qg1Ddk74tBp9PtQt/mo8VE4nIXVZR3LVJnFrC/1wRNKtbwREUesMokos/D0x8jcEhJWBqCBGgt+LNSiYjuw5PwbVgntRlPAYGGER03xkdS/EJiZAb5G91kJOOCEBz6+L4MS3GkA+ETQp6yCluBHzGNW9XLKriDbuA9ETVyR3ODj1wb90V6rmtKzcJozhiDLCAwe2JHgODRwtxFDjtwxggxGXuES8fI5HzV+mz35Q5GfOthPcMGryZvoNMMHGMJ7JK2OVhwj961P3ctOK9WZmQiPE8bmp/I/0HVw/9XhimKGbkAQ0/5Qhxy23Wn6jKhRrS5OBsTVgJQlV1YpYCfp5wNu+zP3Gz2G9x01Y9eICckjGzDTxPWyQE/lPxbiAMqcCe/vfOCrAnC3RPeyYEJv2WsBoH5LfVb9FNqipSPVbEbX1Alc7C/qp9iPkBC686xQs4Frqk5f2PjaqasgV2KdN9SRbXiLH6Pzn76JVrVLv7kzr4GnSIRfT48AK5fUrlNNr3HpsunhNLAscgpvj9iEnURZoSiy882WpmU/8Cwl7Fowink9QhBiNLk32vD5MCO3gTw0WGcck1Jl0q6n+TyiX9MhWOOhVDx8h1iv6x6OBLlSISFX0uANs9LaHUFWhhA5cwATc4qBor4n8Kjog1hifj2/A5MnENl2JH7xfl5fMIJbQ/fNtAXT0X YmM+MSr2 3Ti+27Z1onQ+umncT5H+US9C9x4Or10wCFQRJWY9HFHgL/DKbXiFQVZJCovUYjlU57P/KJN6PuWmqS71Uepdeyt6jRRBvib62v/1OIwsTMhsaEWlX8rmAHtfWWVmqPL1asHZ2hTXIhK557Sn1wiIhTBPWPQ== 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 Sun, Feb 25, 2024 at 03:45:47PM -0800, Linus Torvalds wrote: > On Sun, 25 Feb 2024 at 13:14, Matthew Wilcox wrote: > > > > Not artificial; this was a real customer with a real workload. I don't > > know how much about it I can discuss publically, but my memory of it was a > > system writing a log with 64 byte entries, millions of entries per second. > > Occasionally the system would have to go back and look at an entry in the > > last few seconds worth of data (so it would still be in the page cache). > > Honestly, that should never hit any kind of contention on the page cache. > > Unless they did something else odd, that load should be entirely > serialized by the POSIX "atomic write" requirements and the > "inode_lock(inode)" that writes take. > > So it would end up literally being just one cache miss - and if you do > things across CPU's and have cachelines moving around, that inode lock > would be the bigger offender in that it is the one that would see any > contention. > > Now, *that* is locking that I despise, much more than the page cache > lock. It serializes unrelated writes to different areas, and the > direct-IO people instead said "we don't care about POSIX" and did > concurrent writes without it. We could satisfy the posix atomic writes rule by just having a properly vectorized buffered write path, no need for the inode lock - it really should just be extending writes that have to hit the inode lock, same as O_DIRECT. (whenever people bring up range locks, I keep trying to tell them - we already have that in the form of the folio lock, if you'd just use it properly...)