From owner-svn-src-all@freebsd.org Sun Jan 12 19:10:53 2020 Return-Path: Delivered-To: svn-src-all@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 A33BB1DF1FF; Sun, 12 Jan 2020 19:10:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47wmXD2rlnz4jJV; Sun, 12 Jan 2020 19:10:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 00CJAido071538 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 12 Jan 2020 21:10:47 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 00CJAido071538 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 00CJAiSr071537; Sun, 12 Jan 2020 21:10:44 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 12 Jan 2020 21:10:44 +0200 From: Konstantin Belousov To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356656 - in head/sys: kern sys Message-ID: <20200112191044.GB2068@kib.kiev.ua> References: <202001120609.00C69Anp050819@repo.freebsd.org> <20200112090010.GA2068@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.3 X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on tom.home X-Rspamd-Queue-Id: 47wmXD2rlnz4jJV X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; IP_SCORE_FREEMAIL(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(0.00)[ip: (-3.03), ipnet: 2001:470::/32(-4.67), asn: 6939(-3.57), country: US(-0.05)]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jan 2020 19:10:53 -0000 On Sun, Jan 12, 2020 at 11:08:02AM +0100, Mateusz Guzik wrote: > 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 pti should be remove from __read_frequently, probably moving it to __read_mostly is fine, and changed to bool as well. > 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