svn commit: r356656 - in head/sys: kern sys

Konstantin Belousov kostikbel at gmail.com
Sun Jan 12 19:10:53 UTC 2020


On Sun, Jan 12, 2020 at 11:08:02AM +0100, Mateusz Guzik wrote:
> On 1/12/20, Konstantin Belousov <kostikbel at 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
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 <mjguzik gmail.com>


More information about the svn-src-all mailing list