Re: OpenBSD and multitasking

2022-04-27 Thread Marc Espie
On Tue, Apr 26, 2022 at 01:40:46PM +0200, Stefan Hagen wrote:
> Mihai Popescu wrote (2022-04-26 01:13 CEST):
> > I use OpenBSD amd64 snapshots on the following dmesg hardware.
> > The download rate on a browser was slow and I figured out with some
> > memory mapped partition that disk transfer rate was slow.
> > I can bear this since I'm not into large file transfer business. But
> > here is another interesting fact: each time my disk is used by some
> > file transfer, all the running applications, mostly GUI based are
> > stalling - that includes mostly chromium ( even if it is not chromium
> > that it does the disk data transfer).
> > 
> > My questions are: is something incorrectly set up on my computer,
> > regarding the multitasking?
> > I understand disk operations are slow, but may I say that kernel is
> > dragged in that slow transfer too (no DMA, no cache, etc.)?
> > Does this happens to all users, but since there are more powerful
> > configuration involved the delay is not so noticeable?
> 
> Mount your file systems with the softdep flag (described in mount(8)).
> This should bring HDD i/o to what you're used to on other operating 
> systems.

This has the unfortunate side-effect that this is not quite the official
configuration. softdep is somewhat supported but if you experience panics
related to this, good luck getting them fixed.

(I've stopped using softdep entirely on bulk machines. NFS having burps
from time to time is enough to cope with)



Re: OpenBSD and multitasking

2022-04-27 Thread Janne Johansson
Den tis 26 apr. 2022 kl 22:50 skrev Mihai Popescu :
> $ time dd if=/dev/zero of=test10g.dat bs=1m count=10240 conv=fsync
> 10737418240 bytes transferred in 260.289 secs (41251827 bytes/sec)
> $ time dd if=/dev/zero of=test10g.dat bs=1m count=10240 conv=fsync
> 10737418240 bytes transferred in 24.006 secs (447266094 bytes/sec)
>
> The test is done using a mechanical disk and a ssd one. I think the
> dude telling that some entry level ssd have the same performance like
> mechanical disks is the same with the one telling ssd will wear very
> fast. My mistake to believe it without testing.

Even if the best-case transfer speeds were the same, the zero seek
times of ssds will make a huge difference when dealing with all other
kinds of IO than "super large linear writes", which is basically 99.9%
of all IO you do when using the computer.

-- 
May the most significant bit of your life be positive.



Re: OpenBSD and multitasking

2022-04-26 Thread Mihai Popescu
$ time dd if=/dev/zero of=test10g.dat bs=1m count=10240 conv=fsync
10240+0 records in
10240+0 records out
10737418240 bytes transferred in 260.289 secs (41251827 bytes/sec)
4m20.32s real 0m00.01s user 0m17.70s system

$ time dd if=/dev/zero of=test10g.dat bs=1m count=10240 conv=fsync
10240+0 records in
10240+0 records out
10737418240 bytes transferred in 24.006 secs (447266094 bytes/sec)
0m24.00s real 0m00.02s user 0m18.24s system

The test is done using a mechanical disk and a ssd one. I think the
dude telling that some entry level ssd have the same performance like
mechanical disks is the same with the one telling ssd will wear very
fast. My mistake to believe it without testing.

Thank you for your fault tolerance.



Re: OpenBSD and multitasking

2022-04-26 Thread Jan Stary
This is just to confirm that both Chrome and Firefox
perform _much_ better after I replaced a HDD with a SSD
in a Thinkpad T410.

On Apr 26 13:40:46, sh+openbsd-m...@codevoid.de wrote:
> Mihai Popescu wrote (2022-04-26 01:13 CEST):
> > I use OpenBSD amd64 snapshots on the following dmesg hardware.
> > The download rate on a browser was slow and I figured out with some
> > memory mapped partition that disk transfer rate was slow.
> > I can bear this since I'm not into large file transfer business. But
> > here is another interesting fact: each time my disk is used by some
> > file transfer, all the running applications, mostly GUI based are
> > stalling - that includes mostly chromium ( even if it is not chromium
> > that it does the disk data transfer).
> > 
> > My questions are: is something incorrectly set up on my computer,
> > regarding the multitasking?
> > I understand disk operations are slow, but may I say that kernel is
> > dragged in that slow transfer too (no DMA, no cache, etc.)?
> > Does this happens to all users, but since there are more powerful
> > configuration involved the delay is not so noticeable?
> 
> Mount your file systems with the softdep flag (described in mount(8)).
> This should bring HDD i/o to what you're used to on other operating 
> systems.
> 
> > I know it is hard to project this, but can someone give me a hint
> > about a minimum hardware to allow using chromium with no delays,
> > please?
> 
> "No" delays? You need one of these https://www.oreillyauto.com/flux-capacitor
> so you can jump over the delays. The good news is, that the slowness
> of your machine wouldn't matter anymore. Unfortunately this would have
> the side effect that the world around you ages faster. I'd suggest you
> invest into real estate to make the skipped time worth more... but I'm
> getting carried away...
> 
> *scnr*
> 
> > I know, it should be advisable to get the maximum performance
> > hardware, but i'm not in that case.
> 
> This is all very personal. I think chrome+openbsd runs well on 5 year
> old hardware with an SSD.
> 
> Best Regards,
> Stefan
> 
> 



Re: OpenBSD and multitasking

2022-04-26 Thread Stuart Henderson
On 2022-04-26, Mike Larkin  wrote:
> On Tue, Apr 26, 2022 at 02:13:16AM +0300, Mihai Popescu wrote:
>> I can bear this since I'm not into large file transfer business. But
>> here is another interesting fact: each time my disk is used by some
>> file transfer, all the running applications, mostly GUI based are
>> stalling - that includes mostly chromium ( even if it is not chromium
>> that it does the disk data transfer).

I have found MP performance to be poor when doing lots of disk io, in
my case noticed when doing multithreaded searches (the_silver_searcher)
over unpacked source from the whole ports tree, making the machine
often respond poorly when it was running (including lack of response to
keyboard/mouse).

> See comments below. The hardware is ancient. I'd say try running
> chrome on windows on this hardware and you'll probably see it's also
> horrible.

Chrome runs reasonably well on other OS including Windows on much worse
machines than this.

>> avail mem = 7460139008 (7114MB)
>> cpu0: AMD A8-5500B APU with Radeon(tm) HD Graphics, 3194.45 MHz, [...]

not bad really

>> cpu1: disabling user TSC (skew=129)
>> cpu2: disabling user TSC (skew=186)

this is not ideal if you have software calling gettimeofday a lot.
browsers often do.

>> sd0 at scsibus1 targ 0 lun 0:  
>> naa.5000c5006520feaf
>
> HDD, not SSD, and release date of this model is April 2011... Eleven years 
> ago.

at least it's not SMR like many newer HDDs :)

>From Mihai's description it really feels like it's disk io in particular
that's causing the problem. Performance could well be better on OS with
better developed SMP (I don't get the impression that disk io has really
been a target area for our MP work).

I am sure the #1 improvement will be replacing this with SSD, or adding
SSD and moving those filesystems which see frequent access. (Even if
the machine won't boot from NVMe directly, a cheap M.2 NVMe in a PCIe
carrier card for /usr/local, /home, /tmp would have a good cost/benefit
ratio).

Alternatively this hardware will likely work better with another OS.
Choice of OS is a trade-off.




Re: OpenBSD and multitasking

2022-04-25 Thread Joe Gidi
> Hello,
>
> I use OpenBSD amd64 snapshots on the following dmesg hardware.
> The download rate on a browser was slow and I figured out with some
> memory mapped partition that disk transfer rate was slow.
> I can bear this since I'm not into large file transfer business. But
> here is another interesting fact: each time my disk is used by some
> file transfer, all the running applications, mostly GUI based are
> stalling - that includes mostly chromium ( even if it is not chromium
> that it does the disk data transfer).
>
> My questions are: is something incorrectly set up on my computer,
> regarding the multitasking?
> I understand disk operations are slow, but may I say that kernel is
> dragged in that slow transfer too (no DMA, no cache, etc.)?
> Does this happens to all users, but since there are more powerful
> configuration involved the delay is not so noticeable?
>
> I know it is hard to project this, but can someone give me a hint
> about a minimum hardware to allow using chromium with no delays,
> please?
> I know, it should be advisable to get the maximum performance
> hardware, but i'm not in that case.



> sd0 at scsibus1 targ 0 lun 0: 
> naa.5000c5006520feaf
> sd0: 238475MB, 512 bytes/sector, 488397168 sectors

You're running on a Seagate 7200 RPM spinning disk. Migrate to an SSD.
Literally any SSD. I don't know where you are, but here, an equivalent
size generic SATA SSD costs $40 USD and will be exponentially faster for
random read/write and IOPS.

Trying to run heavy modern desktop applications like Chromium from a
spinning disk is an exercise in masochism. You're also running Chromium
with 8 GB of RAM, so it's entirely possible you're running into swap,
which will REALLY kill your performance, especially on a spinning disk...

-- 

Joe Gidi
j...@entropicblur.com

"You cannot buy skill." -- Ross Seyfried



Re: OpenBSD and multitasking

2022-04-25 Thread Mike Larkin
On Tue, Apr 26, 2022 at 02:13:16AM +0300, Mihai Popescu wrote:
> Hello,
>
> I use OpenBSD amd64 snapshots on the following dmesg hardware.
> The download rate on a browser was slow and I figured out with some
> memory mapped partition that disk transfer rate was slow.
> I can bear this since I'm not into large file transfer business. But
> here is another interesting fact: each time my disk is used by some
> file transfer, all the running applications, mostly GUI based are
> stalling - that includes mostly chromium ( even if it is not chromium
> that it does the disk data transfer).
>
> My questions are: is something incorrectly set up on my computer,
> regarding the multitasking?
> I understand disk operations are slow, but may I say that kernel is
> dragged in that slow transfer too (no DMA, no cache, etc.)?
> Does this happens to all users, but since there are more powerful
> configuration involved the delay is not so noticeable?
>
> I know it is hard to project this, but can someone give me a hint
> about a minimum hardware to allow using chromium with no delays,
> please?

See comments below. The hardware is ancient. I'd say try running
chrome on windows on this hardware and you'll probably see it's also
horrible.

"minimum hardware to allow using chromium with no delays" is probably
a machine with a fast nvme drive, 8+ cores, and 16+ gb ram.

> I know, it should be advisable to get the maximum performance
> hardware, but i'm not in that case.
>
> OpenBSD 7.1-current (GENERIC.MP) #483: Sat Apr 23 05:33:19 MDT 2022
> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> real mem = 7711170560 (7353MB)
> avail mem = 7460139008 (7114MB)
> random: good seed from bootblocks
> mpath0 at root
> scsibus0 at mpath0: 256 targets
> mainbus0 at root
> bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xe86ed (64 entries)
> bios0: vendor Hewlett-Packard version "K06 v02.77" date 03/22/2018
> bios0: Hewlett-Packard HP Compaq Pro 6305 SFF

This is an almost 9 year old machine. Release date September 2013.
Also, see below.

> acpi0 at bios0: ACPI 5.0
> acpi0: sleep states S0 S3 S4 S5
> acpi0: tables DSDT FACP APIC FPDT MCFG HPET SSDT MSDM TCPA IVRS VFCT
> SSDT SSDT CRAT
> acpi0: wakeup devices SBAZ(S4) PS2K(S3) PS2M(S3) P0PC(S4) PE20(S4)
> PE21(S4) PE22(S4) BNIC(S4) PE23(S4) BR12(S4) BR14(S4) OHC1(S3)
> EHC1(S3) OHC2(S3) EHC2(S3) OHC3(S3) [...]
> acpitimer0 at acpi0: 3579545 Hz, 32 bits
> acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
> cpu0 at mainbus0: apid 16 (boot processor)
> cpu0: AMD A8-5500B APU with Radeon(tm) HD Graphics, 3194.45 MHz, 15-10-01
> cpu0: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,XOP,SKINIT,WDT,FMA4,TCE,NODEID,TBM,TOPEXT,CPCTR,ITSC,BMI1,IBPB
> cpu0: 64KB 64b/line 2-way I-cache, 16KB 64b/line 4-way D-cache, 2MB
> 64b/line 16-way L2 cache
> cpu0: ITLB 48 4KB entries fully associative, 24 4MB entries fully associative
> cpu0: DTLB 64 4KB entries fully associative, 64 4MB entries fully associative
> cpu0: smt 0, core 0, package 0
> mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
> cpu0: apic clock running at 99MHz
> cpu0: mwait min=64, max=64, IBE
> cpu1 at mainbus0: apid 17 (application processor)
> cpu1: AMD A8-5500B APU with Radeon(tm) HD Graphics, 3194.05 MHz, 15-10-01
> cpu1: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,XOP,SKINIT,WDT,FMA4,TCE,NODEID,TBM,TOPEXT,CPCTR,ITSC,BMI1,IBPB
> cpu1: 64KB 64b/line 2-way I-cache, 16KB 64b/line 4-way D-cache, 2MB
> 64b/line 16-way L2 cache
> cpu1: ITLB 48 4KB entries fully associative, 24 4MB entries fully associative
> cpu1: DTLB 64 4KB entries fully associative, 64 4MB entries fully associative
> cpu1: disabling user TSC (skew=129)
> cpu1: smt 1, core 0, package 0
> cpu2 at mainbus0: apid 18 (application processor)
> cpu2: AMD A8-5500B APU with Radeon(tm) HD Graphics, 3194.05 MHz, 15-10-01
> cpu2: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,XOP,SKINIT,WDT,FMA4,TCE,NODEID,TBM,TOPEXT,CPCTR,ITSC,BMI1,IBPB
> cpu2: 64KB 64b/line 2-way I-cache, 16KB 64b/line 4-way D-cache, 2MB
> 64b/line 16-way L2 cache
> cpu2: ITLB 48 4KB entries fully associative, 24 4MB entries fully associative
> cpu2: DTLB 64 4KB entries fully associative, 64 4MB entries fully associative
> cpu2: disabling user TSC (skew=186)
> cpu2: smt 0, core 1, package 0
> cpu3 at mainbus0: apid 

OpenBSD and multitasking

2022-04-25 Thread Mihai Popescu
Hello,

I use OpenBSD amd64 snapshots on the following dmesg hardware.
The download rate on a browser was slow and I figured out with some
memory mapped partition that disk transfer rate was slow.
I can bear this since I'm not into large file transfer business. But
here is another interesting fact: each time my disk is used by some
file transfer, all the running applications, mostly GUI based are
stalling - that includes mostly chromium ( even if it is not chromium
that it does the disk data transfer).

My questions are: is something incorrectly set up on my computer,
regarding the multitasking?
I understand disk operations are slow, but may I say that kernel is
dragged in that slow transfer too (no DMA, no cache, etc.)?
Does this happens to all users, but since there are more powerful
configuration involved the delay is not so noticeable?

I know it is hard to project this, but can someone give me a hint
about a minimum hardware to allow using chromium with no delays,
please?
I know, it should be advisable to get the maximum performance
hardware, but i'm not in that case.

OpenBSD 7.1-current (GENERIC.MP) #483: Sat Apr 23 05:33:19 MDT 2022
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 7711170560 (7353MB)
avail mem = 7460139008 (7114MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xe86ed (64 entries)
bios0: vendor Hewlett-Packard version "K06 v02.77" date 03/22/2018
bios0: Hewlett-Packard HP Compaq Pro 6305 SFF
acpi0 at bios0: ACPI 5.0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC FPDT MCFG HPET SSDT MSDM TCPA IVRS VFCT
SSDT SSDT CRAT
acpi0: wakeup devices SBAZ(S4) PS2K(S3) PS2M(S3) P0PC(S4) PE20(S4)
PE21(S4) PE22(S4) BNIC(S4) PE23(S4) BR12(S4) BR14(S4) OHC1(S3)
EHC1(S3) OHC2(S3) EHC2(S3) OHC3(S3) [...]
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 16 (boot processor)
cpu0: AMD A8-5500B APU with Radeon(tm) HD Graphics, 3194.45 MHz, 15-10-01
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,XOP,SKINIT,WDT,FMA4,TCE,NODEID,TBM,TOPEXT,CPCTR,ITSC,BMI1,IBPB
cpu0: 64KB 64b/line 2-way I-cache, 16KB 64b/line 4-way D-cache, 2MB
64b/line 16-way L2 cache
cpu0: ITLB 48 4KB entries fully associative, 24 4MB entries fully associative
cpu0: DTLB 64 4KB entries fully associative, 64 4MB entries fully associative
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 99MHz
cpu0: mwait min=64, max=64, IBE
cpu1 at mainbus0: apid 17 (application processor)
cpu1: AMD A8-5500B APU with Radeon(tm) HD Graphics, 3194.05 MHz, 15-10-01
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,XOP,SKINIT,WDT,FMA4,TCE,NODEID,TBM,TOPEXT,CPCTR,ITSC,BMI1,IBPB
cpu1: 64KB 64b/line 2-way I-cache, 16KB 64b/line 4-way D-cache, 2MB
64b/line 16-way L2 cache
cpu1: ITLB 48 4KB entries fully associative, 24 4MB entries fully associative
cpu1: DTLB 64 4KB entries fully associative, 64 4MB entries fully associative
cpu1: disabling user TSC (skew=129)
cpu1: smt 1, core 0, package 0
cpu2 at mainbus0: apid 18 (application processor)
cpu2: AMD A8-5500B APU with Radeon(tm) HD Graphics, 3194.05 MHz, 15-10-01
cpu2: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,XOP,SKINIT,WDT,FMA4,TCE,NODEID,TBM,TOPEXT,CPCTR,ITSC,BMI1,IBPB
cpu2: 64KB 64b/line 2-way I-cache, 16KB 64b/line 4-way D-cache, 2MB
64b/line 16-way L2 cache
cpu2: ITLB 48 4KB entries fully associative, 24 4MB entries fully associative
cpu2: DTLB 64 4KB entries fully associative, 64 4MB entries fully associative
cpu2: disabling user TSC (skew=186)
cpu2: smt 0, core 1, package 0
cpu3 at mainbus0: apid 19 (application processor)
cpu3: AMD A8-5500B APU with Radeon(tm) HD Graphics, 3194.05 MHz, 15-10-01
cpu3: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,XOP,SKINIT,WDT,FMA4,TCE,NODEID,TBM,TOPEXT,CPCTR,ITSC,BMI1,IBPB
cpu3: 64KB 64b/line 2-way I-cache, 16KB 64b/line 4-way D-cache, 2MB
64b/line 16-way L2 cache
cpu3: ITLB 48 4KB entries fully