From nobody Sat Jul 25 00:11:02 2026 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 383FB46EC68 for ; Tue, 21 Jul 2026 19:04:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784660658; cv=none; b=hI5rx5UpnZIjwH/lIrPnvcDOuJVRwp87EbOZlq44LXKs57KPbQMpS3v3tWOklpztaLnjriH28rg0KlxQEgHcLJAohooZuhy/3Ap7rRNQKNWGLQZrg2JtQ45w+f6BUIEO6rggGMdEKsMTL/uohTQR8Olrf4LOAbBxgo1/1zxWZes= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784660658; c=relaxed/simple; bh=Z4eZUu12mKAhhr7fFGJH/XFiozz/hMXcfASu5IYDxqg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MLM/uvPAbMt6/qthi139vqHTtp5k/AVfInQspfEY4/YhzNEWAskNo4NsxSFOrCKuUikmt52TLqtFuZ7NOQ8FsoeYQ68ySLCSXr0KC5aIOAynv3iQ3Aj9i0Po7d4A5VXjB/QJu3cEKJDycLh8R6F9iRSRwW59/lm0DolbC1oxO2M= 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=WFRHNpjC; arc=none smtp.client-ip=209.85.218.43 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="WFRHNpjC" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-c1c24ec9525so151433966b.1 for ; Tue, 21 Jul 2026 12:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784660655; x=1785265455; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=+JqNpnriZg+duzi2qkjlrmcfUYuT9EqwRHf7/xL8TkI=; b=WFRHNpjC0G1PZD+Zhd4hXx4FuOjkMogKX9SR0aqXmxPFYDrd/6gb5LeG8J+oIK8zOo ztceWjR/3A1mkCn0eEg/BK3nq5/kv+cfA1AHdkS00KhzNjvZk2vIU871/4nsIXwl1yUS eJjHXUvr9B1mf5ZagWZnva9h43PdpyDfb3kFPpS7ocz4Sx3lDfePJmKWpp+5poP6z2Dc N5MG+qiGoGiPYZeTZjxDBcU+rqSaM8lxoX9pCPfiRBKghfdF1V93RiJqXNP449KBR8jL EeBnxtnbu7yIkOV4F0X4gawxxd07ScX3yEdj/JqgMytP64l2X90TGcvTaq7Z+04tQ4SL K8Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784660655; x=1785265455; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=+JqNpnriZg+duzi2qkjlrmcfUYuT9EqwRHf7/xL8TkI=; b=OhrbF7df+jvDQFdC03SCgHWfSGTEga7rRkrIAMaxpEzLV0h8Mid5ieOlieLKxx/XGp CMq/57o75wRELPzOkawioN1JYbJdI9D8PYW4bVVR06KHQyqTOQ3fUD9io/UcBjOdCVZJ cuB5AYsHBdzjRHWA6jni8JB978UCeQxokBK70e+8TdSwjojpYt8NL/GvQhfhA7kqSXXY viP2IJLtUpRsnxEQjyZGjABqWBWoGaB3jwYL0tpPlFcaf0bd5+ke21zXwgXPDNA1hzlE BAOJe9qTKiVBAOIeS4afixyKjLl27QG+YQQg2v+WG2AWjff4DHUGMtcWeNGGCa/FZo7o sjEA== X-Forwarded-Encrypted: i=1; AHgh+RpZYblqHoxkWOHpm9fg6gnQS67/LOHTpRPC+zmIYqyNr6uH45MlBjaVCBRirT7P/fdKx5V0DCqIKWcQdw4=@vger.kernel.org X-Gm-Message-State: AOJu0YyY1qjLj918qOC9xMFng65qBkTZnJmsIWQSmipZYmq5+VF8EwNe wVVc3D5VKOO2mDSMZ+UtQh/oPQt04yytCQbMBQ5g6/IeXDo/wY6G7Hnb X-Gm-Gg: AR+sD101MguwgHxy+Qvb1kwm0Afe82NW2vy0b8zxqAtLq6DIoA/LhTkHpforrZhcUQ8 2WNwMs8blLiHaAqV6My1jhN8jc1qxHRmq9TuNvTQVmiL72Ajxsd4RilPQiWXulbMBkP+lbxv66y qjNc+GFd574jGYmhSdct+YcjnCzlHhdv3fDYpKmlDjqKUW4ZCa2DCQdsh3jsJLX1BPQgpm7sk4P uHFJzBAZEiOyNo3Whw5E2D/CgjvUzxmtVA0yvEw1TKdktktyllCq0FV0dBO5RkoI3BtA0Hygrgi UMixtDxGdWy+S20XzMso1UiPqnyc2uGkOmVJchZNfAT55ekdVA+oNeAQX9yqc9ezr5XKxInJtjW LvIB8wWAJpDHakPnaMKs1vEYP7dUovejM/9rUFKSyrUdweqPn4PJBLefdLFm1OVVgiRZLzm0DR+ G000rFLQ/HY5oIv3lAtzmbWqataeNG9l3jqqUlzFF/3xt23/MiGtyJJb0M0YWfZACdTMhwgJhAm Dzh X-Received: by 2002:a17:907:3d45:b0:c16:1901:6ba1 with SMTP id a640c23a62f3a-c16b47c50b7mr857110866b.34.1784660655267; Tue, 21 Jul 2026 12:04:15 -0700 (PDT) Received: from misharu.home (2a02-a463-a071-0-1315-eb9e-fdea-db07.fixed6.kpn.net. [2a02:a463:a071:0:1315:eb9e:fdea:db07]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c1c32ebad78sm8903366b.46.2026.07.21.12.04.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 12:04:14 -0700 (PDT) From: Hari Mishal To: SJ Park , Shuah Khan Cc: Greg Kroah-Hartman , Hari Mishal , damon@lists.linux.dev, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests/damon/sysfs.py: clean up sh processes used for obsolete_target test Date: Tue, 21 Jul 2026 21:04:04 +0200 Message-ID: <20260721190404.135937-1-harimishal1@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The obsolete_target test spawns three sh processes and uses their pids as DAMON monitoring targets. These processes are created without their own stdin, so they inherit the test program's stdin, and they are never waited on or told to exit. As a result, they are left running (or become zombies) as orphaned children after the test program exits. Give each sh process its own dedicated stdin pipe instead of inheriting the test program's, and after the targets are no longer needed, communicate() with each process to close its stdin. This sends EOF to the shell, which makes it exit, and communicate() then reaps the process. Signed-off-by: Hari Mishal --- tools/testing/selftests/damon/sysfs.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/damon/sysfs.py b/tools/testing/selftes= ts/damon/sysfs.py index aa03a1187489..d3d50a5a1d56 100755 --- a/tools/testing/selftests/damon/sysfs.py +++ b/tools/testing/selftests/damon/sysfs.py @@ -328,11 +328,14 @@ def main(): kdamonds.stop() =20 # test obsolete_target. - proc1 =3D subprocess.Popen(['sh'], stdout=3Dsubprocess.PIPE, + proc1 =3D subprocess.Popen(['sh'], stdin=3Dsubprocess.PIPE, + stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE) - proc2 =3D subprocess.Popen(['sh'], stdout=3Dsubprocess.PIPE, + proc2 =3D subprocess.Popen(['sh'], stdin=3Dsubprocess.PIPE, + stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE) - proc3 =3D subprocess.Popen(['sh'], stdout=3Dsubprocess.PIPE, + proc3 =3D subprocess.Popen(['sh'], stdin=3Dsubprocess.PIPE, + stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE) kdamonds =3D _damon_sysfs.Kdamonds( [_damon_sysfs.Kdamond( @@ -356,5 +359,8 @@ def main(): assert_ctxs_committed(kdamonds) kdamonds.stop() =20 + for proc in (proc1, proc2, proc3): + proc.communicate() + if __name__ =3D=3D '__main__': main() --=20 2.43.0