From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3D98392C26 for ; Thu, 19 Mar 2026 17:38:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773941942; cv=none; b=gq5bBqo6gU8JyCBOkILcsLAYrNegsDBCrL5QaAGFEcfZ8YQcNdllRdpCYkNDPsk3ChKirlyowF6JSzXTkBiqo+O6PDj3LN55L+BW5dwwb+M8gsYhWXqEWCRJKtl8j9nlT2FMIJx5Ob5shxBrzZazSbgeIhHG9G04TmLrP0bG7OY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773941942; c=relaxed/simple; bh=NxL4EPN9Ba+XKIC2o5o6oDG5HiOcSSMFcUWcSwWrObo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VNmGHB9EOlgrFs2KP0GGJ2SPabyd1ZC/iokiO3GquU/qK+9MQ//xTUBgZAX1tf0G+gGfGm43GC3dvLKnX3/aabNmVp6LVC3f9PzPs5dEvwtIgwsiocB0tgTQOah2LG5qmEAzepezNJz4yfgHZ2exdBFS3+ZBq5Vauzvkk0O5FYA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=DpK8v5S6; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DpK8v5S6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773941935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=GolfCpcwvGX7ESq6QSakQqV8SX3HQ4CiS3Tfxd8agvs=; b=DpK8v5S69kWzbtsi2l4t2+0oowGcbVE1aXEHLg0Rr6/JbhRpgm6ihlF+1M88HLQbijiBZc faBCGeijqZjyl1JM/n5v+hG246mK8Q15YqDXMts4uj5O6KZellEGFUVGkLKcJAY5KXxhBq dl9TMWaVkXyurPOZR7nZbcd26yG8Iww= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-389-oho6wAX6O5KCaQuvtplSuQ-1; Thu, 19 Mar 2026 13:38:51 -0400 X-MC-Unique: oho6wAX6O5KCaQuvtplSuQ-1 X-Mimecast-MFC-AGG-ID: oho6wAX6O5KCaQuvtplSuQ_1773941929 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6B87518002CB; Thu, 19 Mar 2026 17:38:48 +0000 (UTC) Received: from llong-thinkpadp16vgen1.westford.csb (unknown [10.22.80.194]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EA7F430001A1; Thu, 19 Mar 2026 17:38:43 +0000 (UTC) From: Waiman Long To: Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Tejun Heo , =?UTF-8?q?Michal=20Koutn=C3=BD?= , Shuah Khan , Mike Rapoport Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, Sean Christopherson , James Houghton , Sebastian Chlad , Guopeng Zhang , Li Wang , Waiman Long Subject: [PATCH 0/7] selftests: memcg: Fix test_memcontrol test failures with large page sizes Date: Thu, 19 Mar 2026 13:37:45 -0400 Message-ID: <20260319173752.1472864-1-longman@redhat.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 There are a number of test failures with the running of the test_memcontrol selftest on a 128-core arm64 system on kernels with 4k/16k/64k page sizes. This patch series makes some minor changes to the kernel and the test_memcontrol selftest to address these failures. The first kernel patch scales the memcg vmstats flush threshold logarithmetically instead of linearly with the total number of CPUs. The second kernel patch scale down MEMCG_CHARGE_BATCH with increases in page size. These 2 patches help to reduce the discrepancies between the reported usage data with the real ones. The next 5 test_memcontrol selftest patches adjust the testing code to greatly reduce the chance that it will report failure, though some occasional failures is still possible. To verify the changes, the test_memcontrol selftest was run 100 times each on a 128-core arm64 system on kernels with 4k/16k/64k page sizes. No failure was observed other than some failures of the test_memcg_reclaim test when running on a 16k page size kernel. The reclaim_until() call failed because of the unexpected over-reclaim of memory. This will need a further look but it happens with the 16k page size kernel only and I don't have a production ready kernel config file to use in buildinig this 16k page size kernel. The new test_memcontrol selftest and kernel were also run on a 96-core x86 system to make sure there was no regression. Waiman Long (7): memcg: Scale up vmstats flush threshold with log2(nums_possible_cpus) memcg: Scale down MEMCG_CHARGE_BATCH with increase in PAGE_SIZE selftests: memcg: Iterate pages based on the actual page size selftests: memcg: Increase error tolerance in accordance with page size selftests: memcg: Reduce the expected swap.peak with larger page size selftests: memcg: Don't call reclaim_until() if already in target selftests: memcg: Treat failure for zeroing sock in test_memcg_sock as XFAIL include/linux/memcontrol.h | 8 +- mm/memcontrol.c | 17 ++-- .../cgroup/lib/include/cgroup_util.h | 1 + .../selftests/cgroup/test_memcontrol.c | 83 +++++++++++++++---- 4 files changed, 87 insertions(+), 22 deletions(-) -- 2.53.0