From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (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 6D1E341837E for ; Mon, 24 Aug 2026 12:37:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787575024; cv=none; b=LFzy2MUxfD2DEkySocLc0nAQlIxy5yauFI5sLJQWUs3NfG6AMN2iyozSJJbWW/1fEdKuUmvXGcAebukGFCgT0V7Q6whU+F/5iKddJCvtH3oWM8YyYBnr0NdPBPZg+VLoH15WqhYrAZNiYg23JC3rxJwQ2nnglEYBv45uJpJOPz4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787575024; c=relaxed/simple; bh=vMMjMInCck9yF8tkMjBlrSp6ScF2a084G6L/dqZn6ao=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kI+/TEReFdu1DJyuFfuNuiJ76hAbbzU1Hua4uniGA9xNRaP/zRLjHoeogkCxg6zqSU6DSMEQ5gFHk+2r1ZwfNNJNcYh8q+/QHgZtvRuClE16TtkTG6QIua/2sNZFA9uiZaUo96KZXG3Qtknb7mbSrQXMDvhCjsogZqOhw/KpxpA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=arczoRj/; arc=none smtp.client-ip=209.85.208.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="arczoRj/" Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-6a17211b9ecso8598347a12.2 for ; Mon, 24 Aug 2026 05:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1787575020; x=1788179820; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=86o2mla0Wt4YoV7NQUB6bfRSm8bpfsWlSQQ8/iZvyTQ=; b=arczoRj/jMWSEsCGnxDc8QgLgbHeY49YBrwFMJjF//o9YhC9w6uwlsNHXTo+oprOSx TuAVykOdEMNqTbKOFXt0lNVkPMQZ8cKj9++jUN0FRUzbbyh8OPzqvaZ1azFKg6eCxi3x r6i3nrGkrO5R3F2h31uS8i3Nw/WhoyXIsrck5ejsfng/uH4rOqDXtc6hohOEVtMsHrfn H/BIk/gn+alS+Yn/L+LA4igVEkNBtFwvCni/bQiQBEe7NJcPn7ws3I74k2sRVLcxCxXE QxeTx2RbH5V0n8vRo6jjldYRoyz1oqcR4iRXdQD0swOinXot8cqAUZlJRtAcnX2JL8jF r2oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787575020; x=1788179820; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=86o2mla0Wt4YoV7NQUB6bfRSm8bpfsWlSQQ8/iZvyTQ=; b=ETsevN8RZI0mq5qliw1AVD5b5xVvQ2Xa10qiD08cfQ8kyYoN+9lyZlIeWpfIAXWQEt SRipnse16MiKaeECSrP4zQpOzdh49lakgrm4LP/PEdl+kM7Mc5ZzavKaSyjBBEMKntUo QqoVW7/OAlSh6oUwJyTKkINYcMbnC2fSjJi/8a28Q6TafYT3jgOxuV/2Og+g+RpAus2a B45JLC+PmMZ7z8qDpK8VcO/O7vNcgt73UNYkFJ3bLYXEW3RCtTSujJINUz6mwvwt6GZH mHVaLMYrKiM4Tk5FwM3ElYDWlujXgJaP31SY36Az5CB2brsTHHiF7BeJEbPTDLLWu4EG VxYw== X-Forwarded-Encrypted: i=1; AHgh+RprDyfEgDy0QZJaGAhkoAQwYQYWltwVX2oW01mQetjIjC1g0X+vrap7iBq+jgSQvexjJ5ehLADTQL1mkJA=@vger.kernel.org X-Gm-Message-State: AFuF++lX/a4MQC7yEwEP9z6KQgZqQuqxlEPtzXLQ4sNbF6ahV6hdj51i ZBC5W67p1H1rexH2wh9smDZ0vSqaTm92QCQUd9EASRUykjPn5AmhvlUBzGlyC1YT3NA= X-Gm-Gg: AR+sD12ESWQ/Rb+ofjtJEPR/cptAbAVjtaqru4+/+5n4KGyOR9HO0DFuqc2TtfPqzCH AfDzg7+eiZsMc7BSU7mWCbXkPVuiOkRtaMWp2WWkM8mAwDVChJ7rs59KwBfI2XKAgsuz1UedVTn lYnqELrvS2xHlsmaofFv2JnWP3FUTGt66f40dy2OOQ3ftDINqW5ln6fSZ4fEsCdnMRoAW3mGHS3 xAvavf+ux9h1WDefq+S5lb8ThbfjxD7wU+4uSY8zk/QwmL1ylOPo8xSAmZh1v+Vu/ydqxs/R4Vg E3K2YOXs7StT+yo4EHRxiIEjiYym5k06pkZzyy2UFaJ8lz+x13YAYYVOm5eW5IHSRWoQejIdApZ tZlCQdcJUeNnCDDtjL/ik7Gr4Idea2+7/R3IAdKaNdrw443Dx4X8CFclhti74qNvCEZ/omtpPb/ HqTFt1UW5U3kO75qhuMjPwxxVZWw4UP82KSIJsntSOUbI9H+o8DQiQn1bZk0ekxDw= X-Received: by 2002:a05:6402:52d5:b0:6a0:a644:355e with SMTP id 4fb4d7f45d1cf-6a42f1848fdmr30356559a12.2.1787575020160; Mon, 24 Aug 2026 05:37:00 -0700 (PDT) Received: from localhost.localdomain ([2001:af0:8000:1409:193:86:92:181]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6a5ba19e053sm2079673a12.12.2026.08.24.05.36.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2026 05:36:59 -0700 (PDT) Date: Mon, 24 Aug 2026 14:36:57 +0200 From: Michal =?utf-8?Q?Koutn=C3=BD?= To: Wilson Felipe Pereira Cc: Andrew Morton , Johannes Weiner , Yosry Ahmed , Nhat Pham , Chengming Zhou , Tejun Heo , Shuah Khan , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] selftests/cgroup: test_zswap: wait for cgroup to unpopulate in test_zswap_writeback Message-ID: References: <20260824033533.2147900-1-wfelipe@google.com> <20260824033533.2147900-2-wfelipe@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lsaln24baban35xn" Content-Disposition: inline In-Reply-To: <20260824033533.2147900-2-wfelipe@google.com> --lsaln24baban35xn Content-Type: text/plain; protected-headers=v1; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v2 1/2] selftests/cgroup: test_zswap: wait for cgroup to unpopulate in test_zswap_writeback MIME-Version: 1.0 On Mon, Aug 24, 2026 at 03:33:57AM +0000, Wilson Felipe Pereira wrote: > When running test_zswap on a single-core VM (-smp 1) with 4GB of RAM, > test_zswap_writeback intermittently fails on the initial run after boot. >=20 > In test_zswap_writeback(), after waitpid() reaps the child process created > by test_zswap_writeback_one(), writing "+memory" to cgroup.subtree_control > can fail with -EBUSY. Under cgroup v2, enabling domain subtree controllers > is forbidden while any tasks remain in cgroup.procs. >=20 > When a child process exits, exit_notify() wakes the parent process, > allowing waitpid() to return immediately. However, the cgroup populated > task count (nr_populated_csets) is only decremented when the exiting > task is switched away via finish_task_switch() -> cgroup_task_dead(). On > single-core systems, the parent runs before the dead child has been > switched out, causing "+memory" to fail with -EBUSY if written immediately > after waitpid() returns. >=20 > Fix this by waiting for cgroup.events to report "populated 0\n" via > cg_read_strcmp_wait() before enabling subtree control. >=20 > Signed-off-by: Wilson Felipe Pereira > --- > tools/testing/selftests/cgroup/test_zswap.c | 2 ++ > 1 file changed, 2 insertions(+) Acked-by: Michal Koutn=FD --lsaln24baban35xn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJEEABYKADkWIQRCE24Fn/AcRjnLivR+PQLnlNv4CAUCaow65hsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDIACgkQfj0C55Tb+Ai0QAD9GkXMc6bI0AhzKJwbSaqE aI4XwcIv1S0SkdLiNbkxuPMA/3XaRn1ZHXQ5i2Jrq1+ppT0VNUvfWl9IlFN0Wc/x KzEA =DvGz -----END PGP SIGNATURE----- --lsaln24baban35xn--