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 88710E77180 for ; Thu, 12 Dec 2024 15:51:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 190026B008C; Thu, 12 Dec 2024 10:51:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 13F156B0092; Thu, 12 Dec 2024 10:51:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F219D6B0093; Thu, 12 Dec 2024 10:51:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id D545E6B008C for ; Thu, 12 Dec 2024 10:51:22 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 8EC30140126 for ; Thu, 12 Dec 2024 15:51:22 +0000 (UTC) X-FDA: 82886745438.25.8A450FE Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by imf02.hostedemail.com (Postfix) with ESMTP id B755F80021 for ; Thu, 12 Dec 2024 15:50:33 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=OiNusV2U; dmarc=none; spf=pass (imf02.hostedemail.com: domain of axboe@kernel.dk designates 209.85.166.50 as permitted sender) smtp.mailfrom=axboe@kernel.dk ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734018657; a=rsa-sha256; cv=none; b=u2hvnntGobpaeQv0KkUXDyc13nP/x3+nfnoHWWk76eaQzfgKN4z6v2oAsk0eNh0p5XK9wo eQe1aznEdpQsc9JAqGwJSeajBLEr3ucTPFs1hf0X11XF/FnElPxnvWCFYkanRXyZbhUzfb vpVpTwFDQYpc3e0uIobJ6U1Q3Ygbb9Q= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=OiNusV2U; dmarc=none; spf=pass (imf02.hostedemail.com: domain of axboe@kernel.dk designates 209.85.166.50 as permitted sender) smtp.mailfrom=axboe@kernel.dk ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734018657; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=uvdjuc+ov0Ox3XKRZz9jrd61LllD+9QFwqPFhdFIKF0=; b=jMMKw65RuvyNBUePdmAx3bRx7OacTwHdy8ZxGoyvhWG1XcSyTe1tOnd9kw9eNkfcMASXSq 8O2zcsOCuEZXFBC6aKbIcIS0paDbu9GoGSWRbFBG1MrRQuaXRsNo4o1kJRtjGdPJal9H8m qfQyjMsLj3m+pnzYLncEwnT77kAtja0= Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-844c825ab4cso22053839f.2 for ; Thu, 12 Dec 2024 07:51:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1734018679; x=1734623479; darn=kvack.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=uvdjuc+ov0Ox3XKRZz9jrd61LllD+9QFwqPFhdFIKF0=; b=OiNusV2UMSak4ateH46TsoP7GgyTBUr9ExkRdjfnHQfsni/wQHOmHo4VL95YlTJMK4 +Z6DJwTkzeVcf/eLFCP0Ov3OIRuotvUwVJqH2D1KLidDKOfqHyNKESx4Eu5SzRSzUPIk dLjwtfnRO774sHeV0/YVGVcbLNCaY8r1Qiz9hkaXm0aeEkT10HW8IQNdAbvZ5TUf3QNn 9PZiJhhC9itr85J+6ewwKjSVLxn9tnqrC+hl3WyZlSZMSBXIgWaslKNKgJTZCDhRK5NC ggZCX5sZ8snn2ibqmQRlSPv0oeBwhTbNpuORltBjOhdzbk2OA3pGrk7GLmratbKqlFg7 9xkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734018679; x=1734623479; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uvdjuc+ov0Ox3XKRZz9jrd61LllD+9QFwqPFhdFIKF0=; b=WjybMJQDq1aUa4xSOD+nt1ihJcB7A5SyXTjXYlwhWA1clwScVf0kAqveGq+UIBebTR rqtDW8kGlqQCxtuAF3gjCq1KydkRXWPthv15WuHbSf5aaadMpARONohSM2dM7pbtELgT VrCkTF0wo4LcRrsCJbVQoSBcsA0S3lIu9VsOXcf1muHBHoyopTjVWCSLsP8WV5F8iZF1 SaD2P87ILA7MFlmBZCz8+teHJsVdhBKNNHHXJG248dC1JyPTH0kJzGnxUCFZUtsor4+A wb17QBuBp/fQNbQIZoKGrAp3hrD4PvwYbDQucVOnbTw4e128BXMjhhzQz9JVNNhb9tVY ebhw== X-Forwarded-Encrypted: i=1; AJvYcCVzXpcQruqaLnl2rz04O1aJQdhlnsWw76xzqNSsW0FLSkqTjOmNpX7BU1SgTDfiNM5KmW/+wIUdNw==@kvack.org X-Gm-Message-State: AOJu0YxUYg2B4w+OMMMsNwuBa5muRlC2h345yCzelXBN0qf/q/SHiZYh UXfawlTMAvhoniChgJCtku1asCVztDDJw3x0O9XXK8NzHD3FkgK4yNU7t+1DBHp2nnai7bDv9YE c X-Gm-Gg: ASbGncsD5iitO3VWewY5wMNi3zxAIZSJ2Zcb69qMzTgHgWFf1BfaBxhYAQjR1PF4xlI +rEenmfKIB7mWkP/kywKarmjMjjmtexQuFrsDLBy92lY+jQG4JhMvB46DXWooYj72x1WFQNfh94 jiqYRrt5Bi1ScLuzh6UjU2AaQRWAIYbn64nxC66zLdMXym6uIvVTaoaKoLzJazNwlbB3HG6sbZ4 Q6Y0n4fYmAN7RXN6+OKxoIau4yicbRX09wr60dyI7iAtgN69C6d X-Google-Smtp-Source: AGHT+IGuinfFR09bO8lUOpxQ1zSi+sA0KfqYwuqKm9s7gPVryn5wyMJJDgrJmONT7vL8CQbH+cZ8kQ== X-Received: by 2002:a05:6602:6d0c:b0:843:e008:95b7 with SMTP id ca18e2360f4ac-844e552b920mr79385139f.0.1734018679383; Thu, 12 Dec 2024 07:51:19 -0800 (PST) Received: from [192.168.1.116] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4e286222d9dsm3865412173.148.2024.12.12.07.51.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Dec 2024 07:51:18 -0800 (PST) Message-ID: Date: Thu, 12 Dec 2024 08:51:18 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 11/12] mm/filemap: make buffered writes work with RWF_UNCACHED To: Christoph Hellwig Cc: "Darrick J. Wong" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, hannes@cmpxchg.org, clm@meta.com, linux-kernel@vger.kernel.org, willy@infradead.org, kirill@shutemov.name, bfoster@redhat.com References: <20241203153232.92224-2-axboe@kernel.dk> <20241203153232.92224-13-axboe@kernel.dk> <20241206171740.GD7820@frogsfrogsfrogs> <39033717-2f6b-47ca-8288-3e9375d957cb@kernel.dk> From: Jens Axboe Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Stat-Signature: kxf5frmyu45rejz96qri15pfntoxa9xi X-Rspam-User: X-Rspamd-Queue-Id: B755F80021 X-Rspamd-Server: rspam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hOHbpm49j4Cq2Ib0Iim51gSSIHYzg2Rqh8baNJaIUq51P+6ahQXAhGX9RXW9nafosrc8vTzspj/Nbb2N6tskRAN7wUDvHnuQ3p2xRDydcl7djZUg2IMfJ4O5unynCmRU2EXokI7a1nhBfzxn9AcMooiAeBijoxbTz2n+Tp5eBmWF2NGhVL1y9fBLK5AfHwDQXwi+1TE1Ya9uUSfZr7myeYABqD9X+h/sG5PpQcuDzs5CQNJ1KVPOs0duDIma/Qn6eHb59lDZ72uAWpXY+JfDml/UXyHlYK3vkSaZwBl/qBsatJwsBQxrGJrn/4S4DEbV0dAc1QbGfFJU/I/GYA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.016142, 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 12/10/24 4:31 AM, Christoph Hellwig wrote: > On Fri, Dec 06, 2024 at 11:22:55AM -0700, Jens Axboe wrote: >>> Honestly, I'm not a fan of foliop_uncached or foliop_is_uncached. >> >> It definitely is what I would elegantly refer to as somewhat of a >> hack... But it's not _that_ bad imho. > > It's pretty horrible actually. Tell us how you really feel :-) >>> I think these two macros are only used for ext4 (or really, !iomap) >>> support, right? And that's only to avoid messing with ->write_begin? >> >> Indeed, ideally we'd change ->write_begin() instead. And that probably >> should still be done, I just did not want to deal with that nightmare in >> terms of managing the patchset. And honestly I think it'd be OK to defer >> that part until ->write_begin() needs to be changed for other reasons, >> it's a lot of churn just for this particular thing and dealing with the >> magic pointer value (at least to me) is liveable. > > ->write_begin() really should just go away, it is a horrible interface. > Note that in that past it actually had a flags argument, but that got > killed a while ago. > >>> What if you dropped ext4 support instead? :D >> >> Hah, yes obviously that'd be a solution, then I'd need to drop btrfs as >> well. And I would kind of prefer not doing that ;-) > > Btrfs doesn't need it. In fact the code would be cleaner and do less > work with out, see the patch below. And for ext4 there already is an > iomap conversion patch series on the list that just needs more review, > so skipping it here and growing the uncached support through that sounds > sensible. I can certainly defer the ext4 series if the below sorts out btrfs, if that iomap conversion series is making progress. Don't have an issue slotting behind that. I'll check and test your btrfs tweak, thanks! -- Jens Axboe