From nobody Tue Feb 20 22:31:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfYzF2M3hz59nB0; Tue, 20 Feb 2024 22:31:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfYzF1wCgz416F; Tue, 20 Feb 2024 22:31:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708468281; 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=TVrbr3sAavGhPgxmEUtoGw2kD+KjTrT5zjdPHMppvRs=; b=LfBDrqsmxKYVv3h3sv/LPEPod22746WgpoGYYi7juqNTaciA6Iz4MhyewN1shFNtiRV5E6 tabeKfy38ogwwSmEZuBEEw7xlbPpnCr2XbCew908u4YOt/5Vkm6D5poPxn0uM3JEgtPpfT TFT3lIkmPJzhl+vKaw5m12avNJBVganWh6vIQia7nHriQcLZLqnFgfi/x4qYjsfIOTHfnH ec4hVn0BPAlFwGeF+T5NbUawhz3uf5L3uPVl/Cv8Qq6NzLY0Wr5KO/iMoF8kvVSG+AsIdC NPjfmTH3Vc7eS/hwO8npPO1gbpiwgPHAg85zuiBl8xDLYT4YEIrlQrMGB7sTQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708468281; 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=TVrbr3sAavGhPgxmEUtoGw2kD+KjTrT5zjdPHMppvRs=; b=bUPL48SsGYHvlxI5YXKKmg01mUm/ewMtf9kiqQd3QNhwJc2E+TGZntbhoSAD5A1vvgr1/r OU5xoPBatxzLsrfzz1SF1NRNkJpDkA48CxhmQ0a37ebiTF/6/4Da3bv1e2nr/2me0CKFBT wQf9JgRduHB8K6+CdjMexTLjHJ40BHqbqdmCg0XqkjE5HxLcxMufWDreMaR6B/QfvBWcZi DmYyQXs34oc1lgv4lLYaKSwP+6Vat7faoA7kdLriZHkxHoXZYlTZpcqPKqgKe5TcGB1O+y MCmNTGkvMeEDKlS8KqIUEAPAxjNSItu5qt0yN6qhgmgv/XnoUDYRULFeOKxtwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708468281; a=rsa-sha256; cv=none; b=qXq1ujdvk7RvIvuuOmKppIamGP4b0gbs+VWDeKI8F1zzgK6T5jCiisychfPFM3UOBh2I98 xaVyBND9k3mfM+xl2X+6t/7+7fIwxrj0dG6UCz9cVTYtI0iSHaIYNpmR/wNnooHnelG+nx qGUTyOx4itij3x2ofagrexkFRI6MUlFjZOQhdkNUkmSSwJasCp7aDQ8xCZfeMcxXH1/BMy Exx+mZ8qhsdzcDwXtujXSyyMknFSHtFyE7El1bRas9FkV2eNbLajolbvFmYHeYdtAY4l2x p0RRQz99HzXwq7kIqrzqninB/Cr5zd6R183fhBK25zr91ciqdaRhthA35IOxuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfYzF0yt5zc6m; Tue, 20 Feb 2024 22:31:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41KMVLvx011274; Tue, 20 Feb 2024 22:31:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41KMVL3w011271; Tue, 20 Feb 2024 22:31:21 GMT (envelope-from git) Date: Tue, 20 Feb 2024 22:31:21 GMT Message-Id: <202402202231.41KMVL3w011271@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: fa6a02f50e65 - main - tests/fdgrowtable: open more files in the threaded case List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa6a02f50e65c47540f51b3177f5080bc6af168e Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=fa6a02f50e65c47540f51b3177f5080bc6af168e commit fa6a02f50e65c47540f51b3177f5080bc6af168e Author: Gleb Smirnoff AuthorDate: 2024-02-20 22:31:06 +0000 Commit: Gleb Smirnoff CommitDate: 2024-02-20 22:31:06 +0000 tests/fdgrowtable: open more files in the threaded case This should fix the test failing on some machines/conditions/runs. This won't fix failures in standalone run, but should fix kyua(1) runs. Currently with standalone run it will usually fail because the 40-sized allocation is skipped (see details below). This matches what forking test does: open 128 files in the parent and 128 in the child. There should actually be no difference where and when the files are open, but let's mimic the forking test, and open more files in the spawned thread. Also opening from two different contexts adds a bit more entropy to the test. What the test does it checks that fdgrowtable() has been called at least three tmes for the test process, and the old tables are still on the free list as long as other execution contexts exist. Under kyua(1) control the first call grows the table from 20 to 40, but the original table of 20 is an embedded one, thus is not put on the free list. Passing 40 open files the table grows to 128 and first old table lands on the free list. Passing 128 open file the table grows to 256 and a second old table lands on the free list. After that the test would pass. The threaded test was one open file off before this fix sometimes. --- tests/sys/kern/fdgrowtable_test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/sys/kern/fdgrowtable_test.c b/tests/sys/kern/fdgrowtable_test.c index 75c3d6701c0c..6ea42bd076ad 100644 --- a/tests/sys/kern/fdgrowtable_test.c +++ b/tests/sys/kern/fdgrowtable_test.c @@ -151,6 +151,7 @@ ATF_TC_BODY(free_oldtables, tc) static _Noreturn void * exec_thread(void *args) { + openfiles(128); for (;;) sleep(1); }