From patchwork Mon Feb 28 09:46:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Hrubis X-Patchwork-Id: 1598585 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.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=sciChkT8; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=goyBdhrv; 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 4K6b8B0mPkz9sGS for ; Mon, 28 Feb 2022 20:44:58 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 9491E3CA277 for ; Mon, 28 Feb 2022 10:44:54 +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 7F5373C229A for ; Mon, 28 Feb 2022 10:44: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-4.smtp.seeweb.it (Postfix) with ESMTPS id C0624100095E for ; Mon, 28 Feb 2022 10:44:41 +0100 (CET) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 2436C218E9 for ; Mon, 28 Feb 2022 09:44:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1646041481; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gWCBE6TqnU6dmsk7uuQNabz/xz65YugNi6hWtXJ3caA=; b=sciChkT8khyzoJep1QC26bOqvq7fYZmLy5cENU30apKSn2dbQjJK6q2eWeTBneryeboO4T 5IbPM5H42XaUGq+tTvvAsMb+vOnNYydefhU2jMl6xaYxf5au2HHMlengvFTnIZbuEqn5pZ Uynh77K0yJZ6HhWqn8kFVQxasdG4L5c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1646041481; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gWCBE6TqnU6dmsk7uuQNabz/xz65YugNi6hWtXJ3caA=; b=goyBdhrv8XY8O+NISFzF08C8qE+ZsMa+Ls2/e3TBjVVMhLXMbqn1BWUTelYtqOuFeT+tr/ BUlHN2jl8Y5W7xCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0D59F13AA8 for ; Mon, 28 Feb 2022 09:44:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CIV1AomZHGIYXQAAMHmgww (envelope-from ) for ; Mon, 28 Feb 2022 09:44:41 +0000 From: Cyril Hrubis To: ltp@lists.linux.it Date: Mon, 28 Feb 2022 10:46:58 +0100 Message-Id: <20220228094659.21959-2-chrubis@suse.cz> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220228094659.21959-1-chrubis@suse.cz> References: <20220228094659.21959-1-chrubis@suse.cz> 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, T_SCC_BODY_TEXT_LINE 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 1/2] ksm06: Free memory at the end of the test 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: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Fixes the kms06 run with -i 2. Signed-off-by: Cyril Hrubis Reviewed-by: Petr Vorel --- testcases/kernel/mem/lib/mem.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c index 99d5f7f53..39e3f1791 100644 --- a/testcases/kernel/mem/lib/mem.c +++ b/testcases/kernel/mem/lib/mem.c @@ -594,6 +594,11 @@ void test_ksm_merge_across_nodes(unsigned long nr_pages) 0, 0, 0, nr_pages * num_nodes); SAFE_FILE_PRINTF(PATH_KSM "run", "2"); + + for (i = 0; i < num_nodes; i++) + SAFE_MUNMAP(memory[i], length); + + free(memory); } /* THP */ From patchwork Mon Feb 28 09:46:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Hrubis X-Patchwork-Id: 1598586 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.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=Ae6dB1ov; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=f5np1DBs; 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 4K6b8N2pJBz9sGS for ; Mon, 28 Feb 2022 20:45:08 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id D06753C2DD2 for ; Mon, 28 Feb 2022 10:45:05 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [IPv6:2001:4b78:1:20::3]) (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 891B03C2DD2 for ; Mon, 28 Feb 2022 10:44: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-3.smtp.seeweb.it (Postfix) with ESMTPS id 16C711A00913 for ; Mon, 28 Feb 2022 10:44:42 +0100 (CET) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id AD94D21979 for ; Mon, 28 Feb 2022 09:44:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1646041481; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vZrVc53kJ/WcjckfO1L42XyEJnB4ovuim6yuNs8OZI0=; b=Ae6dB1ovqobXZKbUSNLyF7eXKMbu+4KdpX+5XDIheE1ELpBYxgDqVQb9nuE/Pc/b5RZecv EQ8ZrOYLP+TbU9hNnKMvEWAHCNuDUY4MWT+Jk6zZCK9FBoIjLQDpiBmEZl84M/vSP1WPJg W957Dco3xELUyery2iiJchApHNVws2Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1646041481; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vZrVc53kJ/WcjckfO1L42XyEJnB4ovuim6yuNs8OZI0=; b=f5np1DBsRCMTMT7ljjurTipTd6vtUR16T2T5CPbr27JR7G9U3CMLjLWQgoQUVOwRddbbtw RASwlpBULUlDO7Dg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 988B413AA8 for ; Mon, 28 Feb 2022 09:44:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id TxL0JImZHGIbXQAAMHmgww (envelope-from ) for ; Mon, 28 Feb 2022 09:44:41 +0000 From: Cyril Hrubis To: ltp@lists.linux.it Date: Mon, 28 Feb 2022 10:46:59 +0100 Message-Id: <20220228094659.21959-3-chrubis@suse.cz> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220228094659.21959-1-chrubis@suse.cz> References: <20220228094659.21959-1-chrubis@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-3.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, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH 2/2] ksm06: lock memory about to be merged 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: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" We have observed sporadic failures of the test in OpenQA in the case that the memory allocated by the test is large enough (ksm06_2 runs the test with -n 8000 which on ppc64le with 64k page size amounts to 1GB in allocated buffers in total) and in the case of bacground load being run while the test is executed (LTP compilation with suitable -j make parameter suffices to trigger the conditions). The culprit is that some of the pages may end up being swapped before they happen to be merged due to a memory pressure caused by the background load. After this patch applied the test seems to be passing regardless the background load. Signed-off-by: Cyril Hrubis Reviewed-by: Petr Vorel Reviewed-by: Li Wang --- testcases/kernel/mem/lib/mem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c index 39e3f1791..f1756b34a 100644 --- a/testcases/kernel/mem/lib/mem.c +++ b/testcases/kernel/mem/lib/mem.c @@ -565,6 +565,9 @@ void test_ksm_merge_across_nodes(unsigned long nr_pages) #endif memset(memory[i], 10, length); + + if (mlock(memory[i], length)) + tst_res(TINFO | TERRNO, "mlock() failed"); } SAFE_FILE_PRINTF(PATH_KSM "sleep_millisecs", "0");