From owner-freebsd-fs@freebsd.org Tue Feb 11 23:13:20 2020 Return-Path: Delivered-To: freebsd-fs@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 844AF24629D for ; Tue, 11 Feb 2020 23:13:20 +0000 (UTC) (envelope-from pmc@citylink.dinoex.sub.org) Received: from uucp.dinoex.org (uucp.dinoex.sub.de [IPv6:2001:1440:5001:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "uucp.dinoex.sub.de", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48HJV7315hz4n73 for ; Tue, 11 Feb 2020 23:13:19 +0000 (UTC) (envelope-from pmc@citylink.dinoex.sub.org) Received: from uucp.dinoex.sub.de (uucp.dinoex.org [185.220.148.12]) by uucp.dinoex.org (8.16.0.41/8.16.0.41) with ESMTPS id 01BND4lB046675 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Wed, 12 Feb 2020 00:13:05 +0100 (CET) (envelope-from pmc@citylink.dinoex.sub.org) X-MDaemon-Deliver-To: X-Authentication-Warning: uucp.dinoex.sub.de: Host uucp.dinoex.org [185.220.148.12] claimed to be uucp.dinoex.sub.de Received: from citylink.dinoex.sub.org (uucp@localhost) by uucp.dinoex.sub.de (8.16.0.41/8.16.0.41/Submit) with UUCP id 01BND46f046674 for freebsd-fs@freebsd.org; Wed, 12 Feb 2020 00:13:04 +0100 (CET) (envelope-from pmc@citylink.dinoex.sub.org) Received: from gate.oper.dinoex.org (gate-e [192.168.98.2]) by citylink.dinoex.sub.de (8.15.2/8.15.2) with ESMTP id 01BMkcJc008938 for ; Tue, 11 Feb 2020 23:46:40 +0100 (CET) (envelope-from peter@gate.oper.dinoex.org) Received: from gate.oper.dinoex.org (gate-e [192.168.98.2]) by gate.oper.dinoex.org (8.15.2/8.15.2) with ESMTP id 01BMkAUY008924 for ; Tue, 11 Feb 2020 23:46:10 +0100 (CET) (envelope-from peter@gate.oper.dinoex.org) Received: (from peter@localhost) by gate.oper.dinoex.org (8.15.2/8.15.2/Submit) id 01BMkA9u008923 for freebsd-fs@freebsd.org; Tue, 11 Feb 2020 23:46:10 +0100 (CET) (envelope-from peter) Date: Tue, 11 Feb 2020 23:46:10 +0100 From: Peter Sender: li-fbsd@citylink.dinoex.sub.org To: freebsd-fs@freebsd.org Subject: ZFS missing typecast Message-ID: <20200211224610.GA8806@gate.oper.dinoex.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.12.2 (2019-09-21) X-Milter: Spamilter (Reciever: uucp.dinoex.sub.de; Sender-ip: 185.220.148.12; Sender-helo: uucp.dinoex.sub.de; ) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (uucp.dinoex.org [185.220.148.12]); Wed, 12 Feb 2020 00:13:07 +0100 (CET) X-Rspamd-Queue-Id: 48HJV7315hz4n73 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of pmc@citylink.dinoex.sub.org has no SPF policy when checking 2001:1440:5001:1::2) smtp.mailfrom=pmc@citylink.dinoex.sub.org X-Spamd-Result: default: False [-0.04 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.67)[-0.669,0]; RCVD_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.47)[-0.467,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-fs@freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[sub.org]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8469, ipnet:2001:1440::/32, country:DE]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(0.19)[ip: (0.52), ipnet: 2001:1440::/32(0.26), asn: 8469(0.21), country: DE(-0.02)] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Feb 2020 23:13:20 -0000 $ sysctl -a | grep abd vfs.zfs.abd_chunk_size: 4096 vfs.zfs.abd_scatter_enabled: 1 kstat.zfs.misc.abdstats.linear_data_size: 0 kstat.zfs.misc.abdstats.linear_cnt: 0 kstat.zfs.misc.abdstats.scatter_chunk_waste: 64521468332612608 !!!! kstat.zfs.misc.abdstats.scatter_data_size: 488805376 kstat.zfs.misc.abdstats.scatter_cnt: 18458 kstat.zfs.misc.abdstats.struct_size: 999940 This is Rel. 11.3, and this is certainly bogus. Fix: Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c (revision 357643) +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c (working copy) @@ -335,7 +335,7 @@ ABDSTAT_BUMPDOWN(abdstat_scatter_cnt); ABDSTAT_INCR(abdstat_scatter_data_size, -(int)abd->abd_size); ABDSTAT_INCR(abdstat_scatter_chunk_waste, - abd->abd_size - n * zfs_abd_chunk_size); + (int)(abd->abd_size - n * zfs_abd_chunk_size)); abd_free_struct(abd); } BTW, let me mention another thing: in-kernel ZFS does currently NOT COMPILE; I get these errors: --- kernel.full --- atomic.o: In function `atomic_add_64': /usr/src/sys/i386/compile/E1R11V2/./machine/atomic.h:629: multiple definition of `atomic_add_64' opensolaris_atomic.o:/usr/src/sys/i386/compile/E1R11V2/../../../cddl/contrib/ope nsolaris/common/atomic/i386/opensolaris_atomic.S:71: first defined here I reported this already in these messages https://lists.freebsd.org/pipermail/freebsd-stable/2019-July/091389.html but tha matter ended up in nothingness, and I do not know if anybody finally bothered to fix it. I for my part hate plugins, so I do not use kernel loadable modules, and want my ZFS (and dtrace, for that) compiled in the kernel. (This comes back to my mind, because I had to temporally remove my local fix for that to make certain that the bogus stats are not actually introduced by my own hacks - would be great to eventually get rid of some of them.) cheers, PMc