From owner-freebsd-stable@freebsd.org Sat May 8 12:00:41 2021 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 132A46335CB; Sat, 8 May 2021 12:00:41 +0000 (UTC) (envelope-from yasu@utahime.org) Received: from maybe.home.utahime.org (gate.home.utahime.org [183.180.29.210]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4Fcm9M2mxvz4pVM; Sat, 8 May 2021 12:00:38 +0000 (UTC) (envelope-from yasu@utahime.org) Received: from eastasia.home.utahime.org (eastasia.home.utahime.org [192.168.174.1]) (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 maybe.home.utahime.org (Postfix) with ESMTPS id 4BDDF28859; Sat, 8 May 2021 21:00:29 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=utahime.org; s=maybe2019112701; t=1620475229; bh=IF6Zyh5fS4MnuUV0ma9/ENb+iV6619cs6s+3v4LPb1k=; h=Date:To:Subject:From:In-Reply-To:References; b=LyBJUiby5OQMu4mCVvpczfonSV3KCdsK3mmoiqInUet4QmaIRMh+t/rU6KFMeRkyr YxULNcbC00l+LKXhLb9+hqYdejHtreSkTNKwVsigvDYa9Aqk18EE7GCrs+pnhzSI+k /OrZj4ehcEtYNEHxQCAzvP0lz/zQ2RgpbXRnTWPn0CyHjeuZMOvFWig4CEuoskmWnJ FOxbeBM66tFvQg9dE62R/qhu7i/koG74f9z0amFEKQ/qy7TrY3QHzA033cfkVWm/DU t9lT68H3EjOhKqzyFVbse7Pi/VW4b+K28aVLF4rTNa7UVR4+z2FD7dLBSnypugLlNW aWytHoZauk64w== Received: from localhost (rolling-vm-freebsd5.home.utahime.org [192.168.174.55]) (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 eastasia.home.utahime.org (Postfix) with ESMTPSA id 92C9121D62; Sat, 8 May 2021 21:00:26 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.2 at eastasia.home.utahime.org Date: Sat, 08 May 2021 20:59:40 +0900 (JST) Message-Id: <20210508.205940.216790454.yasu@utahime.org> To: freebsd-current@freebsd.org, freebsd-stable@freebsd.org Subject: Re: Loading zfs module results in hangup on i386 From: Yasuhiro Kimura In-Reply-To: <20210508.074415.2261369884561178196.yasu@utahime.org> References: <20210507.214759.1825935389016318351.yasu@utahime.org> <20210508.073147.1934590966598603586.yasu@utahime.org> <20210508.074415.2261369884561178196.yasu@utahime.org> X-Mailer: Mew version 6.8 on Emacs 27.2 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Fcm9M2mxvz4pVM X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=utahime.org header.s=maybe2019112701 header.b=LyBJUiby; dmarc=none; spf=pass (mx1.freebsd.org: domain of yasu@utahime.org designates 183.180.29.210 as permitted sender) smtp.mailfrom=yasu@utahime.org X-Spamd-Result: default: False [-0.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+a:spf-authorized.utahime.org]; TO_DN_NONE(0.00)[]; HFILTER_HELO_IP_A(1.00)[maybe.home.utahime.org]; HFILTER_HELO_NORES_A_OR_MX(0.30)[maybe.home.utahime.org]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[utahime.org:+]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[183.180.29.210:from]; ASN(0.00)[asn:2519, ipnet:183.180.0.0/16, country:JP]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[utahime.org:s=maybe2019112701]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[utahime.org]; SPAMHAUS_ZRD(0.00)[183.180.29.210:from:127.0.2.255]; MID_CONTAINS_FROM(1.00)[]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-current,freebsd-stable] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 May 2021 12:00:41 -0000 From: Yasuhiro Kimura Subject: Re: Loading zfs module results in hangup on i386 Date: Sat, 08 May 2021 07:44:15 +0900 (JST) >> Now I think I know what is the source of problem. After all, on >> 13.0-RELEASE i386 system simply loading zfs module results in system >> hang up. >> >> The steps to reproduce it are, >> >> 1. Boot with install media of 13.0-RELEASE i386 >> 2. At the first menu of FreeBSD installer, select 'Shell'. >> 3. At the shell prompt, type `kldload zfs` and return key. >> >> I confirmed hangup happens with VirtualBox, VMware Player and my bare >> metal PC environement. So the problem doesn't depend on hardware. >> >> And hangup also happens with 13-STABLE and 14-CURRENT. > > This problem is already reported to Bugzilla. > > Bug 254177 When ZFS is recognized, An i386 machine with a lot of memory hangs. > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254177 Referencing the bug report, I applied attached patch to d474440ab33 of main (14-CURRENT). built install image and tried install of ZFS root i386 system with it. Then it completed successfully with 8GB memory. Additionally GENERIC kernel recognizes 8GB of memory. And ZFS root system works fine without any tuning. ---------------------------------------------------------------------- diff --git a/sys/contrib/openzfs/module/zfs/dbuf.c b/sys/contrib/openzfs/module/zfs/dbuf.c index d48dc7943a2..c85500453fb 100644 --- a/sys/contrib/openzfs/module/zfs/dbuf.c +++ b/sys/contrib/openzfs/module/zfs/dbuf.c @@ -796,7 +796,7 @@ dbuf_init(void) * By default, the table will take up * totalmem * sizeof(void*) / 8K (1MB per GB with 8-byte pointers). */ - while (hsize * zfs_arc_average_blocksize < physmem * PAGESIZE) + while (hsize * zfs_arc_average_blocksize < (uint64_t)physmem * PAGESIZE) hsize <<= 1; retry: ---------------------------------------------------------------------- --- Yasuhiro Kimura