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 B0531C369C2 for ; Thu, 17 Apr 2025 09:58:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E624F280163; Thu, 17 Apr 2025 05:58:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D7438280162; Thu, 17 Apr 2025 05:58:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AB654280163; Thu, 17 Apr 2025 05:58:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 77DD1280162 for ; Thu, 17 Apr 2025 05:58:20 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 04890C162F for ; Thu, 17 Apr 2025 09:58:20 +0000 (UTC) X-FDA: 83343085602.01.18F9B20 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf10.hostedemail.com (Postfix) with ESMTP id 772ABC0009 for ; Thu, 17 Apr 2025 09:58:19 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="LQ2y/3rs"; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf10.hostedemail.com: domain of brauner@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=brauner@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1744883899; a=rsa-sha256; cv=none; b=8FOwsKw7+1clnfRQTO8CX1QzH2Dg/hhITFJC1LJhIsZu41FBJxv/PHx6Ez3ZAVgogNRCQ6 G2B1t08KJNurdORbD+wzRFlxjNqHjlPaDnrMc8uMePrST6HDpmE2ChgklWf5LLSJnhW+sk j51VaCOmInV4q4HkkJEv8m4osQ4BQz4= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="LQ2y/3rs"; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf10.hostedemail.com: domain of brauner@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=brauner@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1744883899; 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=0XkuSOkmDOdZRpXLE+312x5QJiOSr2lfwu0UntGEZgI=; b=poVuqMEo953VjTxEz9YIDRvBRHxjxBCCLB2zQKb7BQJ5cE6RhuuXka8MZ3L2PVyVHDFN6L V1pIHe0p0MBFqv6j8OjqKWgftz1Gsw56nqi7aXjmFMxPkCrlG0462x3wBYQzyo5BEmLDQ5 RPtB4Xdy08q/vnw59/UpIgoFpQgHT+g= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 1DDA268430; Thu, 17 Apr 2025 09:58:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD3FCC4CEE4; Thu, 17 Apr 2025 09:58:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744883898; bh=XKfzMU1FYpRJY8gsd2/4gHvZ0QLwqAm+grYaFWdFud0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LQ2y/3rsaJf1lr4h3arCc3AGGaekutRzZ3Aflp+xfuE+onK/ZbkOhh1oFMYzAIPyv a41GWzdLy4tdggpl3OYUY5EnvPyJ7MUq9ap/QExd42TcC0l0+4SNxl9lnfJ/6IBZAm FkHcKaOm7IpIkP8UNMY5SVHlsLss80jnDlSKT0SMfpyBYbLd4jXnSm8GNkQV2sE8sd wRMKHQ4l11anriWEWLpA3yS1zyWK4HNBTubBhmfl2H7YBg23UMkjhrjFVaMVyqShXl 4bwK8Ijo9Fjtl00XnWzhTjoNYdKzoFSkbrSMst43ihmeipN+vQVAirACmra+6ZxOpY q7h/08NHiL7EQ== Date: Thu, 17 Apr 2025 11:58:12 +0200 From: Christian Brauner To: Davidlohr Bueso Cc: jack@suse.cz, tytso@mit.edu, adilger.kernel@dilger.ca, mcgrof@kernel.org, willy@infradead.org, hare@suse.de, djwong@kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH -next 0/7] fs/buffer: split pagecache lookups into atomic or blocking Message-ID: <20250417-jagdhund-ruhmreich-f1c979cdd58d@brauner> References: <20250415231635.83960-1-dave@stgolabs.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20250415231635.83960-1-dave@stgolabs.net> X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 772ABC0009 X-Stat-Signature: 3csuym5rzn1dqpg1gnajfixfq5iktqm6 X-Rspam-User: X-HE-Tag: 1744883899-199104 X-HE-Meta: U2FsdGVkX1/FQT+xIxbqYH+WFIUrAZARniMe4bA9SsYp2nQMS1iP0TLZmXciJ1Cc79QbgcoKGgTR25xElYY0pjVvkawhrckBlFM4mEpSaSxRnO3RTsuwlovH9qkhR5WVruqRdzHqJdNw0WalEP2wVmui6Fa5lryzsLYjcLjwVl73Vgtm1Yqjb+xJOjQ0qyzbWrIFwPnX09Nry720aLpNe2Tr74KmvvCp/3CWCXkaLDghM/oVjlk8wFympQtuegRQ3PpgZFxn6Ug9Jx6OZLcNveC3fs5fJME7BzjVegK2CyBOafNJsu37n1FidJVX4fTIqOsnxil3ShkSjSZJ6WNvzVMCNPf+xv0eGO7PmjP561V4WCFzhWWawh8sxhHXMWtzlIqT/nmLMAIbB7J/Zc02wQJrjY93kf+VpCcXtmAhYF/pNuQC/bUHilYKN4pYY0fmfEL5A6sQzkLqtz0Zh1GFTu5LAK39pFVXdysStZO5zed+HkDkiknqwGNyXnYzkowKd7MtvhVkK6VC1cNSpS6jEVuacMOH3XN1P1cNq5/2ucjPK6fnUkdfijMCGH1YRBLXT0ixt5hB3NsfYr04Hg9FJnKy+7axwlHjdSIsq7wKS9MkACtthves7ECTLZuco3hfqSQc9T34fXCKNrHjGzN3I0HkqrRgPlltObp0CTNNCM/MD/9Vh/R5Vs6hYMoUqcO3TPku7EMQbbjDP8Q0k48wsrpHiKxh9dUX/ZDtsmAPwZLMICkSAsgx2vVBHMNAGN2mehzYToe8cYPz+nmcJ+lCHl7QrdhpvEvF18FWKuBp+/Zqjn7d4fMutUlq7iUvVUEonXJlCKiq6YlMejGp8W4edF4zWrhLP6+CigQat8aZlgy9kz/t7MkPl8BqSqsSw7pYfULA3rO9HnAm6V19lR6/SM/9/YCh8VLrKjaNBjFn9v6n+DfEzdeY0ifGw6I572im9j4WfwQxRpefsbSKNkq PJTnVtPj B3BK8VXNAmDrRkTdz65hocUCWAOg0kVhS3l9juwiYUQKY2PQ3Ll9BFGpqZxFCndIC5ezoiDYl9r/lQurc+syBYbx2wWfvZ8tZbxJLWz5J0LcbuY8D5QWLPqTovN0ae2vGsGr4lCcbl1kdws9mqIW2oByGNqVewl5ZTzbHorPi/3ID3Ex7hSu3rHusGrUS53sMULKwK5WUOguK+zTpfkX72iydDbjs2EBxzKkTbup5skXoHxBshAZL7/t/O1KGRe8bT96qsD3OqqBDPb5bfUQNNDKdMVdamA1rFSVSx/2Rj9MxGVSMK3eDPH+ZCilm/tpzkEbQ 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 Tue, Apr 15, 2025 at 04:16:28PM -0700, Davidlohr Bueso wrote: > Hello, > > This is a respin of the series[0] to address the sleep in atomic scenarios for > noref migration with large folios, introduced in: > > 3c20917120ce61 ("block/bdev: enable large folio support for large logical block sizes") Please resend based on vfs.fixes. > The main difference is that it removes the first patch and moves the fix (reducing > the i_private_lock critical region in the migration path) to the final patch, which > also introduces the new BH_Migrate flag. It also simplifies the locking scheme in > patch 1 to avoid folio trylocking in the atomic lookup cases. So essentially blocking > users will take the folio lock and hence wait for migration, and otherwise nonblocking > callers will bail the lookup if a noref migration is on-going. Blocking callers > will also benefit from potential performance gains by reducing contention on the > spinlock for bdev mappings. > > It is noteworthy that this series is probably too big for Linus' tree, so there are > two options: > > 1. Revert 3c20917120ce61, add this series + 3c20917120ce61 for next. Or, > 2. Cherry pick patch 7 as a fix for Linus' tree, and leave the rest for next. > But that could break lookup callers that have been deemed unfit to bail. > > Patch 1: carves a path for callers that can block to take the folio lock. > Patch 2: adds sleeping flavors to pagecache lookups, no users. > Patches 3-6: converts to the new call, where possible. > Patch 7: does the actual sleep in atomic fix. > > Thanks! > > [0] https://lore.kernel.org/all/20250410014945.2140781-1-mcgrof@kernel.org/ > > Davidlohr Bueso (7): > fs/buffer: split locking for pagecache lookups > fs/buffer: introduce sleeping flavors for pagecache lookups > fs/buffer: use sleeping version of __find_get_block() > fs/ocfs2: use sleeping version of __find_get_block() > fs/jbd2: use sleeping version of __find_get_block() > fs/ext4: use sleeping version of sb_find_get_block() > mm/migrate: fix sleep in atomic for large folios and buffer heads > > fs/buffer.c | 73 +++++++++++++++++++++++++++---------- > fs/ext4/ialloc.c | 3 +- > fs/ext4/mballoc.c | 3 +- > fs/jbd2/revoke.c | 15 +++++--- > fs/ocfs2/journal.c | 2 +- > include/linux/buffer_head.h | 9 +++++ > mm/migrate.c | 8 ++-- > 7 files changed, 82 insertions(+), 31 deletions(-) > > -- > 2.39.5 >