From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 063D329994B for ; Mon, 16 Feb 2026 16:21:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771258877; cv=none; b=ibJ4Jmm/FX6I+1UM0/eLqw67beXJMS4KUZBc5LmRy81Eif74FrH5d4aO1sJx22IzZRX1Qxv5YqboU+9zo0IdAz242wv/snWExr+B0o4gc4d7+p48kPJh6crCs/QnU383Nyk4mkZHNKo5/n2Nu1YwNRDB94n5sxuYW3WSXZmO7Ss= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771258877; c=relaxed/simple; bh=vXPwT/SWHN0vRTO+ghXErJHF9bFSJOc15B0GoDaOvpI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RdCzDtNPwuU3ZZXfSl7MAtUDQar+zxjPcKT7W9CQNeQ9ZrQUFiKQn63OQh286HQ3HRJ8pHQFCJeQZfRThW4XQttqiguBR6oAOtzecZ7PyMaQ+lUgo/I2ptQqNfFxlbNR9UwecgpjjvGzXQn8PNqCsje+ZB7lMh2lM0cpfotQ1N4= 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=KiyBTLVz; arc=none smtp.client-ip=209.85.221.42 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="KiyBTLVz" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-4359108fd24so2308159f8f.2 for ; Mon, 16 Feb 2026 08:21:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771258873; x=1771863673; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ScvhChnO4StcvknG4EO4W1y203NmQMeHjxbNv7iKKOc=; b=KiyBTLVzInkMAi/CTTsBXzdtQM5xQ8uoQ1/gZGO7ei8wx1zqB9/N8cXp9hJOhprJ1v bjP6qMPFcbP7ISs8U64ErDBG6PjP7jIxOKxsedNWU/yx9vtnibr+Jd7om+PAle3595rx jx/DrLDtRajQ5a9Has6ZIpY1KBT2goL0XUaFAT8cSRiLfxyIgwzD2GxHMO7a/BzATUj9 spTx73ENgAkWjR8dUD/FjPIeQCv0E3lLdqAFPZXo8FV3n1r68I9QxTWSMzAMBIvjgvWp GbMilKWU98AWOTl4uJYn8lQZTMT+mqNTCXxFKE33UmsrM++k1iY/S9gLp/+wtQzn55iZ 2+kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771258873; x=1771863673; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ScvhChnO4StcvknG4EO4W1y203NmQMeHjxbNv7iKKOc=; b=sTFDvLqMvIw/TyfARXDysWS+1ZLnFpFPtV1zT2lhaT3tMcoVNYQKxBihlzAzaJXaz4 aj4fEM/33L4eAb55G5946mY9rTea9HUqZyTZ/zmDTrFDdY/WO5/Py9ajKetFQa5wuDeU FpJscDsH5eMaonI6fU8rRRKZPsBN2ajskNxSZTrz/ag6BFrKDX49ZuwTasYZaqy4jTLr TjCYD5jtxUxGU6K+QIXlwYpG9nqlRhDR2KfSeY+W5CTqbVLCYNLmdZxNZQSCaItfILVT DZlpQcVFW4JT9zzw/C5rpex2nqUgysfZZ/dtooR9cJz/g5LS3Yypi4mm6E0edYGA3R8J TudQ== X-Forwarded-Encrypted: i=1; AJvYcCUSrBVaWPNBaaKOgcNqFC6P7K0WnYGdDEiirr6ZR7rWgTuMZgbgO7Xml2pJ2yU11GsBz93ewhPjL3USX8I=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3N//115XVILt6OOfki6offY2KCoZB/m4HEoAUkrLTZ8AvwPbJ PFkrFbpctNOlegrRKmYKlEVLrYoRFlfJ7nmju0QYhRMXtpPLzFZsPAqh X-Gm-Gg: AZuq6aJXh32D37aLHIPN81cP7ER1wkr0osD90sPH9e1R08l8XXzXRZNmLvDAZ/mHBAo /GDbOfj8QItHhczMSdh71ZBFqP3mes24y6P0Fz6Su0nKE6gRDrk3eC8rfDFJldkqkMnRcVwDAfu Qd8EwBRb82T4+8GeDru/Rd8OedwIF85iKtwCmrdj+BTkCwD1H8DZYrIRNFEcGfb6LKtvaN85F6N Y15Ng8HiEO65KhAAFjxtYQGWXinJz40Ww9sNHf7aaD26tI+ND1DX/7dsuO6GZnoehSxTrdMSZy9 4AVYSsM9rUdMs2PnroVSfsi8zG3DSXl9zRVxPEF3hGNGpkZVC4o75HROLO2/WXzXscSN6I/x+U5 H1veZWkhK9gTl2gCfPrHhDptV7ctZgkthJpAPI0/ipIly0iH1XEm2Qbd5HM9Sick7bhnCGK/OvT vZ+CPItJZMMq8SK5D/h9TVK+q05iE5qLfseb03tW18ETV7a0BZdLVXKkCQ X-Received: by 2002:a05:600c:8b32:b0:46e:32dd:1b1a with SMTP id 5b1f17b1804b1-483739fc64fmr193175955e9.7.1771258873226; Mon, 16 Feb 2026 08:21:13 -0800 (PST) Received: from localhost (bzq-166-168-31-253.red.bezeqint.net. [31.168.166.253]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4836cd7af87sm321885895e9.1.2026.02.16.08.21.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Feb 2026 08:21:12 -0800 (PST) Date: Mon, 16 Feb 2026 18:21:11 +0200 From: Amir Goldstein To: "T.J. Mercier" Cc: gregkh@linuxfoundation.org, tj@kernel.org, driver-core@lists.linux.dev, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jan Kara , shuah@kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v2 0/3] kernfs: Add inotify IN_DELETE_SELF, IN_IGNORED support for files Message-ID: References: <20260212215814.629709-1-tjmercier@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260212215814.629709-1-tjmercier@google.com> On Thu, Feb 12, 2026 at 01:58:11PM -0800, T.J. Mercier wrote: > This series adds support for IN_DELETE_SELF and IN_IGNORED inotify > events to kernfs files. > > Currently, kernfs (used by cgroup and others) supports IN_MODIFY events > but fails to notify watchers when the file is removed (e.g. during > cgroup destruction). This forces userspace monitors to maintain resource > intensive side-channels like pidfds, procfs polling, or redundant > directory watches to detect when a cgroup dies and a watched file is > removed. > > By generating IN_DELETE_SELF events on destruction, we allow watchers to > rely on a single watch descriptor for the entire lifecycle of the > monitored file, reducing resource usage (file descriptors, CPU cycles) > and complexity in userspace. > > The series is structured as follows: > Patch 1 refactors kernfs_elem_attr to support arbitrary event types. > Patch 2 implements the logic to generate DELETE_SELF and IGNORED events > on file removal. > Patch 3 adds selftests to verify the new behavior. > > --- > Changes in v2: > Remove unused variables from new selftests per kernel test robot > Fix kernfs_type argument per Tejun > Inline checks for FS_MODIFY, FS_DELETE in kernfs_notify_workfn per Tejun > > T.J. Mercier (3): > kernfs: allow passing fsnotify event types > kernfs: send IN_DELETE_SELF and IN_IGNORED on file deletion > selftests: memcg: Add tests IN_DELETE_SELF and IN_IGNORED on > memory.events > > fs/kernfs/dir.c | 21 +++ > fs/kernfs/file.c | 20 ++- > fs/kernfs/kernfs-internal.h | 3 + > include/linux/kernfs.h | 1 + > .../selftests/cgroup/test_memcontrol.c | 122 ++++++++++++++++++ > 5 files changed, 161 insertions(+), 6 deletions(-) > > > base-commit: ba268514ea14b44570030e8ed2aef92a38679e85 > -- > 2.53.0.273.g2a3d683680-goog > In future posts, please CC inotify patches to fsdevel and inotify maintainers. Thanks, Amir.