Hi,

* Theo de Raadt wrote:
> 
> I would appreciate reports, and later I'll cut this into pieces and
> commit incremental changes.

I run four tests on an Intel NUC with softraid CRYPTO and a keydisk.
Although the sync+suspend does not finish in one test it is definitely
am improvement and your work is highly appreciated!

Cheers

        Matthias

1. zzz after manual fsync and pulled the plug after suspend.

Works as expected and no softraid errors.

Jan  6 20:59:21 tau /bsd: /var force clean (0 0): fmod 1 clean 1
Jan  6 20:59:21 tau /bsd: /usr/src force clean (0 0): fmod 1 clean 1
Jan  6 20:59:21 tau /bsd: /usr/ports force clean (0 0): fmod 1 clean 1
Jan  6 20:59:21 tau /bsd: /usr/obj force clean (0 0): fmod 1 clean 1
Jan  6 20:59:21 tau /bsd: /usr/local force clean (0 0): fmod 1 clean 1
Jan  6 20:59:21 tau /bsd: /usr/X11R6 force clean (0 0): fmod 1 clean 1
Jan  6 20:59:21 tau /bsd: /usr force clean (0 0): fmod 1 clean 1
Jan  6 20:59:22 tau /bsd: /tmp force clean (0 0): fmod 1 clean 1
Jan  6 20:59:22 tau /bsd: /home force clean (0 0): fmod 1 clean 1
Jan  6 20:59:22 tau /bsd: / force clean (0 0): fmod 1 clean 1

2. zzz while extracting src.tar.gz on /tmp and pulled the plug after
suspend.

Same result, works as expected.

3, ZZZ after manual fsync.

Same result, works as expected.

4.  Now the interesting case.  Basically the same as (2) but now I
extracted src.tar.gz not in /tmp but in /home which is my largest
partition.  This time, the suspend process does not finished and I
pulled the plug after some time.  My /home partition was extremely dirty
but the others were marked as clean.  So definitely an improvement over
the current situation.

/dev/sd2l: SIZE=762 MTIME=Sep 14 16:04 2016  (RECONNECTED)
/dev/sd2l (1cae2f5f79b7f28f.l): UNREF FILE  I=11553631  OWNER=xhr MODE=100644
[ Hundreds of unferenced files ]
/dev/sd2l (1cae2f5f79b7f28f.l): FREE BLK COUNT(S) WRONG IN SUPERBLK (SALVAGED)
/dev/sd2l (1cae2f5f79b7f28f.l): SUMMARY INFORMATION BAD (SALVAGED)
/dev/sd2l (1cae2f5f79b7f28f.l): BLK(S) MISSING IN BIT MAPS (SALVAGED)
/dev/sd2l (1cae2f5f79b7f28f.l): 176550 files, 13148621 used, 91136441 free 
(88761 frags, 11380960 blocks, 0.1% fragmentation)
/dev/sd2l (1cae2f5f79b7f28f.l): MARKING FILE SYSTEM CLEAN
/dev/sd2d (1cae2f5f79b7f28f.d): file system is clean; not checking
/dev/sd2f (1cae2f5f79b7f28f.f): file system is clean; not checking
/dev/sd2g (1cae2f5f79b7f28f.g): file system is clean; not checking
/dev/sd2h (1cae2f5f79b7f28f.h): file system is clean; not checking
/dev/sd2k (1cae2f5f79b7f28f.k): file system is clean; not checking
/dev/sd2j (1cae2f5f79b7f28f.j): file system is clean; not checking
/dev/sd2i (1cae2f5f79b7f28f.i): file system is clean; not checking
/dev/sd2e (1cae2f5f79b7f28f.e): file system is clean; not checking

Jan  6 21:09:25 tau /bsd: /var force clean (0 0): fmod 1 clean 1
Jan  6 21:09:25 tau /bsd: /usr/src force clean (0 0): fmod 1 clean 1
Jan  6 21:09:25 tau /bsd: /usr/ports force clean (0 0): fmod 1 clean 1
Jan  6 21:09:25 tau /bsd: /usr/obj force clean (0 0): fmod 1 clean 1
Jan  6 21:09:25 tau /bsd: /usr/local force clean (0 0): fmod 1 clean 1
Jan  6 21:09:25 tau /bsd: /usr/X11R6 force clean (0 0): fmod 1 clean 1
Jan  6 21:09:25 tau /bsd: /usr force clean (0 0): fmod 1 clean 1
Jan  6 21:09:25 tau /bsd: /tmp force clean (0 0): fmod 1 clean 1

Both / and /home are missing here and they were both marked as dirty.

Here my disklabel as reference:

# /dev/rsd2c:
type: SCSI
disk: SCSI disk
label: SR CRYPTO
duid: 1cae2f5f79b7f28f
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 58368
total sectors: 937697393
boundstart: 64
boundend: 937681920
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize   cpg]
  a:          2097152               64  4.2BSD   2048 16384 12958 # /
  b:         33820888          2097216    swap                    # none
  c:        937697393                0  unused
  d:          4194304         35918112  4.2BSD   2048 16384 12958 # /tmp
  e:          4194304         40112416  4.2BSD   2048 16384 12958 # /var
  f:          4194304         44306720  4.2BSD   2048 16384 12958 # /usr
  g:          2097152         48501024  4.2BSD   2048 16384 12958 # /usr/X11R6
  h:         20971520         50598176  4.2BSD   2048 16384 12958 # /usr/local
  i:          8388608         71569696  4.2BSD   2048 16384 12958 # /usr/src
  j:          8399168         79958304  4.2BSD   2048 16384 12958 # /usr/ports
  k:          8385952         88357472  4.2BSD   2048 16384 12958 # /usr/obj
  l:        840938496         96743424  4.2BSD   4096 32768 26062 # /home

OpenBSD 6.2-current (GENERIC.MP) #0: Sat Jan  6 20:02:16 CET 2018
    x...@tau.xosc.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 17047859200 (16258MB)
avail mem = 16524271616 (15758MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 3.0 @ 0x7b1d5000 (58 entries)
bios0: vendor Intel Corp. version "SYSKLi35.86A.0062.2017.0831.1905" date 
08/31/2017
bios0: Intel corporation NUC6i5SYB
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC FPDT FIDT MCFG HPET LPIT SSDT SSDT SSDT SSDT DBGP 
DBG2 SSDT SSDT UEFI SSDT DMAR
acpi0: wakeup devices PEGP(S4) PEG0(S4) PEGP(S4) PEG1(S4) PEGP(S4) PEG2(S4) 
SIO1(S3) PXSX(S4) RP09(S4) PXSX(S4) RP10(S4) PXSX(S4) RP11(S4) PXSX(S4) 
RP12(S4) PXSX(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i5-6260U CPU @ 1.80GHz, 1696.83 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SENSOR,ARAT
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 23MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4.1.1.1, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i5-6260U CPU @ 1.80GHz, 1696.04 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SENSOR,ARAT
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 1 (application processor)
cpu2: Intel(R) Core(TM) i5-6260U CPU @ 1.80GHz, 1696.04 MHz
cpu2: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SENSOR,ARAT
cpu2: 256KB 64b/line 8-way L2 cache
cpu2: smt 1, core 0, package 0
cpu3 at mainbus0: apid 3 (application processor)
cpu3: Intel(R) Core(TM) i5-6260U CPU @ 1.80GHz, 1696.04 MHz
cpu3: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SENSOR,ARAT
cpu3: 256KB 64b/line 8-way L2 cache
cpu3: smt 1, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 120 pins
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-255
acpihpet0 at acpi0: 23999999 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (PEG0)
acpiprt2 at acpi0: bus -1 (PEG1)
acpiprt3 at acpi0: bus -1 (PEG2)
acpiprt4 at acpi0: bus -1 (RP09)
acpiprt5 at acpi0: bus -1 (RP10)
acpiprt6 at acpi0: bus -1 (RP11)
acpiprt7 at acpi0: bus -1 (RP12)
acpiprt8 at acpi0: bus -1 (RP13)
acpiprt9 at acpi0: bus -1 (RP01)
acpiprt10 at acpi0: bus -1 (RP02)
acpiprt11 at acpi0: bus -1 (RP03)
acpiprt12 at acpi0: bus -1 (RP04)
acpiprt13 at acpi0: bus 1 (RP05)
acpiprt14 at acpi0: bus -1 (RP06)
acpiprt15 at acpi0: bus -1 (RP07)
acpiprt16 at acpi0: bus -1 (RP08)
acpiprt17 at acpi0: bus -1 (RP17)
acpiprt18 at acpi0: bus -1 (RP18)
acpiprt19 at acpi0: bus -1 (RP19)
acpiprt20 at acpi0: bus -1 (RP20)
acpiprt21 at acpi0: bus -1 (RP14)
acpiprt22 at acpi0: bus -1 (RP15)
acpiprt23 at acpi0: bus -1 (RP16)
acpiec0 at acpi0: not present
acpicpu0 at acpi0: C2(200@151 mwait.1@0x31), C1(1000@1 mwait.1), PSS
acpicpu1 at acpi0: C2(200@151 mwait.1@0x31), C1(1000@1 mwait.1), PSS
acpicpu2 at acpi0: C2(200@151 mwait.1@0x31), C1(1000@1 mwait.1), PSS
acpicpu3 at acpi0: C2(200@151 mwait.1@0x31), C1(1000@1 mwait.1), PSS
acpipwrres0 at acpi0: PG00, resource for PEG0
acpipwrres1 at acpi0: PG01, resource for PEG1
acpipwrres2 at acpi0: PG02, resource for PEG2
acpipwrres3 at acpi0: WRST
acpipwrres4 at acpi0: WRST
acpipwrres5 at acpi0: WRST
acpipwrres6 at acpi0: WRST
acpipwrres7 at acpi0: WRST
acpipwrres8 at acpi0: WRST
acpipwrres9 at acpi0: WRST
acpipwrres10 at acpi0: WRST
acpipwrres11 at acpi0: WRST
acpipwrres12 at acpi0: WRST
acpipwrres13 at acpi0: WRST
acpipwrres14 at acpi0: WRST
acpipwrres15 at acpi0: WRST
acpipwrres16 at acpi0: WRST
acpipwrres17 at acpi0: WRST
acpipwrres18 at acpi0: WRST
acpipwrres19 at acpi0: WRST
acpipwrres20 at acpi0: WRST
acpipwrres21 at acpi0: WRST
acpipwrres22 at acpi0: WRST
acpipwrres23 at acpi0: FN00, resource for FAN0
acpipwrres24 at acpi0: FN01, resource for FAN1
acpipwrres25 at acpi0: FN02, resource for FAN2
acpipwrres26 at acpi0: FN03, resource for FAN3
acpipwrres27 at acpi0: FN04, resource for FAN4
acpitz0 at acpi0: critical temperature is 105 degC
acpitz1 at acpi0: critical temperature is 105 degC
"ITE8713" at acpi0 not configured
"INT3F0D" at acpi0 not configured
"INT344B" at acpi0 not configured
acpibtn0 at acpi0: SLPB
"INT33A1" at acpi0 not configured
acpibtn1 at acpi0: PWRB
"INT340E" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD1F
cpu0: Enhanced SpeedStep 1696 MHz: speeds: 1801, 1800, 1700, 1600, 1500, 1400, 
1300, 1200, 1100, 1000, 900, 800, 700, 600, 500, 400 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Core 6G Host" rev 0x09
inteldrm0 at pci0 dev 2 function 0 "Intel Iris 540/550" rev 0x0a
drm0 at inteldrm0
inteldrm0: msi
error: [drm:pid0:i915_firmware_load_error_print] *ERROR* failed to load 
firmware i915/skl_dmc_ver1.bin (-22)
error: [drm:pid0:i915_gem_init_hw] *ERROR* Failed to initialize GuC, error -8 
(ignored)
inteldrm0: 1920x1080, 32bpp
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
xhci0 at pci0 dev 20 function 0 "Intel 100 Series xHCI" rev 0x21: msi
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "Intel xHCI root hub" rev 3.00/1.00 
addr 1
pchtemp0 at pci0 dev 20 function 2 "Intel 100 Series Thermal" rev 0x21
"Intel 100 Series MEI" rev 0x21 at pci0 dev 22 function 0 not configured
ahci0 at pci0 dev 23 function 0 "Intel 100 Series AHCI" rev 0x21: msi, AHCI 
1.3.1
ahci0: port 0: 6.0Gb/s
scsibus1 at ahci0: 32 targets
sd0 at scsibus1 targ 0 lun 0: <ATA, CT480BX200SSD1, MU02> SCSI3 0/direct fixed 
naa.500a0751f019e7a2
sd0: 457862MB, 512 bytes/sector, 937703088 sectors, thin
ppb0 at pci0 dev 28 function 0 "Intel 100 Series PCIE" rev 0xf1: msi
pci1 at ppb0 bus 1
iwm0 at pci1 dev 0 function 0 "Intel Dual Band Wireless AC 8260" rev 0x3a, msi
vendor "Intel", unknown product 0x9d27 (class DASP subclass miscellaneous, rev 
0x21) at pci0 dev 30 function 0 not configured
sdhc0 at pci0 dev 30 function 6 vendor "Intel", unknown product 0x9d2d rev 
0x21: apic 2 int 23
sdhc0: SDHC 3.0, 200 MHz base clock
sdmmc0 at sdhc0: 4-bit, sd high-speed, mmc high-speed, dma
pcib0 at pci0 dev 31 function 0 "Intel 100 Series LPC" rev 0x21
"Intel 100 Series PMC" rev 0x21 at pci0 dev 31 function 2 not configured
azalia0 at pci0 dev 31 function 3 "Intel 100 Series HD Audio" rev 0x21: msi
azalia0: codecs: Realtek/0x0283, Intel/0x2809, using Realtek/0x0283
audio0 at azalia0
ichiic0 at pci0 dev 31 function 4 "Intel 100 Series SMBus" rev 0x21: apic 2 int 
16
iic0 at ichiic0
em0 at pci0 dev 31 function 6 "Intel I219-V" rev 0x21: msi, address 
f4:4d:30:67:43:8c
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
vmm0 at mainbus0: VMX/EPT
umass0 at uhub0 port 1 configuration 1 interface 0 "SanDisk Cruzer Fit" rev 
2.00/1.27 addr 2
umass0: using SCSI over Bulk-Only
scsibus2 at umass0: 2 targets, initiator 0
sd1 at scsibus2 targ 1 lun 0: <SanDisk, Cruzer Fit, 1.27> SCSI4 0/direct 
removable serial.07815571050822108160
sd1: 15267MB, 512 bytes/sector, 31266816 sectors
uhub1 at uhub0 port 2 configuration 1 interface 0 "Genesys Logic USB2.0 Hub" 
rev 2.00/77.60 addr 3
uhidev0 at uhub1 port 1 configuration 1 interface 0 "Microsoft Microsoft 
5-Button Mouse with IntelliEye(TM)" rev 1.10/3.00 addr 4
uhidev0: iclass 3/1
ums0 at uhidev0: 5 buttons, Z dir
wsmouse0 at ums0 mux 0
uhub2 at uhub1 port 2 configuration 1 interface 0 "Apple Inc. Keyboard Hub" rev 
2.00/96.15 addr 5
uhidev1 at uhub2 port 2 configuration 1 interface 0 "Apple Inc. Apple Keyboard" 
rev 2.00/0.70 addr 6
uhidev1: iclass 3/1
ukbd0 at uhidev1: 8 variable keys, 5 key codes, country code 13
wskbd0 at ukbd0: console keyboard, using wsdisplay0
uhidev2 at uhub2 port 2 configuration 1 interface 1 "Apple Inc. Apple Keyboard" 
rev 2.00/0.70 addr 6
uhidev2: iclass 3/0
uhid0 at uhidev2: input=1, output=0, feature=0
ugen0 at uhub0 port 7 "Intel Bluetooth" rev 2.00/0.01 addr 7
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
softraid0: sd2 was not shutdown properly
sd2 at scsibus4 targ 1 lun 0: <OPENBSD, SR CRYPTO, 006> SCSI2 0/direct fixed
sd2: 457860MB, 512 bytes/sector, 937697393 sectors
root on sd2a (1cae2f5f79b7f28f.a) swap on sd2b dump on sd2b
WARNING: / was not properly unmounted

Reply via email to