From patchwork Tue Jun 6 07:19:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Wang X-Patchwork-Id: 1790832 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Kox7glrx; dkim-atps=neutral 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Qb20l2VfPz20Ty for ; Tue, 6 Jun 2023 17:19:35 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 0E0DF3CCA06 for ; Tue, 6 Jun 2023 09:19:32 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) (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 789093CB526 for ; Tue, 6 Jun 2023 09:19:30 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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-2.smtp.seeweb.it (Postfix) with ESMTPS id 7294760069D for ; Tue, 6 Jun 2023 09:19:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686035967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+ZDegfh2aWp1mIahwXEWe5RUVD42djPCgCxMMf/IVWw=; b=Kox7glrxvwAfXXNZDyk35cZOVV2GnVdA9yKVGRqF/e5houRQ5B7/laMBO1GfGsuGcljZHI CQhgtxx7Y74x28SP5935BrpcMTAoL1S8AIpEJrwOGyN43v+Y8SFWSyF7rqyb4zzgXXjqIW 8Jbv6mWe8sVR5HGKmRaHiwIbHVo48BM= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-154-cMRo2jSXNHSpEPKtIwloxg-1; Tue, 06 Jun 2023 03:19:26 -0400 X-MC-Unique: cMRo2jSXNHSpEPKtIwloxg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8A88F3C0F425 for ; Tue, 6 Jun 2023 07:19:25 +0000 (UTC) Received: from liwang-workstation.lab.eng.nay.redhat.com (unknown [10.66.145.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B8182026D49 for ; Tue, 6 Jun 2023 07:19:24 +0000 (UTC) From: Li Wang To: ltp@lists.linux.it Date: Tue, 6 Jun 2023 15:19:22 +0800 Message-Id: <20230606071922.89447-1-liwang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Virus-Scanned: clamav-milter 1.0.1 at in-2.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 shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH] readahead02: set dynamic run time 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" The readahead time-consuming is quit depending on the platform IO speed, test get timeout once the default max_runtime is used up. readahead02.c:223: TINFO: Test #1: readahead on overlayfs file ... readahead02.c:286: TINFO: read_testfile(0) took: 63382903 usec readahead02.c:287: TINFO: read_testfile(1) took: 47943122 usec ... readahead02.c:312: TPASS: using cache as expected readahead02.c:223: TINFO: Test #2: POSIX_FADV_WILLNEED on file readahead02.c:128: TINFO: creating test file of size: 67108864 readahead02.c:241: TINFO: read_testfile(0) Test timeouted, sending SIGKILL! Let's raise the maximum runtime dynamically. Signed-off-by: Li Wang --- testcases/kernel/syscalls/readahead/readahead02.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/testcases/kernel/syscalls/readahead/readahead02.c b/testcases/kernel/syscalls/readahead/readahead02.c index b6c097b31..dc03c5931 100644 --- a/testcases/kernel/syscalls/readahead/readahead02.c +++ b/testcases/kernel/syscalls/readahead/readahead02.c @@ -318,6 +318,19 @@ static void test_readahead(unsigned int n) tst_res(TCONF, "Page cache on your system is too small " "to hold whole testfile."); } + + /* + * The time consuming of readahead quite depending on the platform IO + * speed, sometime test timeout when the default max_runtime is used up. + * + * readahead02.c:221: TINFO: Test #2: POSIX_FADV_WILLNEED on file + * readahead02.c:285: TINFO: read_testfile(0) took: 26317623 usec + * readahead02.c:286: TINFO: read_testfile(1) took: 26101484 usec + * + * Here raise the maximum runtime dynamically. + */ + if ((tc+1)->readahead) + tst_set_max_runtime(test.max_runtime + (usec + usec_ra) / 1000000); }