From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.121.94.185 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796308177; b=chuMy6bkjnaNv5+npbOTc2Ay6ueRPMDo8SFDwL3Qet2lPUjL6cofb16q8okLY1rY5v50 gKrTZfFBWjgaRpztPGJxI7mjuVxtwJUO4TBzf2dAxBIBBXqRmKoyrChiDMSZzlvy2pS9h LU9vrI6eKtnllopSyjyXVc46+VgDzadLRPtWRxCEy5StGgkIDdRNqPI9t/GgkoKxypQJs isTDthahE+pv8BQSr5q34kXtq3qFK4dsaiKm+SeDEhiNP8wne9rvvxDEQMem2XWmh0eYu MYr/64/pGUkjdWJE0PpgH5tVEzOYWon6brXAOfZ/JcN8vqOnw95rN6XSVNrbBd7mGmA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796308177; h=DMARC-Filter:X-KPN-MessageId:Received:Received:DKIM-Signature: X-KPN-MID:X-CMASSUN:X-KPN-VerifiedSender:Received:Date:From:To:Cc: Message-ID:In-Reply-To:References:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding:X-Priority:Importance:X-Originating-IP; bh=4JZpUbhFV2oZtFGs6K1c7dkiPSQaEql+gMWzesNCg+M=; b=QPpuL3wXoc/6WC+kZO7+7wYU3jNDs+6F1+nyBaJHxGJ03Vuwwoa2FlYfyTUfarR3NaMG PV3z2YgwGKHEExDbcvnUCVWUoWG+MN31SXqQk8JOhA7ItQorQDq/jKy0+nRSNz3HAesOv qy502uGbiw6lB6m/tND9NAe5ICG3SAfpw0Up2Y0UqLsnig4rLPdv6qWrxsI1YNj3lpqY6 lTjshgMALhMLtiDTl5ZynbvM+j8fgfbBF6/Y+eV+DKchCN+poiEBnvcgDi54tj5GgbLDx f95a5aoiyDbCM5kWxFIs4EiTqfZgGeBHiMMpFvqXgT/gt0n063yiBpuptx1Og/1jOEw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=xs4all.nl; spf=pass smtp.mailfrom=xs4all.nl; dkim=pass header.d=xs4all.nl header.i=@xs4all.nl header.a=rsa-sha256 header.s=xs4all01 header.b=RqbF3M1c; arc=none smtp.remote-ip=195.121.94.185 Received: from ewsoutbound.kpnmail.nl (ewsoutbound.kpnmail.nl [195.121.94.185]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 634C3606A334 for ; Thu, 3 Dec 2026 14:29:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 634C3606A334 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xs4all.nl Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xs4all.nl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=xs4all.nl header.i=@xs4all.nl header.a=rsa-sha256 header.s=xs4all01 header.b=RqbF3M1c X-KPN-MessageId: f1a6116f-ef25-11f1-964e-005056999439 Received: from mta.kpnmail.nl (unknown [10.31.161.190]) by ewsoutbound.so.kpn.org (Halon) with ESMTPS id f1a6116f-ef25-11f1-964e-005056999439; Thu, 03 Dec 2026 15:29:27 +0100 (CET) Received: from mtaoutbound.kpnmail.nl (unknown [10.128.135.189]) by mta.kpnmail.nl (Halon) with ESMTP id f1a5075e-ef25-11f1-92bc-0050569977a2; Thu, 03 Dec 2026 15:29:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=xs4all01; h=content-type:mime-version:subject:message-id:to:from:date; bh=4JZpUbhFV2oZtFGs6K1c7dkiPSQaEql+gMWzesNCg+M=; b=RqbF3M1cbOjLVf+BcPE4tXRpOgT7kEXD0ORXp68up3TneVuq0vvoZkSlsgCMSPRawPiBhACTxYVAM wkl8i0rPIAAy+UQhEl4oOJU3O3kPZ2KZrtCWr+WnNdcLJm/zPFH40XpLDBhE4V/v1qXDV5451Q9ns7 5v3BXHxm5pDtKCKD52eQTdoRSH1geZcNp5y4n+sDHj6elCg0DurFZSrA48ZhSyxxTQgGZleXal3ZlP tN+1ntEEFL953ZmZlAuQ5m4Err0dEehHlaNKkHRfR/WKQZdNgyyW1C4+QpKgH3w3m3V/rdPZIeVXLn n/4Xm4mqYuDw7W7JgvcqZdsHU6bwqcg== X-KPN-MID: 33|Mi+CFcabfW/QYAJrxovujNkgGYuVrXP5dnyU8+/+s+D1SSNs43eRxTpnPGBBYrL vC71prorfT7HMkwZ+iSJE91AQ/a1EMZp9sjThmTARo9g= X-CMASSUN: 33|HzGN8t9OgW81YyseV+tdakiCvUZ3d5ZGjcp8vcZ+h/XIN/SA9iKrPe5/K81qmfq FJubawInPOL606AyZFgCX4Q== X-KPN-VerifiedSender: Yes Received: from cpxoxapps-mh06 (cpxoxapps-mh06.personalcloud.so.kpn.org [10.128.135.212]) by mtaoutbound.kpnmail.nl (Halon) with ESMTPSA id f19a5849-ef25-11f1-acfd-00505699eff2; Thu, 03 Dec 2026 15:29:27 +0100 (CET) Date: Thu, 3 Dec 2026 15:29:27 +0100 (CET) From: Jori Koolstra To: Shakeel Butt , Christian Brauner Cc: Greg Kroah-Hartman , Tejun Heo , Ian Kent , "T . J . Mercier" , Meta kernel team , linux-fsdevel@vger.kernel.org, driver-core@lists.linux.dev, linux-kernel@vger.kernel.org Message-ID: <771874345.3709540.1796308167142@kpc.webmail.kpnmail.nl> In-Reply-To: <20261118220154.2965621-6-shakeel.butt@linux.dev> References: <20261118220154.2965621-1-shakeel.butt@linux.dev> <20261118220154.2965621-6-shakeel.butt@linux.dev> Subject: Re: [PATCH 5/6] kernfs: update a directory's times without kernfs_iattr_rwsem X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal > Op 18-11-2026 23:01 CET schreef Shakeel Butt : > > > kernfs_add_one() and __kernfs_remove() update the parent's ctime and > mtime under kernfs_iattr_rwsem for writing, inside kernfs_rwsem. This > is where cgroup mkdirs block on Meta fleet: the writer waits for every > path walk's permission check while it holds kernfs_rwsem and > cgroup_mutex. > > The lock keeps the times stable for getattr, now their only reader, and > a timespec64 is too wide for a single store. Give the three times a > seqlock instead. setattr takes it in addition to kernfs_iattr_rwsem, > adding or removing an entry takes only the seqlock, and getattr retries > if a write was in progress. Adding or removing an entry reads the clock > with the seqlock held, so updates store their times in the order they > happen. A racing stat() can see the new link count with the old times, > or the reverse. > > A directory without iattrs still skips the update. I know this is not a change in behavior, but what is the reason we start to care about the a/c/mtime only after we have done a setattr. I understand that kernfs wants to be very stingy on memory use, but why not leave it out all together then? Is there anything that needs those times only when the attrs are not default? Best, Jori.