From nobody Mon Jul 5 14:04:48 2021 X-Original-To: freebsd-current@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 B4A1F10FA966 for ; Mon, 5 Jul 2021 14:04:53 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GJS9w52glz3lGc for ; Mon, 5 Jul 2021 14:04:52 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr1-x435.google.com with SMTP id v5so22240966wrt.3 for ; Mon, 05 Jul 2021 07:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to; bh=e57UpcF1qnjD/LMpIVyMbCLSltjiW2wU6xHl+7yqqvQ=; b=kTCdZ9SKOAP9W/Dwpk7JHUcfy5ajfIJNJQXqDFSaAQpXOJd/G5aaWGBZOZOoBO0WwE B4iYcllXYPg6xjziWIBN8fo0vmtUczeuCaS9JcA27du+Oxbm8z76L5K+JyaBxFqbLex8 JH0yC2wpidPGseCGK+7U1RYRyennBOIvecFk3ln4kGLl3aXC1VWVLgHVtALsj+DcnNvk JR8/r4xlfqoUcIPjTcHHYIg8+9C9xGjmfd512UaIvpQID8kf90K7HP4I9kI2RMK00iZ7 GowpeEXsRvxPWpb6IzxKH7TJw2dnTwuBo4ooj1omflFw8TOUUh2cwkyA/AqoEXx+SCln HjHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=e57UpcF1qnjD/LMpIVyMbCLSltjiW2wU6xHl+7yqqvQ=; b=VXdA9CONsyJwkhwb0NGXCnEYZAHfp7VySGXhCm5t5JeU+he2sElwpcTnvdQwcZOQtD sEEUApgJyLlDXGDHvib9Z74KgfO+lh/uCqhpgrIcqvZWC+B2hhAFdggUiCNLwjLaEyxt UZNrn6tFbIrE+8hIaAAbASMgpDeYRcFqnGioWD47K6o0DzetD3HhrNB6COcs7aNpNSAF Fg/5kmFqAikaMLOmxanbSJgF1fwfQ0Fhhkxhl4VWoRZW75MEN7KkgTtAbgVaKyLko7SI OZo0ze1Wd+m3smJkaVikgF52f2o6whosgad+phR5vwC0AAvUbvy4ERvn++SKTyI2RAvS 8wAw== X-Gm-Message-State: AOAM531++rjOhEoUhSze6Epm33GFy4Vdpt4N5QRXljeTNQ6sCfOx3yFA 3a0O0G4zU22cuG0F5yQGPBU= X-Google-Smtp-Source: ABdhPJxMamow+t1iPkqYjhwiXXKRRJhpdeCg8pDXws+I6BGh2pDKOvRv+izExhnEULhCS+6BcNVbdw== X-Received: by 2002:adf:f7ce:: with SMTP id a14mr15617072wrq.424.1625493891422; Mon, 05 Jul 2021 07:04:51 -0700 (PDT) Received: from brick (cpc159423-cmbg20-2-0-cust338.5-4.cable.virginm.net. [86.7.147.83]) by smtp.gmail.com with ESMTPSA id k6sm12169836wrx.41.2021.07.05.07.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 07:04:50 -0700 (PDT) Date: Mon, 5 Jul 2021 15:04:48 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Gary Jennejohn Cc: Warner Losh , FreeBSD Current Subject: Re: panic: Unaligned free (was: kernel panic while copying files) Message-ID: Mail-Followup-To: Gary Jennejohn , Warner Losh , FreeBSD Current References: <20210608084646.6a7e1bc7@ernst.home> <20210608155405.5cf0e200@ernst.home> <20210610095041.38d7597c@ernst.home> <20210629094201.77ef5f22@ernst.home> <20210630125703.2b5544e7@ernst.home> <20210701035800.410d2376@ernst.home> <20210701113026.59f864e9@ernst.home> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210701113026.59f864e9@ernst.home> X-Rspamd-Queue-Id: 4GJS9w52glz3lGc X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=kTCdZ9SK; dmarc=none; spf=pass (mx1.freebsd.org: domain of etnapierala@gmail.com designates 2a00:1450:4864:20::435 as permitted sender) smtp.mailfrom=etnapierala@gmail.com X-Spamd-Result: default: False [-2.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[trasz@freebsd.org,etnapierala@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[86.7.147.83:received]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[trasz@freebsd.org,etnapierala@gmail.com]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::435:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::435:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::435:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-current] X-ThisMailContainsUnwantedMimeParts: N On 0701T1330, Gary Jennejohn wrote: > Gary Jennejohn wrote: > > I noticed that the value of vm.debug.divisor affects what value is > > returned in uma_core.c:uma_dbg_kskip(), so I decided to try a few > > different values. > > > > The returned value is used to set skipdbg in uma_core.c:item_dtor(). > > > > The default is vm.debug.divisor=1. > > > > vm.debug.divisor is only present when INVARIANTS is defined. > > > > kskipdbg eventually affects the value of freei. > > > > With these values: > > vm.debug.divisor: 0 > > kern.cam.da.enable_uma_ccbs: 1 > > I can turn on the disk and it comes up without a panic! > > > > However, I didn't try to do any large data transfers to the disk. > > > > So, it appears that at least vm.debug.divisor is a big factor in > > whether or not a panic happens with INVARIANTS. > > > > I decided to do a real test. So I built a kernel w/o INVARIANTS and > installed it to /boot/test. > > Then I stuck a 160GB disk I had around into an external USB3 enclosure > and put a filesystem on it. > > The I booted the new kernel from /boot/test and set the sysctls so: > kern.cam.da.enable_uma_ccbs: 1 > kern.cam.ada.enable_uma_ccbs: 1 > > After that I plugged in the external USB3 enclosure and copied about > 114GiB of data from an internal SSD to it - without a kernel panic: > Filesystem Size Used Avail Capacity Mounted on > /dev/da0p1 144G 114G 18G 86% /mnt > > I'm pretty sure that's more than I could copy without a kernel panic > prior to the recent changes made in cam and umass. > > My test may not be real proof that all bugs have been squashed, but it > certainly seems to be a better situation than we had before. I think the vm.debug.divisor simply masks the problem; the underlying bug is still there. Could you go back to the setup which panics, and then test the patch at https://reviews.freebsd.org/D31054? It fixes the scenario described by Warner.