Date: Sun, 12 Jan 2020 11:08:02 +0100 From: Mateusz Guzik <mjguzik@gmail.com> To: Konstantin Belousov <kostikbel@gmail.com> 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: <CAGudoHFECqNqcumVZtRoVEZLXQ0i0Bou1=Bi7yeJB4Y2JxNTgQ@mail.gmail.com> In-Reply-To: <20200112090010.GA2068@kib.kiev.ua> References: <202001120609.00C69Anp050819@repo.freebsd.org> <20200112090010.GA2068@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
On 1/12/20, Konstantin Belousov <kostikbel@gmail.com> 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 <mjguzik gmail.com>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGudoHFECqNqcumVZtRoVEZLXQ0i0Bou1=Bi7yeJB4Y2JxNTgQ>