Re: [Q] Thinkpad x230, softraid crypto and ZZZ

2016-07-05 Thread Joerg Jung
> On 03 Jul 2016, at 20:30, Mike Larkin  wrote:
>
> On Sun, Jul 03, 2016 at 01:40:39PM -0400, Bryan Everly wrote:
>> Hi,
>>
>> I have suspend to RAM working just fine on this system but when I try to
>> suspend to disk (ZZZ) it just hangs the system (I thought it might just
>> be slow so I let it run for 2 hours and it never completed).  Some data
>> points:
>>
>> 1.  I encrypt my boot drive (sd0) with softraid
>>
>> 2.  My /etc/fstab points to a swap partition outside of the softraid
>> volume and is 2x my RAM size
>>
>
> from your dmesg below:
>> root on sd2a (71b4bf84dbfc9f74.a) swap on sd2b dump on sd2b
>
> That's where we take the swap location from. And that's your sr crypto
> device according to the dmesg. Is this large enough?
>
> Try putting swap inside the sr crypto volume and it should be fine.
> Don't try to use some strange mix of half-crypto and half-not. (why
> someone would go to the effort of encrypting everything *except* swap
> leaves me scratching my head).

If I remember correctly, swap is encrypted by default anyway.

> Note - you have just about the exact same machine as I do, where
> ZZZ was developed. I also have sr crypto in use and 16GB. As a matter of
> fact, the x230 in configs like yours probably received the most testing
> of any machine out there as that's what most developers had during the
> timeframe ZZZ was being shaken out.
>
> Generally, when ZZZing, an x230 with 16GB writes out about 600-800MB
> when doing general purpose stuff like browsing, compiling, etc. Strictly
for
> ZZZ, you don't need 2X RAM size. Just 1X RAM size is "enough" as if we can't
fit
> the hibernated image into a size 1X the size of your RAM, you're hooped
> anyway. This will still take a few minutes as the I/O routines used by
> ZZZ are not optimal, but you should see the disk activity light (faintly,
> as you are using SSDs).
>
> If you still can't get it working, you'll need to do some surgery to
> see what's failing. You'll need to disable X and inteldrm temporarily,
> and remove the call to wsdisplay_suspend around line 2370 in
> sys/dev/acpi/acpi.c to leave the screen on while ZZZing. Then, initiate
> a ZZZ from the text console and see what's going on. Maybe a panic. If you
do
> this test, remember that the suspending and resuming kernels must match
(eg,
> if you ZZZ after booting "/bsd.test", make sure you boot "/bsd.test" again
> after powering back up or it will discard the hibernated image).
>
> -ml
>
>> 3.  I am running apmd with the -A flag
>>
>> 4.  I have 16gb of RAM on the machine
>>
>> Thanks in advance for any help.  Some relevant information below:
>>
>> $ cat /etc/fstab
>>
>> 71b4bf84dbfc9f74.a / ffs rw,softdep,noatime 1 1
>> 71b4bf84dbfc9f74.g /home ffs rw,softdep,noatime,nodev,nosuid 1 2
>> 71b4bf84dbfc9f74.d /tmp ffs rw,softdep,noatime,nodev,nosuid 1 2
>> 71b4bf84dbfc9f74.f /usr ffs rw,softdep,noatime,nodev,wxallowed 1 2
>> 71b4bf84dbfc9f74.e /var ffs rw,softdep,noatime,nodev,nosuid 1 2
>> /dev/sd0b none swap sw 0 0
>>
>> $ doas disklabel -p g sd0
>> # /dev/rsd0c:
>> type: SCSI
>> disk: SCSI disk
>> label: Samsung SSD 850
>> duid: 25c676a513f5cd3d
>> flags:
>> bytes/sector: 512
>> sectors/track: 63
>> tracks/cylinder: 255
>> sectors/cylinder: 16065
>> cylinders: 121601
>> total sectors: 1953525168 # total bytes: 931.5G
>> boundstart: 64
>> boundend: 1953520065
>> drivedata: 0
>>
>> 16 partitions:
>> #size   offset  fstype [fsize bsize  cpg]
>>   a:   899.5G 67119570RAID
>>   b:32.0G   64swap   # none
>>   c:   931.5G0  unused
>>
>> $ doas disklabel -p g sd2
>> # /dev/rsd2c:
>> type: SCSI
>> disk: SCSI disk
>> label: SR CRYPTO
>> duid: 71b4bf84dbfc9f74
>> flags:
>> bytes/sector: 512
>> sectors/track: 63
>> tracks/cylinder: 255
>> sectors/cylinder: 16065
>> cylinders: 117422
>> total sectors: 1886399967 # total bytes: 899.5G
>> boundstart: 64
>> boundend: 1886384430
>> drivedata: 0
>>
>> 16 partitions:
>> #size   offset  fstype [fsize bsize  cpg]
>>   a: 1.0G   64  4.2BSD   2048 163841 # /
>>   c:   899.5G0  unused
>>   d: 4.0G 35904832  4.2BSD   2048 163841 # /tmp
>>   e:35.7G 44293408  4.2BSD   2048 163841 # /var
>>   f:   400.0G119248640  4.2BSD   4096 327681 # /usr
>>   g:   442.6G958100480  4.2BSD   4096 327681 # /home
>>
>> $ cat /etc/rc.conf.local
>> apmd_flags=-A
>> hotplugd_flags=
>> httpd_flags=
>> pkg_scripts=postgresql nagios php56_fpm slim
>> postgresql_flags=-D /var/postgresql/data
>> slowcgi_flags=""
>>
>> $ swapctl -l
>> Device  512-blocks UsedAvail Capacity  Priority
>> /dev/sd0b 671195060 67119506 0%0
>>
>> dmesg attached as dmesg.txt
>> OpenBSD 6.0-beta (GENERIC.MP) #2: Sun Jul  3 10:17:41 EDT 2016
>>

Re: [Q] Thinkpad x230, softraid crypto and ZZZ

2016-07-03 Thread Mike Larkin
On Sun, Jul 03, 2016 at 01:40:39PM -0400, Bryan Everly wrote:
> Hi,
> 
> I have suspend to RAM working just fine on this system but when I try to 
> suspend to disk (ZZZ) it just hangs the system (I thought it might just 
> be slow so I let it run for 2 hours and it never completed).  Some data 
> points:
> 
> 1.  I encrypt my boot drive (sd0) with softraid
> 
> 2.  My /etc/fstab points to a swap partition outside of the softraid 
> volume and is 2x my RAM size
> 

from your dmesg below:
> root on sd2a (71b4bf84dbfc9f74.a) swap on sd2b dump on sd2b

That's where we take the swap location from. And that's your sr crypto
device according to the dmesg. Is this large enough?

Try putting swap inside the sr crypto volume and it should be fine.
Don't try to use some strange mix of half-crypto and half-not. (why
someone would go to the effort of encrypting everything *except* swap
leaves me scratching my head).

Note - you have just about the exact same machine as I do, where
ZZZ was developed. I also have sr crypto in use and 16GB. As a matter of
fact, the x230 in configs like yours probably received the most testing
of any machine out there as that's what most developers had during the
timeframe ZZZ was being shaken out.

Generally, when ZZZing, an x230 with 16GB writes out about 600-800MB
when doing general purpose stuff like browsing, compiling, etc. Strictly for
ZZZ, you don't need 2X RAM size. Just 1X RAM size is "enough" as if we can't fit
the hibernated image into a size 1X the size of your RAM, you're hooped
anyway. This will still take a few minutes as the I/O routines used by
ZZZ are not optimal, but you should see the disk activity light (faintly, 
as you are using SSDs).

If you still can't get it working, you'll need to do some surgery to
see what's failing. You'll need to disable X and inteldrm temporarily,
and remove the call to wsdisplay_suspend around line 2370 in
sys/dev/acpi/acpi.c to leave the screen on while ZZZing. Then, initiate
a ZZZ from the text console and see what's going on. Maybe a panic. If you do
this test, remember that the suspending and resuming kernels must match (eg,
if you ZZZ after booting "/bsd.test", make sure you boot "/bsd.test" again
after powering back up or it will discard the hibernated image).

-ml

> 3.  I am running apmd with the -A flag
> 
> 4.  I have 16gb of RAM on the machine
> 
> Thanks in advance for any help.  Some relevant information below:
> 
> $ cat /etc/fstab
> 
> 71b4bf84dbfc9f74.a / ffs rw,softdep,noatime 1 1
> 71b4bf84dbfc9f74.g /home ffs rw,softdep,noatime,nodev,nosuid 1 2
> 71b4bf84dbfc9f74.d /tmp ffs rw,softdep,noatime,nodev,nosuid 1 2
> 71b4bf84dbfc9f74.f /usr ffs rw,softdep,noatime,nodev,wxallowed 1 2
> 71b4bf84dbfc9f74.e /var ffs rw,softdep,noatime,nodev,nosuid 1 2
> /dev/sd0b none swap sw 0 0
> 
> $ doas disklabel -p g sd0
> # /dev/rsd0c:
> type: SCSI
> disk: SCSI disk
> label: Samsung SSD 850
> duid: 25c676a513f5cd3d
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 255
> sectors/cylinder: 16065
> cylinders: 121601
> total sectors: 1953525168 # total bytes: 931.5G
> boundstart: 64
> boundend: 1953520065
> drivedata: 0
> 
> 16 partitions:
> #size   offset  fstype [fsize bsize  cpg]
>a:   899.5G 67119570RAID
>b:32.0G   64swap   # none
>c:   931.5G0  unused
> 
> $ doas disklabel -p g sd2
> # /dev/rsd2c:
> type: SCSI
> disk: SCSI disk
> label: SR CRYPTO
> duid: 71b4bf84dbfc9f74
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 255
> sectors/cylinder: 16065
> cylinders: 117422
> total sectors: 1886399967 # total bytes: 899.5G
> boundstart: 64
> boundend: 1886384430
> drivedata: 0
> 
> 16 partitions:
> #size   offset  fstype [fsize bsize  cpg]
>a: 1.0G   64  4.2BSD   2048 163841 # /
>c:   899.5G0  unused
>d: 4.0G 35904832  4.2BSD   2048 163841 # /tmp
>e:35.7G 44293408  4.2BSD   2048 163841 # /var
>f:   400.0G119248640  4.2BSD   4096 327681 # /usr
>g:   442.6G958100480  4.2BSD   4096 327681 # /home
> 
> $ cat /etc/rc.conf.local
> apmd_flags=-A
> hotplugd_flags=
> httpd_flags=
> pkg_scripts=postgresql nagios php56_fpm slim
> postgresql_flags=-D /var/postgresql/data
> slowcgi_flags=""
> 
> $ swapctl -l
> Device  512-blocks UsedAvail Capacity  Priority
> /dev/sd0b 671195060 67119506 0%0
> 
> dmesg attached as dmesg.txt
> OpenBSD 6.0-beta (GENERIC.MP) #2: Sun Jul  3 10:17:41 EDT 2016
> bceve...@bcebsd.theeverlys.com:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> real mem = 16844517376 (16064MB)
> avail mem = 16329490432 (15573MB)
> mpath0 at root
> scsibus0 at mpath0: 256 targets
> mainbus0 at root
> bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xdae9d000 (70 entries)
> bios0: vendor 

[Q] Thinkpad x230, softraid crypto and ZZZ

2016-07-03 Thread Bryan Everly
Hi,

I have suspend to RAM working just fine on this system but when I try to 
suspend to disk (ZZZ) it just hangs the system (I thought it might just 
be slow so I let it run for 2 hours and it never completed).  Some data 
points:

1.  I encrypt my boot drive (sd0) with softraid

2.  My /etc/fstab points to a swap partition outside of the softraid 
volume and is 2x my RAM size

3.  I am running apmd with the -A flag

4.  I have 16gb of RAM on the machine

Thanks in advance for any help.  Some relevant information below:

$ cat /etc/fstab

71b4bf84dbfc9f74.a / ffs rw,softdep,noatime 1 1
71b4bf84dbfc9f74.g /home ffs rw,softdep,noatime,nodev,nosuid 1 2
71b4bf84dbfc9f74.d /tmp ffs rw,softdep,noatime,nodev,nosuid 1 2
71b4bf84dbfc9f74.f /usr ffs rw,softdep,noatime,nodev,wxallowed 1 2
71b4bf84dbfc9f74.e /var ffs rw,softdep,noatime,nodev,nosuid 1 2
/dev/sd0b none swap sw 0 0

$ doas disklabel -p g sd0
# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: Samsung SSD 850
duid: 25c676a513f5cd3d
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 121601
total sectors: 1953525168 # total bytes: 931.5G
boundstart: 64
boundend: 1953520065
drivedata: 0

16 partitions:
#size   offset  fstype [fsize bsize  cpg]
   a:   899.5G 67119570RAID
   b:32.0G   64swap   # none
   c:   931.5G0  unused

$ doas disklabel -p g sd2
# /dev/rsd2c:
type: SCSI
disk: SCSI disk
label: SR CRYPTO
duid: 71b4bf84dbfc9f74
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 117422
total sectors: 1886399967 # total bytes: 899.5G
boundstart: 64
boundend: 1886384430
drivedata: 0

16 partitions:
#size   offset  fstype [fsize bsize  cpg]
   a: 1.0G   64  4.2BSD   2048 163841 # /
   c:   899.5G0  unused
   d: 4.0G 35904832  4.2BSD   2048 163841 # /tmp
   e:35.7G 44293408  4.2BSD   2048 163841 # /var
   f:   400.0G119248640  4.2BSD   4096 327681 # /usr
   g:   442.6G958100480  4.2BSD   4096 327681 # /home

$ cat /etc/rc.conf.local
apmd_flags=-A
hotplugd_flags=
httpd_flags=
pkg_scripts=postgresql nagios php56_fpm slim
postgresql_flags=-D /var/postgresql/data
slowcgi_flags=""

$ swapctl -l
Device  512-blocks UsedAvail Capacity  Priority
/dev/sd0b 671195060 67119506 0%0

dmesg attached as dmesg.txt
OpenBSD 6.0-beta (GENERIC.MP) #2: Sun Jul  3 10:17:41 EDT 2016
bceve...@bcebsd.theeverlys.com:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 16844517376 (16064MB)
avail mem = 16329490432 (15573MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xdae9d000 (70 entries)
bios0: vendor LENOVO version "G2ET82WW (2.02 )" date 09/11/2012
bios0: LENOVO 2325HP8
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SLIC TCPA SSDT SSDT SSDT HPET APIC MCFG ECDT FPDT ASF! 
UEFI UEFI POAT SSDT SSDT UEFI DBG2
acpi0: wakeup devices LID_(S4) SLPB(S3) IGBE(S4) EXP3(S4) XHCI(S3) EHC1(S3) 
EHC2(S3) HDEF(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz, 2594.58 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,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS,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 99MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.1.2, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz, 2594.11 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,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS,SENSOR,ARAT
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 1, core 0, package 0
cpu2 at mainbus0: apid 2 (application processor)
cpu2: Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz, 2594.11 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,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS,SENSOR,ARAT
cpu2: 256KB 64b/line 8-way L2 cache
cpu2: smt 0,