From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8E3D26E179 for ; Fri, 14 Nov 2025 05:07:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763096863; cv=none; b=LObQXzsKcVOCA+wnQx0hU9/H57a+6h7M1RJCnpEOhEH6jvT0aLSO6g+fWhC5Epg3VL6QFeIHItCRv53XeHrEHxgfsNfpf5lqzkPfmJLxo4q7TVSVyOze7iT+RohnnQ7XIbCZzgC7M55t2rz2ugsHb+zljR5gfQ8BxYfX4yBuyqo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763096863; c=relaxed/simple; bh=PfYlbSnhkbQA76udjWHZBttEuBLcch9/E9x/Zjt8xyE=; h=From:To:Cc:Subject:In-Reply-To:Date:Message-ID:References; b=oThgMYUqaLDozrjlmkvlil459IHx0VgUBG9WyqPsc5/xsRZWHxkkDv/9WkmJHvBORS/S0yzpva2S8g2ZbayoFEZxqaA3Bly1MkmQfTDO5hn7roiO4txsMiK/fo+50aVBRoYo7W1zXoCrJpvs3WJprJpzM/9sY1MmS7nQR0dRAHo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GrQf2JM0; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GrQf2JM0" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-29808a9a96aso15279475ad.1 for ; Thu, 13 Nov 2025 21:07:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763096861; x=1763701661; darn=vger.kernel.org; h=references:message-id:date:in-reply-to:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=kc5SP3ZHaud5cAzsFrlPvf9GXnKWLDwtapilGbxVFYk=; b=GrQf2JM0zh8zw6Jr7ILa9BEPQx4LfTUvAE5+qXxKFDBMvsY56NxzIkrDrQ1kyFbAyr A27hb6EnySfASDkrx4ncV6BSuszpVSRlpJ4JaV6Bg5c+ZTvWTOONrtWjN+K9Wb4SHT9W wSICbWm7eY1f4SmkuB8M+b/SSLsf4vRX4qw45+J4GaOHzFPgTt1nqzAocm/5ocW2I3hz ZclpDE0ueni90R8yp7L7MvsujNEadJbL7Cldeqch8/KI5GH+Guy3Uz0Z54Tq3MtepuIh aW+X4TbFTmaWbqJMAMC596MSrT3HTeIswVE2WxLdHS6+wLJeIiUrtWfKrJ8lgm+WS02w ZIpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763096861; x=1763701661; h=references:message-id:date:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kc5SP3ZHaud5cAzsFrlPvf9GXnKWLDwtapilGbxVFYk=; b=IqKrnsjR6uthmP9Roh7vOzHyUwoe5joZbpWA0bv6qioDw6s2CcmmDRpRaA34/heqDY m5Rnc0cBdURkLhSu0o10BJsq4dTJAR/I+uALlkdze/npwdzZl2iOnshIiXaRnbfJOSZv XX5Jkxdoq5ZMTXqM3lRnfmfMYAaIEhvIDeSAp1fovhnxlDQdlIpyKf5FUUdE7ydLG5ps K5uexn9QW1AH4x9nU/Chxfh8NWYto1wFOv6eubPDHX5712Go/tA8vRNwJCeDYIE8DjQw aEWBKUAydrYFj2UkCZSKAclN846XqT65h+UIPTksmBkuIexHSAs2K1QLbWKVjZ46w4tM OXow== X-Forwarded-Encrypted: i=1; AJvYcCUCNvkAvb0PEmdfIyzv7+j9vagOsiYFiSHiSiIzMG2ke50MYmAAMQf256AN7f5QLfbGfLrVLtY2QQesZgg=@vger.kernel.org X-Gm-Message-State: AOJu0YzGgZ/kAohzqw23wZSzLKGnDEprJYwe4NtTG8NW9rdszm7AGzfo EGRPlf6hV6h9UyMPK9emJiaZm23Rt6qbt4Yk02AdoUW6CKfTXV6Upval X-Gm-Gg: ASbGnctD+TmVbZzVpTU9IfLb5UUxgAo9RLO1n1JqdDdnNsbfIKKMUEvPYIRmNUT+K55 SeGmhGElbifz0/E5+VgahjdgpBWbSzs6F/PgnTTm1sPVi2Y1E7zUdGkxa4Kk0yC/CuWtst6zOg1 gvT55D9t1mAVcn7GFpWLubMyUlxHmRMeWNScnPt66Q1K1Bl6sZQRPYiuvby52RoT5wyocaGU1Uo 2sSlQCiNU8sGlgN4BWzlxmZl2eNBBvGMIzZggPfQX1593IwMnjP+SiJOyLZtpgevu6eQdIdaXD5 QW97WwVNuaPviWM/pKxiV1tPip1SXgxP5QGODHrXXVcNBp8AB3jO1tZ02wCNvmgx8LSDXH8l1NE Tz4NCaiotw2QiH1cMLeVRflSQTuZXvwENCg4TJPfw5a8Y6CEm8PtFkETiTzLswxzTdOLoGoc= X-Google-Smtp-Source: AGHT+IEK285v1wC2XvzGikqccbF9tOIC6uZx3BccuaEpsjgYn5FPyTQAAYCs+R3hkEKMpO8EagDTJA== X-Received: by 2002:a17:902:ebcd:b0:294:f70d:5e33 with SMTP id d9443c01a7336-2986a6ba476mr19617915ad.12.1763096860963; Thu, 13 Nov 2025 21:07:40 -0800 (PST) Received: from dw-tp ([49.207.219.162]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7b9250d195fsm3835410b3a.18.2025.11.13.21.07.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Nov 2025 21:07:40 -0800 (PST) From: Ritesh Harjani (IBM) To: Matthew Wilcox , Ojaswin Mujoo Cc: Christian Brauner , djwong@kernel.org, john.g.garry@oracle.com, tytso@mit.edu, dchinner@redhat.com, hch@lst.de, linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, jack@suse.cz, nilay@linux.ibm.com, martin.petersen@oracle.com, rostedt@goodmis.org, axboe@kernel.dk, linux-block@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: Re: [RFC PATCH 2/8] mm: Add PG_atomic In-Reply-To: Date: Fri, 14 Nov 2025 10:30:09 +0530 Message-ID: <87ecq18azq.ritesh.list@gmail.com> References: <5f0a7c62a3c787f2011ada10abe3826a94f99e17.1762945505.git.ojaswin@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Matthew Wilcox writes: > On Wed, Nov 12, 2025 at 04:36:05PM +0530, Ojaswin Mujoo wrote: >> From: John Garry >> >> Add page flag PG_atomic, meaning that a folio needs to be written back >> atomically. This will be used by for handling RWF_ATOMIC buffered IO >> in upcoming patches. > > Page flags are a precious resource. I'm not thrilled about allocating one > to this rather niche usecase. Wouldn't this be more aptly a flag on the > address_space rather than the folio? ie if we're doing this kind of write > to a file, aren't most/all of the writes to the file going to be atomic? As of today the atomic writes functionality works on the per-write basis (given it's a per-write characteristic). So, we can have two types of dirty folios sitting in the page cache of an inode. Ones which were done using atomic buffered I/O flag (RWF_ATOMIC) and the other ones which were non-atomic writes. Hence a need of a folio flag to distinguish between the two writes. -ritesh