From patchwork Wed Oct 4 12:11:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Palethorpe X-Patchwork-Id: 1843282 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=susede1 header.b=AunOdUP+; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S0tpv4Q4qz1yng for ; Wed, 4 Oct 2023 23:12:05 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id D05AB3CDAFF for ; Wed, 4 Oct 2023 14:12:00 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [217.194.8.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 08A5F3CBDCE for ; Wed, 4 Oct 2023 14:11:58 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (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 in-7.smtp.seeweb.it (Postfix) with ESMTPS id 76232200D02 for ; Wed, 4 Oct 2023 14:11:57 +0200 (CEST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 81324210EB; Wed, 4 Oct 2023 12:11:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1696421517; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ROBj2YL5Xd8VKLkHHp3J3waZxuXnXINvfu7sr/6jPLA=; b=AunOdUP+rQJHukAJNUf4O53tF9GEzsuDFd/yKagpkXfBym3xYvCKi+6UFWzHx73zzHW4zd Cl4MwwEA30nJ/5z4HwwaTKHlQJjovAXWlT02paBCJ1+ny+izEtXsGVPX8J2kyE3YyFoajS uLt13RChmO9dZFYnoNej8aFztzk6OtQ= Received: from g78.cable.virginm.net (rpalethorpe.udp.ovpn2.prg.suse.de [10.100.204.110]) by relay2.suse.de (Postfix) with ESMTP id 089FE2C143; Wed, 4 Oct 2023 12:11:56 +0000 (UTC) To: ltp@lists.linux.it Date: Wed, 4 Oct 2023 13:11:49 +0100 Message-ID: <20231004121149.30849-1-rpalethorpe@suse.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 1.0.1 at in-7.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-7.smtp.seeweb.it Subject: [LTP] [PATCH] memcg: Account for pages in the per-cpu cache X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Palethorpe via ltp From: Richard Palethorpe Reply-To: Richard Palethorpe Cc: Richard Palethorpe Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" PAGESIZES is one greater than the batch size for charging pages from the per CPU cache. So with MEM_TO_ALLOC=2*PAGESIZES we have two pages that are below the threshold for being charged. Sometimes something triggers a flush and the pages get charged to the global counter anyway and the test passes. We have seen cases where the test times out waiting for this to happen. So this patch sets a lower bound to allow those cases to pass. It'll probably speed the test up as well. Signed-off-by: Richard Palethorpe Reviewed-by: Petr Vorel --- .../controllers/memcg/functional/memcg_subgroup_charge.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/controllers/memcg/functional/memcg_subgroup_charge.sh b/testcases/kernel/controllers/memcg/functional/memcg_subgroup_charge.sh index 9bcc01258..3b7311422 100755 --- a/testcases/kernel/controllers/memcg/functional/memcg_subgroup_charge.sh +++ b/testcases/kernel/controllers/memcg/functional/memcg_subgroup_charge.sh @@ -33,8 +33,8 @@ test_subgroup() fi echo $MEMCG_PROCESS_PID > tasks - signal_memcg_process $MEM_TO_ALLOC - check_mem_stat "rss" $MEM_TO_ALLOC + signal_memcg_process $MIN_CHARGED + check_mem_stat "rss" $MIN_CHARGED $MEM_TO_ALLOC cd subgroup echo $MEMCG_PROCESS_PID > tasks @@ -66,5 +66,6 @@ test3() # Allocate memory bigger than per-cpu kernel memory MEM_TO_ALLOC=$((PAGESIZES * 2)) +MIN_CHARGED=$((2 * (PAGESIZES - 1))) tst_run