From patchwork Tue Jan 25 14:49:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Palethorpe X-Patchwork-Id: 1584095 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=BXPmGP4X; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JjqWZ3gTbz9sRR for ; Wed, 26 Jan 2022 01:49:46 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 58AEE3C93C6 for ; Tue, 25 Jan 2022 15:49:44 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id E16753C932A for ; Tue, 25 Jan 2022 15:49:42 +0100 (CET) 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-6.smtp.seeweb.it (Postfix) with ESMTPS id 422041400184 for ; Tue, 25 Jan 2022 15:49:41 +0100 (CET) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 7CA8E218E2; Tue, 25 Jan 2022 14:49:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1643122181; 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: in-reply-to:in-reply-to:references:references; bh=HXWV2cU8nFbERVLsvoDawcCZQ09K7K0YWK5GJqNsueg=; b=BXPmGP4Xbk02fiD04EBpXQJCEvxQvI+kYC81H8DF5cJsJWa6lLmPRwZd1VMaIa8PWS0CVT KaCW+jtB9vg2iZQQfxhyY9WCcjTLyZ0fHUB0gqe0iN1C3a72vu5z3J5T+lA9b32o8+7WC2 VwZf510yR8W6WUXwlxQ0ejjytauo3uY= Received: from g78.suse.de (unknown [10.163.24.90]) by relay2.suse.de (Postfix) with ESMTP id 42432A3B81; Tue, 25 Jan 2022 14:49:41 +0000 (UTC) To: ltp@lists.linux.it Date: Tue, 25 Jan 2022 14:49:21 +0000 Message-Id: <20220125144923.5849-1-rpalethorpe@suse.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124173651.652-1-rpalethorpe@suse.com> References: <20220124173651.652-1-rpalethorpe@suse.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-6.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 autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-6.smtp.seeweb.it Subject: [LTP] [PATCH v2 1/3] memcontrol02: Add VFAT/MSDOS magic and set error to 50% for it also 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" VFAT also allocates some extra non-pagecache memory for tracking buffers. Signed-off-by: Richard Palethorpe --- include/tst_fs.h | 1 + testcases/kernel/controllers/memcg/memcontrol02.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/tst_fs.h b/include/tst_fs.h index efcdff608..3bab9da8b 100644 --- a/include/tst_fs.h +++ b/include/tst_fs.h @@ -30,6 +30,7 @@ #define TST_EXOFS_MAGIC 0x5DF5 #define TST_OVERLAYFS_MAGIC 0x794c7630 #define TST_FUSE_MAGIC 0x65735546 +#define TST_VFAT_MAGIC 0x4d44 /* AKA MSDOS */ #define TST_EXFAT_MAGIC 0x2011BAB0UL enum { diff --git a/testcases/kernel/controllers/memcg/memcontrol02.c b/testcases/kernel/controllers/memcg/memcontrol02.c index 0b8f317a8..411f5aea6 100644 --- a/testcases/kernel/controllers/memcg/memcontrol02.c +++ b/testcases/kernel/controllers/memcg/memcontrol02.c @@ -153,6 +153,7 @@ static void setup(void) cg_test = tst_cgroup_get_test_group(); switch (tst_fs_type(TMPDIR)) { + case TST_VFAT_MAGIC: case TST_EXFAT_MAGIC: case TST_EXT234_MAGIC: file_to_all_error = 50; From patchwork Tue Jan 25 14:49:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Palethorpe X-Patchwork-Id: 1584096 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=hA9Pdlt/; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JjqWp4Qtsz9sRR for ; Wed, 26 Jan 2022 01:49:58 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 4F66B3C94B7 for ; Tue, 25 Jan 2022 15:49:54 +0100 (CET) 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 [IPv6:2001:4b78:1:20::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 01CBC3C93B0 for ; Tue, 25 Jan 2022 15:49:42 +0100 (CET) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (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 6BEB620015D for ; Tue, 25 Jan 2022 15:49:42 +0100 (CET) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id C8E6A1F3AA; Tue, 25 Jan 2022 14:49:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1643122181; 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: in-reply-to:in-reply-to:references:references; bh=fOaYU3271OMIaKbYb1xdRPEkbJ/tvW/MziTCq6b9d7c=; b=hA9Pdlt/n/kQv1KQolvo0qlnvnAj5oiOaVrJ3f3Hi9VsQfg+ByA/2KtKlNmblXZKnCbgYp 0A4Pn0QmyPTQtyTMRTRKujeIC9TL9iTaI/CwYzfzo0vtImM5s8VwsPrOItWR95tr+Y5Xd1 bOP0WusIg39HRkO810WDc10lsMCS6Fo= Received: from g78.suse.de (unknown [10.163.24.90]) by relay2.suse.de (Postfix) with ESMTP id 8DCF1A3B81; Tue, 25 Jan 2022 14:49:41 +0000 (UTC) To: ltp@lists.linux.it Date: Tue, 25 Jan 2022 14:49:22 +0000 Message-Id: <20220125144923.5849-2-rpalethorpe@suse.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220125144923.5849-1-rpalethorpe@suse.com> References: <20220124173651.652-1-rpalethorpe@suse.com> <20220125144923.5849-1-rpalethorpe@suse.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 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 autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-7.smtp.seeweb.it Subject: [LTP] [PATCH v2 2/3] memcontrol02: Fix anon memory comparison 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" All memory is being compared with the size malloc'ed instead of just anon. Signed-off-by: Richard Palethorpe Reviewed-by: Cyril Hrubis --- testcases/kernel/controllers/memcg/memcontrol02.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/controllers/memcg/memcontrol02.c b/testcases/kernel/controllers/memcg/memcontrol02.c index 411f5aea6..75ae5f56c 100644 --- a/testcases/kernel/controllers/memcg/memcontrol02.c +++ b/testcases/kernel/controllers/memcg/memcontrol02.c @@ -67,8 +67,8 @@ static void alloc_anon_50M_check(void) SAFE_CGROUP_LINES_SCANF(cg_child, "memory.stat", anon_key_fmt, &anon); TST_EXP_EXPR(anon > 0, "(memory.stat.anon=%zd) > 0", anon); - TST_EXP_EXPR(values_close(size, current, 3), - "(size=%zd) ~= (memory.stat.anon=%zd)", size, current); + TST_EXP_EXPR(values_close(size, anon, 3), + "(size=%zd) ~= (memory.stat.anon=%zd)", size, anon); TST_EXP_EXPR(values_close(anon, current, 3), "(memory.current=%zd) ~= (memory.stat.anon=%zd)", current, anon); From patchwork Tue Jan 25 14:49:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Palethorpe X-Patchwork-Id: 1584097 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=IDEv/s+B; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JjqX01jsPz9sRR for ; Wed, 26 Jan 2022 01:50:08 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id A0B313C94C1 for ; Tue, 25 Jan 2022 15:50:05 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id F2EC23C9390 for ; Tue, 25 Jan 2022 15:49:42 +0100 (CET) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (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-4.smtp.seeweb.it (Postfix) with ESMTPS id 7FDC41000D34 for ; Tue, 25 Jan 2022 15:49:42 +0100 (CET) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 2115E1F3B6; Tue, 25 Jan 2022 14:49:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1643122182; 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: in-reply-to:in-reply-to:references:references; bh=tAmPUbK8LDcYc+ROXKHN4KkePi88QJ0HskL4/5YFO1c=; b=IDEv/s+BXuoDNv412X/EdsCtzPgksrYM1glSHItilbu1w7P/nLj/kB53jKN25DLOmkUvTP 11zzggt2TdrPcFyPmdN85dbf/FKFKNUFkOy6IwAFtq2UCnXc96Ow1/jmCAVi3uGGN+xtgI +yEJg82m7gwKawa0ULNM3Z3/CBiPxlk= Received: from g78.suse.de (unknown [10.163.24.90]) by relay2.suse.de (Postfix) with ESMTP id DA0D9A3B81; Tue, 25 Jan 2022 14:49:41 +0000 (UTC) To: ltp@lists.linux.it Date: Tue, 25 Jan 2022 14:49:23 +0000 Message-Id: <20220125144923.5849-3-rpalethorpe@suse.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220125144923.5849-1-rpalethorpe@suse.com> References: <20220124173651.652-1-rpalethorpe@suse.com> <20220125144923.5849-1-rpalethorpe@suse.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-4.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 autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH v2 3/3] memcontrol02: Increase expected error with increase in pagesize 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" A few percent seems to be wasted with the increase in page size from 4k to 64k in these tests. For some reason, this appears to cause the test to fail on exfat on the anon test, but only exfat. We add 4% to the error for 64k pages. Signed-off-by: Richard Palethorpe Reviewed-by: Cyril Hrubis --- testcases/kernel/controllers/memcg/memcontrol02.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/controllers/memcg/memcontrol02.c b/testcases/kernel/controllers/memcg/memcontrol02.c index 75ae5f56c..9fa4ff811 100644 --- a/testcases/kernel/controllers/memcg/memcontrol02.c +++ b/testcases/kernel/controllers/memcg/memcontrol02.c @@ -39,13 +39,17 @@ static int fd; static int file_to_all_error = 10; /* - * Checks if two given values differ by less than err% of their sum. + * Checks if two given values differ by less than err% of their + * sum. An extra percent is added for every doubling of the page size + * to compensate for wastage in page sized allocations. */ static inline int values_close(const ssize_t a, const ssize_t b, const ssize_t err) { - return 100 * labs(a - b) <= (a + b) * err; + const ssize_t page_adjusted_err = ffs(page_size >> 13) + err; + + return 100 * labs(a - b) <= (a + b) * page_adjusted_err; } static void alloc_anon_50M_check(void)