<pog>
my wife is playing the outer worlds rn and ash voiced a compaion character
<pog>
and she voiced chloe in life is strange
<zid>
outer worlds is the game I confuse with outer wilds
<pog>
yes
<pog>
my wife also recently played outer wilds
<pog>
i was equally confused
<pog>
they're nothign alike
<Mondenkind>
your wife is nothing like outer wilds?
<zid>
I FUCKING KNEW IT
<Mondenkind>
uh you might wanna get that checked out
<zid>
is it monday yet
<pog>
she does explode every 20ish minutes and reset time
<zid>
I wanna read p5v9 epiloggguueee
<zid>
22 minutes
<pog>
yeah
<zid>
I'm sitting here rocking back and forth staring at a wall, waiting to read a single chapter release
<zid>
and nikolapdp has like 29 volumes left to read and he won't even touch em
<zid>
I've never hated someone more in my life
<Mondenkind>
have you considered trying to make friends with people who already like shitty chinese serials?
<zid>
chinese? wtf?
<zid>
who'd read chinese trash
<zid>
the fuck Mondenkind
<heat>
my ext2 truncate has an annoying bug i can't find
<heat>
:(
<geist>
oooh what does the carnage look like?
<heat>
fsx was failing really early, then i removed some stuff, now it's failing but somewhat late, after 200k+ ops
<heat>
fsx does a bunch of truncate up + down ops that you'll never really see in real software
<heat>
because, erm, who does that
<heat>
usually you either truncate up or O_TRUNC down to 0
<zid>
truncate down requires a full defrag I assume?
<zid>
"no" is my answer, ngl
<zid>
"defrag with this special fsck flag to move everything offline first"
<geist>
mmm truncates along with writes and reads at the same time is a real baddie too
<heat>
oh im not dealing with that yet
<heat>
i *need* to, eventually, real soon probably
<geist>
how does it fail?
<zid>
-ENOSPC, done, phew
solaare has quit [Ping timeout: 255 seconds]
<heat>
data miscompare
<geist>
ah oh fun
<geist>
some partial last block thing i bet?
<heat>
that could be it, it could also be that i'm slightly screwing up some truncate block table zeroing logic, and the code bmaps to the old block
<heat>
i need to write some better truncate helpers anyway
<zid>
I hope that tool is as good as the gameboy test roms we used to have
<zid>
The way it reported errors, after running a suite of tests, was to give you a crc32 that didn't match.
<zid>
"Yea, ram is wrong, good luck"
<heat>
fsx can give you a log of operations, the good file, and the bad file
<heat>
everything it does on the FS it replicates in-memory
<heat>
also gives you the seed it used
<geist>
hmm, this sounds nice. i remember you or someone talking about it a few months back
<zid>
Sounds too good
<heat>
its neat, tests everything except... concurrency
<zid>
It must be a trap
<zid>
Which is where all the bugs are, no doubt
<Mondenkind>
heat there's a very simple solution to that problem
<Mondenkind>
just slap a big ol lock over everything!
<heat>
not all of them, but yes it's not perfect
<Mondenkind>
boom, no concurrency
<heat>
BIG OL
<heat>
-- theodore de raadt
[_] has joined #osdev
<Mondenkind>
openbsd full of office ladies😔
<pog>
hi
<zid>
big office ladies, specifically
<Mondenkind>
hi
<pog>
i'm a big office lady
<zid>
No you're a giant office lady
<zid>
shingeki no gog
<pog>
i'm trying
* pog
flex
<Mondenkind>
no you're a cat
<heat>
geist, fwiw it's still not perfect and there are a lot of problems it won't catch
<heat>
fs testing endgame would be to run xfstests
<heat>
which includes a bunch of tools and specific regression tests
<geist>
and re: lock, it's still not that heat doesn't have a lock or whatnot, there are just a tremendous amount of edge cases in that code
<geist>
truncating from anything to anything from anything will get you to catch every single scenario
[itchyjunk] has quit [Ping timeout: 268 seconds]
<geist>
especially if you're fully utilizing sparse blocks
<zid>
I saw someone moaning the other day that he updated his kernel
<zid>
and as part of a bugfix they'd made a BKL around the fs on truncate
<zid>
so he accidentally locked his filesystem up for 3 days
<geist>
truncate is a biatch, though move is more of one
<geist>
rename specifically
<heat>
oh fuck rename
<geist>
a RW lock around every file is pretty decent solution for some time
<geist>
but rename touches up to 4 inodes at the same time, so now you have to deal with all of those locks
<heat>
yeah but that's not a solution that would satisfy me
<geist>
that's a fine solution
<heat>
because it DOES NOT SCALE
<heat>
LITERALLY WEBDEV
pretty_dumm_guy has quit [Ping timeout: 252 seconds]
<geist>
not really, thats a pretty good solution
<geist>
RW lock per file is quite sufficient for most use cases
<heat>
sir, my totally real 20 threads hammering at the same file using the page cache is not working well
* geist
shrugs, suit yourself
<geist>
note it's per file, not per FS
<heat>
i know, im joking
<geist>
but in the case of rename you have like 4 inodes involved so it ends up being a metadata nightmare
<geist>
doubleplus so if you have a journal, since the transaction that can generate can be huge
pretty_dumm_guy has joined #osdev
<heat>
but i do like to do things "properly" aka the hardest path i can possibly take. and that would involve not having big rwlocks around file ops
<geist>
i remember back in the beos days there was a fatal flaw where you could synthesize a crazy situation to blow the journal by generating a transaction that exceeded the total length of it, with a rename()
<heat>
heh
<geist>
oh no, put the rwlocks inside the fs implementation, so it can microoptimize
<mcrod>
right, that's why I had __attribute__((packed)) and tried to do it manually
<mcrod>
but I guess I fucked up
<geist>
but wat the u16s are 2 byte variables right?
<mcrod>
yes
<geist>
when you pack them in it'll then misalign the 32bit one, etc
<geist>
you're counting things based on the ordinal, not on the byte position
<geist>
that's all kinda messed up
<heat>
geist, i think the big race condition in truncate is metadata-related. like having a ->readpage looking at metadata while you're truncating on the other end. so you need a rwlock there. all the other logic for carefully shooting down pages in the page cache, etc is required anyway
<geist>
that number on the right should be number of *32 bit positions* and then you're mixing in 16 bit stuff
<zid>
what are cp2.ccr.regs[31]
<heat>
because the rwlock doesn't help you if the pages are mmapped
<mcrod>
what do you mean "what are"
<zid>
I mean what are
<mcrod>
well, _it_ is an array of unsigned 32-bit values
<heat>
oh, i know why
<heat>
endianness
<mcrod>
fucking christ
<mcrod>
yes
<mcrod>
i'm just going to go crawl in a hole now
<heat>
or at least you're... confusing me
<zid>
why not %p them
<mcrod>
wait no that's not the right answer
<heat>
DQA and DQB are switched up in the u32
<zid>
and get a definitive number
<heat>
i told him to get some static asserts
<zid>
(also why does cp2 use cp0's number of regs?)
<mcrod>
just the name
<zid>
R33 is a bitch btw
<heat>
you're making me pull up godbolt
<heat>
fuck you
<mcrod>
zid: oh, i forgot you're in the playstation server
<mcrod>
er discord
<zid>
I am yea, I mostly ignore it because it's full of zoomer kids though
<mcrod>
I can't take the manual casting anymore
<mcrod>
that's why I'm doing this union shit
<mcrod>
it just makes sense
<mcrod>
and looks cleaner
<heat>
philadelphia man has amnesia
<zid>
I just.. use a define
solaare has joined #osdev
<zid>
#define IR2 blah, done
<zid>
what do you need the indexed version for btw?
<mcrod>
e.g., CTC2; if not FLAG register (which has special bullshit when you write to it), CP2_CCR[rd] = GPR[rt]
<mcrod>
that's basically the only reason it exists
<mcrod>
heat: philadelphia man is sad
<zid>
I don't understand how this helps though
<zid>
the coprocessor isn't memory mapped
<mcrod>
a) I get nicer debug output in IDEs
<zid>
you need asm("mtc30 rt, rd"); not mmio
<zid>
saying that, I've done precisely a single coprocessor access so far on playstation I think
<zid>
so even making this at all seems suspect
<mcrod>
you've never used GTE?
<heat>
wait, are u dum
<mcrod>
yes
<mcrod>
i don't know what's going on most of the time.
<heat>
u16 H; // 26
<heat>
s16 DQA; // 27
<mcrod>
that's why I come in here shamelessly asking for help most days
<heat>
you're expecting this to go into two separate u32s?
<zid>
he expects it for R33 first
<zid>
heat skipping ahead
<heat>
but R33 will work
<heat>
because of padding
<zid>
yea those will end up inside the same u32
<zid>
cus alignment of 2 is fine for the second one
<heat>
i did not see that second padding, and suggested just taking off packed
<heat>
and mcrod doesn't know the sysv ABI and/or the C spec
<zid>
you can't unpack this enough for it to do that
<zid>
packed will misalign, but unpacked won't super-align :P
<zid>
You'd need a dummy u16 field or just to make it a u32
<heat>
you can rename it STATIC_ASSERT or whatever
<zid>
Wired: You write a visualizer where you initialize it via the array and via all the members and memcmp'd them and spat out some red and green diffs <3
<heat>
i've sent some patches to pahole but they didn't pick them up yet :(
<heat>
but, like, using pahole for this is definitely *not* what pahole is for
<mcrod>
no i know
<mcrod>
but I remember playing with it a while ago
<mcrod>
the point being, it helped to visualize things
<heat>
i guess i'm kind of gatekeeping pahole, but pahole is just overkill and more geered towards either generating other type formats, or analyzing cache line usage and struct layouts
<mcrod>
"or analyzing struct layouts"
<mcrod>
thanks boss.
<heat>
for performance
<mcrod>
yes yes yes
<mcrod>
I get that
<heat>
which is why it helpfully points out cacheline boundaries
<mcrod>
I should reread the lost art of structure packing until it sticks
<bslsk05>
www.catb.org: The Lost Art of Structure Packing
<heat>
that's a webpage for people that don't know their ABI and/or C
<mcrod>
:(
<zid>
mcrod: things have to be aligned
<zid>
The end.
<mcrod>
i understand why things have to be aligned
<zid>
4 4 2 4 makes the last 4 unaligned, so needs padding, 4 4 2 2 4 makes the final 4 not unaligned, so no padding
<zid>
that's literally the rules
<zid>
all both of them
<heat>
C requires natural alignment for scalar types
<zid>
floats and doubles can have some strange alignment != size requirements
<zid>
because of like, sse only loading off a 16b boundary or whatever
<Mondenkind>
padding is bloat
<heat>
struct alignment is IIRC somewhat more contrived, but usually "first member's alignment" applies
<zid>
easy way to think of it
<heat>
structs get padded at the end to their alignment, because obviously "struct S arr[20];" needs to work
<zid>
is just that struct bob * and a pointer to bob's first member are compatible types
<zid>
so if it starts int, it's got int'y memory alignment
<zid>
requirement
<heat>
yeah but i'm not 100% on that applying for every case
<Mondenkind>
? the alignemnt of the struct has to be at least the alignment of the most aligned member
<heat>
riiiiiiiiiiiight
<heat>
like if __attribute__((aligned(N))) is present on a member, you need to be able to handle that
<zid>
that changesnothing
<Mondenkind>
yeah but also like
<Mondenkind>
struct { float x, y; double z; } has an alignment of 8
<Mondenkind>
not 4
<heat>
thank god
<heat>
i don't use floats
<zid>
floats are evil, avoid them
<zid>
especially in structs
<Mondenkind>
int/long whatevs
pretty_dumm_guy has quit [Ping timeout: 268 seconds]
<heat>
who
<heat>
who asked?
pretty_dumm_guy has joined #osdev
<heat>
yeah... i feel stupid now
<heat>
deep down i kind of knew it, i just never realized it was the rule
<zid>
so did we ever figure out why mcrod wanted this struct
<mcrod>
no
<heat>
i think he's tired of his register macros
<mcrod>
yes
<mcrod>
i gave heat a perfectly good explanation
<zid>
right, it is pretty
<zid>
but... how do you use it?
<zid>
cop2 isn't mmio
<mcrod>
you do realize this is a playstation emulator by the way
<zid>
ohhh
<mcrod>
this isn't guest software
<zid>
That makes a *lot* more sense
<zid>
not sure how I was supposed to "realize" that
<mcrod>
I have a good number of GTE instructions going fine
<heat>
mcrod am i getting copyright on the emulator
<mcrod>
you get an attribution for putting up with me when I don't understand what I should already know
<heat>
can we AGPL it
<mcrod>
no
<mcrod>
it's MIT licensed
<heat>
you sure?
<mcrod>
yes
<mcrod>
notice how fast my responses are
<mcrod>
i'm watching you, pedro.
<zid>
mcrod: Do you have enough cd-rom, cpu, etc then that you need gte to get software to run already?
<heat>
i'm not sure how i'm going to sleep at night after this one
<mcrod>
zid: no, I've been running exclusively tests
<mcrod>
at some point of course though, yes, games will come
<zid>
I wish playstation emulation weren't such a shit-show
<mcrod>
you're fucking telling me
<zid>
Like, as a concept
<mcrod>
the tests are awful
<mcrod>
oh
<zid>
not even "every psx emulator is weird"
<heat>
what if i started writing a playstation emulator right now, AGPL licensed
<heat>
just to fuckw ith you
<zid>
emulating a psx itself is weird
<zid>
because.. the rules are made up and the timings don't matter, because it's all driven off that cd-rom
<mcrod>
heat: the last person who did that ended up making one of the most well known playstation emulators in recent memory
<mcrod>
although not to fuck with me
<zid>
and it might take forever to return the sector, or not, so all software is written async'ly
<zid>
which means you can literally just pretend every cpu op takes 127 cycles, or 1 cycle
<zid>
and nothing changes
<mcrod>
yeah, Nic has told me that even his CD-ROM tests will occasionally fail on real hardware, then magically pass
<mcrod>
due to this nondeterminism
<zid>
gameboy has fucking slick tests
<mcrod>
yeah, mooneye is awesome
<mcrod>
or whatever it is
<mcrod>
blargg's tests are nice enough
<zid>
"Oh you wrote back to memory on the wrong cycle in this 7 cycle operation, we caught it and punished you"
<zid>
psx: "Lol, late by 20k cycles, nobody cares"
<heat>
>cycle-accurate emulation
<zid>
I managed to *immediately* find an issue with literally every cd-rom implementation, which was fun
<mcrod>
yeah, apparently you can get away with just assuming every instruction takes 2 cycles, even though that isn't actually true because of pipeline stalls and hazards and such
<heat>
i have now decided to write a ps4 emulator
<zid>
still waiting for redux to fix it, now at least they're aware that.. the cd-rom works how you'd expect
<zid>
not the bizzare thing Pete did in 1995
<zid>
that everybody copy pasted
Vercas9 has quit [Remote host closed the connection]
<Mondenkind>
heat why don't you write a ps6 emulator
<Mondenkind>
corner the market before sony can
<zid>
it breaks duckstation too but that isn't being updated atm, and every other emulator use's pete's plugin
<mcrod>
this is basically why I'm starting with tests first
<mcrod>
even though, you can in fact pass all of the tests and still have totally broken games
<mcrod>
for the aforementioned
<zid>
The mind boggles as to why anybody ever looked at this and thought "yea this is right" tbh, it's really braindead
<mcrod>
from what I understand it's basically a game of heuristics
<mcrod>
and educated guesswork wrt timings
<mcrod>
do you think CD-ROM timings can be AI modeled :')
<zid>
heat: Do you remember the braindead thing the emulator authors did?
<zid>
I've ranted about it before
<heat>
no
Vercas9 has joined #osdev
<zid>
CD-ROM is a pretty normal device, has a busy bit you can poll, and delivers interrupts
<zid>
*every single implementation, won't reset the busy bit if you've got IRQs disabled on the cpu*
<heat>
Mondenkind, i have a physical ps6, it's going to use a shitty kabylake laptop cpu
<heat>
zid, how do you fuck that up
<zid>
They copied from pete, in 1995
<zid>
who didn't know what the fuck he was doing
<zid>
everybody just blindly copy pasted the same cd-rom implementation, seriously
<heat>
i'm confused as to how the cd-rom implementation knows about IRQs being disabled
<mcrod>
you need to understand
<zid>
it's serialized with delivering the irq
<mcrod>
the playstation CD-ROM is the equivalent of printers in terms of evilness
<zid>
deliver_irq(); busy = 0;
<heat>
sounds like a borked design
<zid>
I forget if it's a state machine or if deliver_irq can block and it's threaded, or what
xenos1984 has quit [Read error: Connection reset by peer]
<zid>
yep
<zid>
I can sort of forgive pete, cus it was like, the first attempt
<mcrod>
has anyone put the CD-ROM firmware through ghidra?
<zid>
I think so
<zid>
I know it's written by an idiot though, because it uses the IRQs wrong
<zid>
It has 8 IRQ lines, so they decided to use them to *send an integer*
<zid>
not to signal 8 different IRQs
<heat>
wha
<heat>
holy shit
<zid>
You get IRQ3 + IRQ1, if it wants to send IRQ4
<zid>
err 2 + 1 if it wants to send IRQ3
<zid>
maths
<mcrod>
i've been trying to slyly get heat interested in playstation emulation
<zid>
rather than it sending irq 1<<3
pog has quit [Ping timeout: 260 seconds]
<heat>
255 irqs with 8 lines
<heat>
sgtm!
<zid>
ikr?
<zid>
It's like the x86 pic, but.. broken
<heat>
how do you decode it properly?
<zid>
just catch an irq and clear all interrupt bits
<heat>
how does that help?
<zid>
it's just not really an issue
pretty_dumm_guy has quit [Ping timeout: 276 seconds]
<heat>
my particular concern is that raising the 8 lines individually may create a weird race condition
<zid>
it just means the actual vector you get with the IRQ is retarded
<zid>
and the mask bits are useless
<zid>
because it just turns IRQ5 into IRQ4 instead of masking it
<heat>
mcrod, btw, not happening
<zid>
heat: cpu just does if(irq_pending) irq(); at the start of each instruction, as you'd.. expect
<mcrod>
heat: good idea.
<zid>
then you check what the interrupt number is in the handler and switch() on it
pretty_dumm_guy has joined #osdev
<geist>
iirc the sort of default thing qemu emulates for mips uses a PIC too
<zid>
then tell the cd-rom that you've acknowledged all 8 interrupt sources
<geist>
basically a PC with a mips core
<zid>
rather than acknowlding just one interrupt
<zid>
cus it probably sent you fucking 3 bits at once
<zid>
and it means 1 interrupt not three, cus it's dumb
<geist>
oh wow. that's interesting
<geist>
is there any way to then after the fact query the status of the individual irqs?
<zid>
Like, you're *supposed* to do, if you're smart, interrupt 0 = lid open, interrupt 1 = data ready, etc
<geist>
if it triggers 7 and 8 does it send you 15?
<geist>
well, or 6 and 7 etc watever
<zid>
but it will send you LID | DATA, to mean, 'interrupt 3' (I mixed 0 and 1 indexing, go me)
<zid>
so there's basically just a status code and a single interrupt instead
<geist>
wait, so it does send you orred bits? or does it or the number?
<geist>
like its (3 | 4) or its ((1<<3) | (1<<4))?
<zid>
it sends 1<<1 | 1<<4 to mean '5'
<zid>
not 1<<5
<geist>
sure, but then in this case 5 is any combinatino of the other ones?
<zid>
so you get *two* interrupts (off the same IRQ)
<zid>
You just suddenly have 2 pending interrupts off that IRQ line
<geist>
sure, but you get a single vector right? because mips only has one irq vector
<zid>
instead of one, number 5, you get 1 and 4
<zid>
yea, it works, it's just wrong and stupid
<geist>
ah okay, so it's just wrong and stupid
<zid>
obviously not what was intended, especially because there are mask bits for these lines
<zid>
so I can mask interrupt 4
<geist>
yeah that sounds like someone didn't read a spec properly in two different teams or company
<zid>
and turn all interrupt 5s into interrupt 1s
<geist>
aaah yeah now i see the problem. the masking bits
<geist>
yeah that's pretty messed up
<zid>
they just missed a 1<< in the firmware
<geist>
yah
<geist>
but obviously could't fix it after the fact
<zid>
and it makes the interface stupid and nonsense, compared to what it should be :(
<geist>
so i guess you have no choice but to unmask everything and then ack the shit you dont care about
<zid>
Yea, you just ack all 8, every time
navi has quit [Quit: WeeChat 4.1.2]
<zid>
and hope you don't get multiple interrupts very quickly and get confused
<heat>
true solid stable software is built on hope
<heat>
locking is for chumps
<geist>
just crash and start over
<zid>
thankfully the cd-rom isn't very chatty, so it works. But I guess that's why they made the mistake, because if it *was* chatty you'd immediately notice it's fucking stupid :P
<geist>
it's the Rust Way ®
<zid>
nic told me about a fun race bug in like, final fantasy tactics or something
<zid>
The game is naturally engine + scripting language
<zid>
and the way the scripting language waits for textures or whatever to load is cdrom_ask_for_shit(); flag = 0;
<zid>
but ofc the scripting language is in some awful internal language that takes all day to execute
<heat>
oopsie
<zid>
so if the cdrom responds too quickly and the irq handler sets flag = 1; too soon, flag = 0; overwrites it and it deadlocks
<geist>
ah yes and of course that's a Big Problem with emulators
<zid>
yea, thankfully for psx, "nearest order of magnitude" is often good enough
<zid>
that's like, the only race you'll see
<heat>
rust would've fixed that
<zid>
because nobody knows how long the gpu takes to do anything, or the cd-rom (for obvious reasons), so all the programs are very async
<zid>
variable framerate, data can show up whenever, etc
<zid>
you can comfortably just run the cpu at 100x the clockrate on almost all games
<zid>
and they don't even ntoice
<geist>
hmm, tat's a fair point
<geist>
i'm trying to remember how access worked on PS3 gameos. clearly it was a hypercall to access storage, but i dunno if it was all synchronous or some sort of async interface
<geist>
it had no real intention of trying to be posixy or anything, so it didn't really need to do anything that lined up with what you think
<zid>
by then, we'd be on 'modern' 3d engines, where you get blurry low quality textures at first until they pop-in later when the real data is there, etc
<zid>
rather than a crash or deadlock
<geist>
you had threads so you could have been required to spin up a storage thread
<zid>
very common to have a 'background colour' for every model, you load all models at level load
<zid>
and textures stream
<zid>
so if the storage lags you just get flat-coloured stuff
<geist>
yah and presumably you had some special place to store the lowest mipmap of everything so you could get that into ram fast
<bslsk05>
guix.gnu.org: The Full-Source Bootstrap: Building from source all the way down — 2023 — Blog — GNU Guix
<Ermine>
heat: trying to build onyx, but make wants $hostname-gcc for some reason
<mjg>
so you contribute to both minix and onyx?
<mjg>
and i thought netbsd developers are nerds
<mjg>
:X
<Ermine>
last time i contributed to minix was a year ago
<Ermine>
does it count?
<mjg>
depends
<mjg>
was it threading?
<Ermine>
no, it was a bugfix
<mjg>
then no
<Ermine>
So I'm onyx guy
<Ermine>
Onyx patchen are getting reviewed actually
<Ermine>
And now I'm just checking performance of a new laptop
<Ermine>
onyx gcc got built in 10 minutes
<zid>
I should update my gentoo
<zid>
I haven't done it in.. months
<zid>
wow, the rsync failed, never had that
<mjg>
i have no idea what's a good time for gcc
<sham1>
GUIX GUIX GUIX GUIX
<mjg>
i wonder how many people get a security alert after they log in from a new device
<mjg>
and then click it was not them
<mjg>
even though it was
<mjg>
has to be majority of clicks
<nortti>
"new" device
<nortti>
love too get one of those alerts every time I log into gmail, on the same computer, same browser, in my google container which persists cookies
<zid>
stop randomizing your user agent smh
<zid>
# emerge -DuNvj @world This will end badly, gogogo
<mcrod>
my cat almost killed me
<mjg>
get a gog
<sham1>
Cat :(
<zid>
mcrod: Tell it it should do better next time?
<mcrod>
she fell off of the headboard
<mcrod>
and sliced my forehead
<mcrod>
if I had been in any other position I would've lost an eye
<mcrod>
no i wanna live zid
<zid>
oh
<zid>
I don't think you die from a scratched cornea btw
<mcrod>
it's hyperbole
<nortti>
how'd the rsync fail?
<zid>
not sure, I redid it and it worked
<mcrod>
she would kill me if she'd slice my jugular
<mcrod>
i'd bleed out and die within 30 seconds, tops
netbsduser has quit [Remote host closed the connection]
netbsduser has joined #osdev
pallas has quit [Quit: Connection closed]
<heat>
Ermine, erm yeah it wants hostname-gcc
<heat>
erm, $HOST-gcc i mean
<Ermine>
but why
<heat>
because you need a cross-compiler
<Ermine>
yes
<heat>
linux's gcc will not work unless heavily massaged through options and/or a spec file
<zid>
and heat is TOO LAZY TO PROVIDE
<Ermine>
So HOST should be x86_64, not name of my computer
<heat>
i do provide
<heat>
yes
<zid>
(That's why my Makefile just uses a hostgcc but keeps having to be updated when various distros default various options)
<heat>
HOST should be x86_64-onyx
<heat>
but the main makefile deals with all that stuff for you
<zid>
What was the one I forgot in user/Makefile for nikolar
<Ermine>
Ah
<zid>
-fno-stack-protector
<Ermine>
opensuse sets HOST to hostname
pallas has joined #osdev
<heat>
lol
<Ermine>
"There's no pain and suffer in opensuse" they said
<zid>
This is 90% of the reason I use gentoo
<heat>
should've used fedora
<heat>
or arch
<zid>
I can slot compilers and I know the system compiler will be set up correctly etc
<zid>
(plus I get headers)
<Ermine>
ikr
<Ermine>
Well, fedora driven me nuts enough, so, arch (btw)
<zid>
arch is gentoo for people who want to say they use arch, over something that works
<sham1>
GUIX GUIX GUIX GUIX
<sham1>
EMBRACE THE FREEDOM
<heat>
onyx
<mjg>
OH nyx
<heat>
use it
<heat>
NIX
<mcrod>
hi
<mjg>
i tried to use it but it crashed when benching
<mjg>
:X
<heat>
HELLO I AM A PERSON AND I USE NIXOS
<mjg>
(benching is my only use case for arch btw)
<Ermine>
Can i get onyx on a flash drive?
<heat>
yeah
<mcrod>
i use ubuntu LTS and I am happy
<heat>
just dd the iso
<heat>
mcrod, holy shit fuck you what a boring distro
<mjg>
did you know amd ships ONYX in their equivalent of ime
<heat>
somehow worse than debian
<mcrod>
it works
<mcrod>
everything I care about works at the very least
<Ermine>
ubuntu is distro with ubsan on
<Ermine>
no way
<mjg>
Ermine: it has a small subset of ubsan
<mjg>
which only adds bound checking
<mjg>
pretend the kernel is written in java, but it is unable to optimize away anything at runtime
<mjg>
and you are there
<heat>
arch had a small 3K hole in its task_struct until i came along and fixed it
<mjg>
you did?
<mjg>
i mean is that committed?
<heat>
to the arch package yeah
<mjg>
url!
<mjg>
dude not only USING arch but submitting a patch makesm e think you will never get a girlfriend
<mcrod>
he won't
<mcrod>
but that's ok
<mcrod>
he has us
<heat>
i didn't submit a patch
<Ermine>
I've installed ubuntu on a bunch of old i3 machines, and it boots SLOWLY
<bslsk05>
gitlab.archlinux.org: CONFIG_LATENCYTOP=y has a huge size overhead for every task_struct and should be disabled (#24) · Issues · Arch Linux / Packaging / Packages / linux · GitLab
<mjg>
then prblem report number
<heat>
FYI LATENCYTOP is enabled in opensuse, fedora and clearlinux
<heat>
so those kernels all have a nice 3KB hole in their task_struct
<mjg>
> atencytop is not even part of the repos
<mjg>
lol
<zid>
why would they enable that by default
<zid>
??
<heat>
for some random obsolete tool that hasn't seen a commit since 09, and whose repos are down
<mjg>
ya man i shit on the bsds a lot, but then you take a criticial look at linux and same stupid problems
<mjg>
fwiw my ubuntu:
<mjg>
# CONFIG_LATENCYTOP is not set
<heat>
yeah debian does not have it set
<heat>
if i can find some time in the next couple of weeks i'll try to submit a patch removing it upstream actually
<zid>
>>> Emerging (165 of 277) sys-libs/glibc-2.38-r10::gentoo
<heat>
it's batshit stupid
<zid>
bye bye cool off by 1 cve :(
<Ermine>
time make -j16 liveiso -> real 1m user 9m18s sys 37s
<mjg>
heat: what's the replacement?
<heat>
ftrace, bcc
<heat>
probably all vastly superior to mr. obsolete tool over there
<Ermine>
for some reason arch boots slowly on hdd to
<heat>
you can't actually download the thing from anywhere except some random debian ftp package tarball
<mjg>
lol
<mjg>
not many places ifdef on it
<heat>
yeah it's pretty much just <big 3KB buffer> and a file that depends on it
<mjg>
sounds like an ez removal as far as actual work goes
<mjg>
arguing with fuckers is another story
<heat>
i am awaren
<mjg>
that's singular mofo
<heat>
i dont caren
<Ermine>
heat: onyx got built in 1minute
<heat>
cool
<heat>
not too off my build times
<heat>
onyx is pretty fast to build
<mjg>
would you accept patches for onyx build under openbsd?
<mjg>
asking for a friend
<heat>
is theo going to submit a patch for that
<Ermine>
why wouldn't it build under openbsd
<mjg>
if it does build you should denote in readme that it is a supported dev platform
<mjg>
even if you need to boot it under linux
<heat>
Ermine, i depend on GNU tooling sometimes
<heat>
some scripts are also #!/bin/bash IIRC
<heat>
like, it doesn't build on macOS
<Ermine>
eh
<Ermine>
heat: Onyx does not show anything when I booted it on my laptop
<Ermine>
black screen
<heat>
oops
<zid>
Your laptop has a special device known as a a 'real cpu'
<zid>
which onyx has never tried to support
<heat>
my kabylake is very real
<zid>
kabylake is not a real cpu wtf
<zid>
It goes sandy, zen3
<mjg>
Ermine: what do you mean your laptop
<heat>
Ermine, what cpu, how much memory, pastebin of the efi memory map
<mjg>
Ermine: you are not trying this on bare metal, are you?
<Ermine>
mjg: I try it on bare metal
<mjg>
LOL
<mjg>
wtf
<nikolar>
Lol
<mjg>
dude
<mjg>
fuck me
<mjg>
probably even heat did not do it
<heat>
sure i did
<mjg>
wut
<heat>
wut wut
<mjg>
enough internet for the day
<heat>
what's the problem?
<mjg>
nothin', move along
<Ermine>
heat: cpu is intel core i7-1360p, 16gb ram
<heat>
this is efi right?
<Ermine>
yes
<nikolar>
heat do you only support efi
<heat>
no
<heat>
but there's a special efi boot path
<Ermine>
there are no new bios laptops on the market
<heat>
i7-1360p is pretty old
<heat>
wait, its not
<heat>
did they fuck up the naming again?
<Ermine>
its raptor lake
<nikolar>
Yes
<nikolar>
Took me a second too heat
<heat>
this is very funny, i suspect the LA57 support may be borked
<nikolar>
Do you support it
<Ermine>
so, how do i get you efi memory map
<zid>
1360 what the fuck is that
<heat>
don't do it just yet
<heat>
Ermine, try it out in KVM with a bunch of memory, -cpu host
<zid>
weird, they just.. neglected a digit in raptor lake -p
<zid>
13600 -> 1360P
<heat>
the p stands for "puck you you dumbass did you think our naming was going to be consistent"
<zid>
defragging the mmu for the next 3 days, please wait
<heat>
that's all bhyve, not gcore
<antranigv>
heat yes, I'm trying to gcore the bhyve process. the bhyve process is stuck, and gcore is stuck as well :) I can send gcore's image as well
<heat>
yeah i want to see gcore
<antranigv>
one sec, rebooting the fat machine. I hat esupermicro
<heat>
although if they're both stuck... maybe something is really screwed up
<antranigv>
heat indeed
<antranigv>
a hard problem to solve, and my knowledge is not deep enough :/
<heat>
the main thread seems to be waiting for memory, all the other ones are blocked in umtx's
<antranigv>
how is it waiting for a memory that has been wired already.
<antranigv>
the memory got wired, grub got started (via grub-bhyve)
<antranigv>
I saw the ubuntu menu
<antranigv>
and then at boot... it got stuck
<heat>
the freebsd kernel is allocating memory for itself
<heat>
nothing to do with wired
<zid>
It's defragging its page tables so it can do a 1.5TB allocation ready for a buffer copy :P
<zid>
(I made this up)
<heat>
oh, i think i know why gcore isn't doing shit
<heat>
if i were to guess, those vm_wait_dom sleeps aren't interruptible or something
<heat>
gcore uses ptrace which needs to interrupt bhyve
<heat>
now, if i were to guess, a vm domain is a NUMA domain, and it's sleeping forever because it can't get any memory from its own domain
<heat>
and because it's all "wired" it can't free any
JerryXiao has quit [Remote host closed the connection]
<Ermine>
what does rss mean?
<heat>
resident set size
tomaw has quit [Remote host closed the connection]
tomaw- has joined #osdev
tomaw- is now known as tomaw
jack_rabbit has joined #osdev
zxrom has joined #osdev
xenos1984 has quit [Ping timeout: 246 seconds]
JerryXiao has joined #osdev
Matt|home has joined #osdev
gxt has quit [Remote host closed the connection]
jack_rabbit has quit [Ping timeout: 268 seconds]
gxt has joined #osdev
xenos1984 has joined #osdev
gxt has quit [Remote host closed the connection]
gxt has joined #osdev
jack_rabbit has joined #osdev
<mjg>
antranigv: what heat said
<mjg>
you are low on memory the sucker is stuck
<antranigv>
mjg I see... well the VM is already 1.5TB, but I have 0.5TB left
<antranigv>
I guess I should lower the VM to say >1TB and then try to dump again
<mjg>
how many sockets are on that box?
<antranigv>
two
<antranigv>
64 core, x2 threads each
<antranigv>
256 total vcores
<antranigv>
and the VM is allocating 240 of them. or 200? I think I lowered it to 200
<mjg>
per usual freebsd behavior this is a malloc call which you can't even abort
<mjg>
there were numerous bugs in the vm which made imbalanced numa memory usage resulting in stalls
<mjg>
which version is this?
<mjg>
i'm guessing you got one domain depleted and that's the one it is waiting for anyway
<antranigv>
mjg I'm on 14.0-RELEASE
<mjg>
bummer
<mjg>
can you do something to free up some memory?
<antranigv>
mjg I am also doing vCPU<>CPU mapping as needed
<mjg>
to hopefully unstuck the sucker
<antranigv>
well, the machine is supposed to run FreeBSD for storage and VM with Ubuntu for scientists. so all the memory is either ARC or VM. kinda stuck there... also, I have no wait to kill bhyve when it gets stuck like this
<heat>
how about you run ubuntu for both
<mjg>
you can probably free up some of the arc
<mjg>
how much is it
<antranigv>
mjg 128, there's 2TB on host, 1.5 for VM and rest for the host.
<mjg>
note it is a bug if it got stuck like this to begin with with memory available
<heat>
the fact that you cant get OOM-killed in this kind of stall is pretty depressing
<mjg>
heat: that's bsd engineering ethos
<mjg>
antranigv: 128mb of arc?
<antranigv>
mjg gb
<mjg>
right, give me a minute
<mjg>
there was a magic knob to regulate its size
<antranigv>
heat 1) I can't stand Linux 2) the controllers had issue with latest Kernel.
<antranigv>
mjg it's the vfs zfs arc max and arc min. I can configure them as needed. no one's connected right now
<mjg>
ye
<mjg>
so i would start with 96G for vfs.zfs.arc.max
<mjg>
can you also: sysctl vfs.vnode
<antranigv>
damn, I totally forgot about that
<mjg>
so what's the output mate
<heat>
>freebsd sucks
<heat>
>can't stand linux
<heat>
HAVE YOU HEARD OF
<mjg>
SOLARIS?
<heat>
S O L A R I S
<antranigv>
We do run OmniOS as well
<mjg>
:]
<mjg>
antranigv: what's the output of sysctl vfs.vnode
<antranigv>
mjg like I said, I forgot to configure vfs.vnode. any thoughts?
<mjg>
given your vnode count, there is nothing to do there
<mjg>
what you do need to do though is limit arc
<mjg>
if freebsd sucked less it would have asked arc to whack some of it to make room for that allocation
<mjg>
but at least you can do it by hand
<antranigv>
this is what I have now vfs.zfs.arc.max=68719476736 ; vfs.zfs.arc.min=34359738368
<antranigv>
I'll take it downER
<heat>
don't forget to kill -9 gcore and kill -9 bhyve
<mjg>
that wont do fuck
<antranigv>
heat it doesn't even die, I have to reboot
<heat>
because whenever you get malloc unstuck, gcore will consume memory
<heat>
and it'll eat it right up
<mjg>
you literally said it sucks you can't oom the sucker, but now you want to -9 it
<mjg>
:X
<heat>
mjg, make the fatal signal pending
<antranigv>
I just want a way to understand this issue, it happens once every 10ish reboot of the VM, and at the worst time
<mjg>
yo mama is pending
<mjg>
antranigv: the issue is the freebsd vm being bad
<mjg>
antranigv: and poorly integrated vs arc
<heat>
the issue is that so much memory in the domain is being locked that the kernel can't malloc from that domain, so it gets stuck forever waiting for memory
<heat>
and gcore doesn't work because ptrace is signal based, and gcore is ptrace based
<mjg>
i don't see why gcore this to begin with tho
<heat>
they were trying to debug the hang
<mjg>
well the hang is definitely not bhyve itself nor the guest
<mjg>
albeit it is the two which lead up to it
<heat>
yep
<antranigv>
mjg any thoughts?
<antranigv>
mjg rather, any thoughts if the arc change and such would fix the hang?
<mjg>
arc change should workaround the problem
<mjg>
unless your vm ultimately needs so much memory that there is nothing left for the host
<mjg>
i'm looking at the code
<mjg>
it does install a lowmem handler for arc, so something funky is going on
Gurkenglas has joined #osdev
FreeFull has quit [Quit: rebooting]
<netbsduser>
heat: zfs has a more sophisticated cache called the ARC (after Noah's Arc)
<netbsduser>
it is not integrated with the virtual memory framework (i think it was in Solaris VM2)
FreeFull has joined #osdev
<heat>
so it has a page cache in front of the ARC?
FreeFull_ has joined #osdev
<heat>
or does it skip the page cache for NIH?
<mjg>
it is separate
<netbsduser>
they must either direct all reads/writes through the page cache or they must have INCOHERENT mmap
<netbsduser>
i'm not sure which they chose
<mjg>
the latter
<mjg>
afair
<heat>
oh fuck off
FreeFull_ has quit [Client Quit]
FreeFull has quit [Remote host closed the connection]
<mjg>
no wait, it is coherent, but requires some extra work afair
<heat>
that's a LUL OPENBSD moment
<heat>
aw :)
jack_rabbit has quit [Remote host closed the connection]
<heat>
:(
FreeFull has joined #osdev
jack_rabbit has joined #osdev
<mjg>
i don't remember exactly what's going on there
<antranigv>
I didn't know that osdev has a forum
<antranigv>
is it active?
<mjg>
what are you using omnios for?
<mjg>
serving files to windows?
<antranigv>
it's booting! finally
<antranigv>
mjg DNS, DHCP, LDAP, nginx for now
<heat>
i think the osdev forum is active yeah
<antranigv>
we're also adding gitea, grafana, etc
<antranigv>
oh and I just finished setting up a regional mirror for IPS
<antranigv>
I will do pkgsrc mirror next week, and then a downloads.omnios.org mirror as well
<antranigv>
I think I published a blog post yesterday on mirroring IPS, lemme check. it was so late in the morning, that I forgot if I have
<bslsk05>
<antranigv> Mirroring OmniOS: The Complete Guide; Part OneChapter ⅠI know that “Complete Guide” and “Part One” are oxymorons, but hey, be happy that I’m publishing in parts, otherwise I’d completely ignore this blog post.  Two weeks ago I decided to play with illumos again. I was speaking with a friend and we were sharing our frustrations regarding Open-Source contribution. We write the code, we submit, we get feedback, we
<antranigv>
Ermine I do that, it's pretty simple with the right hardware.... The WiFi sucks tho
<nikolar>
Even better, daily drive openbsd
<antranigv>
OpenBSD actually has better desktop support!
<nikolar>
Oh really
<heat>
better wifi
Maja has joined #osdev
<Ermine>
No, definitely not openbsd
<heat>
but you better hope you're not running an 8-core
<nikolar>
Why's that heat
<mjg>
openbsd definitely has desktop experience, assuming you are low on cores
<Ermine>
it doesn't scale
<mjg>
and need wifi
<mjg>
after the vm work last year (or two?) it perhaps performs tolerably?
<antranigv>
but I am pretty happy with my FreeBSD laptop. altho right now I'm on my macOS
<nikolar>
Gross
<mjg>
do you have wifi on it?
<heat>
mjg, what vm work did they get
<Ermine>
Well, anyway, I'm downloading BtwOS
<mjg>
cherry picks from netbsd
<mjg>
no joke
<mjg>
for some basic multicore awareness
<nikolar>
What's that ermine
<heat>
it's the same distro i use
<heat>
,btw
<mjg>
heat contributes to arch btw
<heat>
i hope i still beat openbsd
<nikolar>
Ah dumb question
<mjg>
heat: dude
<heat>
perhaps i should ask theo for some benchmarks
<mjg>
nobody does not bead freebsd
<antranigv>
mjg on the FreeBSD? yes I do
<mjg>
erm
<mjg>
nobody does not beat openbsd
<heat>
sortix does not beat openbsd
<nikolar>
But that's sortix
<heat>
serenityos does not beat openbsd, probably
<Ermine>
serenityos target is aesthetics, isn't it?
<nikolar>
Yeah I'd expect that
<antranigv>
serenity now, serenity now!
<Ermine>
s/target/goal/
<heat>
serenity's goal is a web browser
<nikolar>
Basically at this point, yeah
<mjg>
sortix?
<mjg>
even in a up setting?
<mjg>
you have to actively fuck up to not beat it
<heat>
sortix is full of big locks, and their file mmap reads everything up-front
<heat>
and the ext2 fs driver is basically single-threaded FUSE AFAIK
<nikolar>
FUSE FUSE FUSE
<zid>
does it beat windows
<mjg>
Łindołs
<heat>
londols
<heat>
lindols*
<mjg>
lentils
<heat>
LINUX
* mjg
burps
<heat>
send patchen mjg
<mjg>
i plan on sending some patchen to linux soon(tm)
<mjg>
got one weird trick for +50%
<mjg>
:X
<mjg>
(converts a back-to-back lock acquire into just one)
<mjg>
and it suddenly degrades drastically less
<mjg>
ofc does not scale
<netbsduser>
heat: it's almost impossible to find a *web scale* hobby kernel
<netbsduser>
yours might be the closest to such as i've came across
<heat>
i'm trying
<heat>
does your scale?
<netbsduser>
i'm working on it
jack_rabbit has quit [Ping timeout: 260 seconds]
<netbsduser>
i sketched out new scheduling code which is locked nicely rather than the current bigly, i need to explore strategies for releasing contention in the vmm
<heat>
contention in the vmm is not too urgent
<netbsduser>
i was able to split it up reasonably
<heat>
having an address space rw semaphore was peak technology like 3 years ago
jack_rabbit has joined #osdev
<heat>
as long as you don't contend too hard when page faulting
<netbsduser>
i haven't tested because i am rewriting it entirely but i think the immediate bottleneck will be the locks around the paging queues
<antranigv>
this server is going to kill me
<heat>
the LRU stuff?
<netbsduser>
merely an approximation of LRU
<netbsduser>
i am not worried about contending the freelists because those are amenable to replication of a small cache of free pages between cores
<heat>
LRU should be batched locally
<heat>
it's what linux and fuchsia do, at least
dude12312414 has joined #osdev
<Ermine>
3 years ago is not that long ago
jack_rabbit has quit [Ping timeout: 256 seconds]
<antranigv>
but it makes me happy to see that this channel is alive and kicking
<netbsduser>
antranigv: and how is this server going to kill you.
<Ermine>
It wasn't dead really
<antranigv>
netbsduser every time I fix an issue, another one arises. most of the issues are hardware issues, because the person who got the server was a Windows sysadmin and though that RAID cards are a good idea xD
<antranigv>
so started changing that
<antranigv>
then the NIC had an issue, so I got something that works properly with FreeBSD and Linux
<antranigv>
and then another storage issue, still have to fix that
<antranigv>
and it's mostly uncharted waters, when it comes to my setup
gbowne1 has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
jack_rabbit has joined #osdev
pretty_dumm_guy has joined #osdev
nyah has joined #osdev
<geist>
oh some other server i guess, not irc?
<netbsduser>
geist: until you said that i was still lost
<geist>
yeah
<kof123>
> called the ARC (after Noah's Arc) > and it's mostly uncharted waters yes, very dangerous server
<heat>
haha
<antranigv>
yes yes, I meant my server, not the IRC server
<antranigv>
kof123 nice find
<sortie>
<Ermine> sortix didn't boot either btw
<sortie>
Hmm?
<sortie>
<heat> sortix is full of big locks, and their file mmap reads everything up-front
<sortie>
That is not true. The user-space filesystem, however, is one special exception where there is a de facto single threading due to the protocol implementation. The TCP also has a single lock, due to the need for sockets to mutually refer to each other, which I failed to properly untangl so big lock it was for now..
<sortie>
All the other locks are very fine grained in the kernel, or they are locked for a very short amount of time.
<Ermine>
Ah, it's probably because sortix 1.0 doesn't have efi I guess
<sortie>
You'll find Sortix is way more fine grained locked than OpenBSD overall and also fully preemptible
<sortie>
Ermine, you can try the latest volatile build if you wanna try out the EFI support, that would be nice to get tried
netbsduser has quit [Ping timeout: 268 seconds]
<heat>
i retract my statement then
<heat>
i did remember that big tcp lock :)
<heat>
Ermine, no, it's just crashing due to something else
<heat>
i *think* that the sortix iso grub was always hybrid?
<sortie>
heat, yeah mostly that part is a mess because listening sockets have the accept queue
<heat>
anyway are you up for testing a patch Ermine? just so i can figure out that crash
<sortie>
heat, that is true, but the hybridness only contains EFI on experimental sortix versions with efi grub
<heat>
it's written against my local branch but should apply to master, i hope
<heat>
sortie, btw how did the listening sockets screw you up?
<sortie>
heat, lots of cases, parent socket needs to access the listen queue, incoming connection may timeout and need to remove itself, cyclic lock dependency, badabing badadoom deadlock territory if you screw up
<heat>
oh, i don't have the concept of parent sockets
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
<bslsk05>
github.com: Onyx/kernel/kernel/net/tcp.cpp at master · heatd/Onyx · GitHub
<heat>
basically all i store is a little struct with syn info in the listening socket's list
<sortie>
I mean sure the synack cache and what not
<heat>
this idea mirrors linux's design, but without the syncookies fallback
<heat>
have i mentioned i'm writing shit linux
<sortie>
But once you the SYN ACK from both sides, the triple handshake
<sortie>
That's when the connection goes ESTAB
<sortie>
That's prior to accept()
<sortie>
Are you saying you don't truly instantiate the connection as ESTAB until accept()?
netbsduser has joined #osdev
<heat>
i create a socket on the SYN ACK's ACK, but it's on the listening sock's accept queue
<sortie>
heat, and what happens if that socket fails due to a connection error or timeout before accept is called, while it's on the listening socket's accept queue?
<heat>
hmm yes i see what you mean, i'm not handling that
<sortie>
Or what if you close() the listening socket? What happens to the connections? That means both the listening socket and the incoming sockets may need to access each other
<sortie>
If at least just to disassociate with each other
<heat>
i should rcu that bit
<heat>
thank you for finding me a design problem
<heat>
i did not think of the possibility that listening socket may need to unqueue itself
<sortie>
Of course, any time, you can use this complimentary 'I told you so' coupon at the Sortix store
<heat>
oh actually, i have a nice pattern for this