From owner-svn-src-head@freebsd.org Sun Jan 12 10:08:06 2020 Return-Path: Delivered-To: svn-src-head@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 CE29322AE03; Sun, 12 Jan 2020 10:08:06 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 47wXTx53lDz4Dh9; Sun, 12 Jan 2020 10:08:05 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x444.google.com with SMTP id t2so5724859wrr.1; Sun, 12 Jan 2020 02:08:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=vVXKTqaxSvUUWAAucGeuGjBLFpd2unbzwMpp00Opc7o=; b=fB8OKZcthpoz6VG+ghT28+4RIWsF/MrWoAh2oEAtsps4kaToyF3jv6shMcT4XUeOZF DXEInYAMuqhbB3JIeK89CiObRH7nAs+KNU8nFTrVCGAs71i3XIfkORIET7ouYuMW3M7F V+hpIjIL35HsrBMIV10xo+Sf1L7B4OBtYNijbb1Yqqu/PKHXKAkY+kU0efZi8TeYynIn w57XrKh3v8pREMoAUIGSPsWJZy9gNsTddZx4fLmSrDRVTgDOPzwG8n5hDbgZ9VsGHwCq 5tWXrABDpx+x1i4n6Gx95uXPr5rHsA7/HuyrqyKGzHKh6DSPtEAA7wm+HWt+xevgE8GQ JlPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=vVXKTqaxSvUUWAAucGeuGjBLFpd2unbzwMpp00Opc7o=; b=YEpoQ49ECvJBQ5JqzkJJYokcwqxBPe3qePvTDWvR7B3zsEL9wAy99WrceBnL1xA8uH Rt3pYtjQ/59T+JvLFuiXDoQayCZ6MxJEjh/x4pwb0IKLU2Rcyxod7Xv+Zg3cBaS3KMr1 3VKevZoqvYHL3Q85TIP/XiHbPBAgnpPuNvLT+NRioP0lsK4Y+tz1BMP65zmtkqcdTXgc qCfvZ6+KV5lCknZk6JKfrHiSXwV/0rZmfuTvs7BCqF5FJyrvUD3ZfL75S2Mq43wgQ1nH YAgu8Vz3hjvdH4arxKZTMU2EgE5J9mrnnuZnZArW2/nnkAG5LfUTO9AIVmLZ5o9Umwpp IKrg== X-Gm-Message-State: APjAAAVtGuJgfD7FLLLC8zg9EcftK958Ky3sEOqIcBrgj8uz1iXcHzDH Ucbe7GvsNcScUTIA60vidIYkXzLJd4PNFuAqqP4= X-Google-Smtp-Source: APXvYqwhdWBo0lv8pyS0n1o0ZtbjDC3EPW4O0Nl6MRgkHCdF+wu/8ogrbtNUoeUHgSlkZxLTKvmC57LQIHk0AA0IfhM= X-Received: by 2002:a5d:4d8d:: with SMTP id b13mr13467957wru.6.1578823684259; Sun, 12 Jan 2020 02:08:04 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:6b02:0:0:0:0:0 with HTTP; Sun, 12 Jan 2020 02:08:02 -0800 (PST) In-Reply-To: <20200112090010.GA2068@kib.kiev.ua> References: <202001120609.00C69Anp050819@repo.freebsd.org> <20200112090010.GA2068@kib.kiev.ua> From: Mateusz Guzik Date: Sun, 12 Jan 2020 11:08:02 +0100 Message-ID: Subject: Re: svn commit: r356656 - in head/sys: kern sys To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47wXTx53lDz4Dh9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=fB8OKZct; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::444 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (2.70), ipnet: 2a00:1450::/32(-2.60), asn: 15169(-1.84), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[4.4.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jan 2020 10:08:06 -0000 On 1/12/20, Konstantin Belousov wrote: > On Sun, Jan 12, 2020 at 06:09:10AM +0000, Mateusz Guzik wrote: >> Author: mjg >> Date: Sun Jan 12 06:09:10 2020 >> New Revision: 356656 >> URL: https://svnweb.freebsd.org/changeset/base/356656 >> >> Log: >> Add "panicked" boolean which can be tested instead of panicstr >> >> The test is performed all the time and reading entire panicstr to do it >> wastes space. > What space does it waste ? The space in the read-mostly section ? > > And what is the difference between reading a pointer vs. reading a byte ? > CPU still has to read the whole cache line. > Note the annotation with __read_frequently which groups fields. Currently it results in the following (with tail filled up from __read_mostly): ---------------- ffffffff80c01000 D hc_source_mask ffffffff80c01004 D pti ffffffff80c01008 D locks_delay ffffffff80c0100c D locks_delay_retries ffffffff80c0100e D locks_delay_loops ffffffff80c01010 d fortuna_concurrent_read ffffffff80c01011 D random_chachamode ffffffff80c01012 D systrace_enabled ffffffff80c01013 D lockstat_enabled ffffffff80c01014 D dtrace_malloc_enabled ffffffff80c01015 D racct_enable ffffffff80c01016 D sdt_probes_enabled ffffffff80c01017 D panicked ffffffff80c01018 D kdb_active ffffffff80c01019 D trap_enotcap ffffffff80c0101a D audit_syscalls_enabled ffffffff80c01020 D cam_dflags ffffffff80c01028 d epoch_inited ffffffff80c01030 d rs_epoch ffffffff80c01038 d biozone ---------------- Should panicstr land here it would avoidably take up 8 bytes instead of 1. -- Mateusz Guzik