klange changed the topic of #osdev to: Operating System Development || Don't ask to ask---just ask! || For 3+ LoC, use a pastebin (for example https://gist.github.com/) || Stats + Old logs: http://osdev-logs.qzx.com New Logs: https://libera.irclog.whitequark.org/osdev || Visit https://wiki.osdev.org and https://forum.osdev.org || Books: https://wiki.osdev.org/Books
<heat> its pretty weird
<zid> 49 48 43 aren't>?
<zid> I assumed that was IHC
<heat> i mean, some are valid ASCII byes, but in the middle of gibberish
<Mutabah> Those are all ascii, just not any sensible arrangement
<zid> first one is ascii but isn't *printable*
<heat> 7E is not ascii
<zid> which is what was meant
<Mutabah> 7E is ~ isn't it?
<zid> 7E is barely ascii, it goes to 7F does it not
<heat> oh shit right
<zid> 0-7F is ascii, 80-FF is 'high code page nonsense'
<Mutabah> ^
<heat> yes, my mistake
<Maja> 20-7e are printable lol
<zid> CODE PAGE 437 FOR LIFE
<zid> The one true encoding
<Maja> meow
<heat> linux
<zid> IBM PC video bios codepage, if it was good enough for dwarf fortress it's good enough for me
netbsduser has quit [Ping timeout: 252 seconds]
* Mondenkind pets Maja
<Maja> ^_^ :3
<heat> every time i look at my disassembly i'm super proud of my zero-cost-except-for-the-decoder branches
<heat> yeehaw microoptimization for the win
<Mondenkind> ZEEEEEEEEEEEROOOOOOOOOOOOOOOOOOOOOOOOOO COOOOST
<heat> zero coost
<zid> Your mum is zero cost
pretty_dumm_guy has quit [Ping timeout: 256 seconds]
<bslsk05> ​'Scale - Hey Ash Whatcha Playin'?' by HAWPOfficial (00:02:21)
<zid> Oh man, haven't seen HAWP in a decade
<zid> is she still invisible
pretty_dumm_guy has joined #osdev
<pog> zid
<zid> pog
<Mondenkind> invisible?
<bslsk05> ​'Puzzle Quest - Hey Ash Whatcha Playin'?' by HAWPOfficial (00:01:22)
<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
<geist> dont lock at the vfs at all
<mcrod> tell me something people
<Mondenkind> mcrod: something people
<mcrod> could someone tell me why when looking at cp2.ccr.regs[31], the value doesn't match up with FLAG? http://pastie.org/p/7gNV2MzXp0wrVQs4qGK0Rw
<bslsk05> ​pastie.org: Pastie
<mcrod> i do not understand
<mcrod> [31] and FLAG should be the same
<geist> some are 32 some are 16?
<geist> it'll pack in different ways
<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> mcrod, https://godbolt.org/z/3r6jYxfcf there we go jack ftfy
<bslsk05> ​godbolt.org: Compiler Explorer
<zid> mcrod: Not really, but there's literally no reason to give a fuck about reg names etc as best as I can tell from reading its docs in the past
<zid> cus you need asm to access the shit anyway
<zid> you just end up writing horrible asm macros
<zid> with the names of the regs
<zid> #define GTE_VXY0_MUL_BY_Z() asm("..."); or whatever
pretty_dumm_guy has quit [Ping timeout: 260 seconds]
<heat> adding a semicolon at the end of a macro is evil
<mcrod> now it looks good
<mcrod> sigh
<heat> honestly considering that you need the explicit padding anyway, you probably want packed
<heat> because this is all finnecky enough to be scary
pretty_dumm_guy has joined #osdev
<zid> heat: in reality I'd probably do { } while(0) it
<heat> uhg i really want to make my truncate raace now
<heat> alas, no time
<heat> i dont yet have a good solution for protecting page mapping from truncation, that doesn't involve the page lock like linux does
<zid> Fun fact, all the spell effects in ff7 were hand-written gte/mips assembly
<heat> mjg, does freebsd avoid page locken when mapping?
<heat> do you have a rwlock of some sort?
pretty_dumm_guy has quit [Ping timeout: 255 seconds]
pretty_dumm_guy has joined #osdev
carbonfiber has quit [Quit: Connection closed for inactivity]
<mcrod> christ
<mcrod> if I had known pahole existed
<mcrod> I wouldn't have needed anyone's help
<mcrod> but thanks anyway
<heat> lmao
<mcrod> shut up :(
<heat> you couldve just used static asserts
<zid> I'd have just.. offsetof'd every element
<zid> via a regex replace
<mcrod> yes i could've done that but I wouldn't have had a very nice visual
<heat> or the BUILD_BUG_ON i carefully coded you some months ago
<zid> or filled it with consants and looked at the memory dump :P
<heat> #define BUILD_BUG_ON(cond) struct __PASTE(build_bug, __COUNTER__) { char elem[!!(cond) - 1]; }
<heat> no need to thank me
<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
<bslsk05> ​godbolt.org: Compiler Explorer
<mcrod> i didn't need you fucks for this
<mcrod> (i love you all)
<mcrod> but yes, pahole is great
<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
<heat> what
<mcrod> .
<heat> is that a book
<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> ​redirect -> www.reddit.com: Blocked
<geist> and then go load the rest of it async
<mcrod> apparently i won’t pass psxtest_gpu
xenos1984 has joined #osdev
<mcrod> challenge accepted i suppose
<zid> Hope you have an SEM
<mcrod> no idea what that is
<zid> passing the graphics tests requires you to document the gpu hardware
<heat> silver elite master
<zid> scanning electron microscope
<mcrod> ah
<mcrod> it doesn’t even run on my PS1
<mcrod> well, correction; it probably does but it probably wants PAL
Matt|home has joined #osdev
edr has quit [Quit: Leaving]
Arthuria has joined #osdev
skipwich has quit [Quit: DISCONNECT]
skipwich has joined #osdev
goliath has quit [Quit: SIGSEGV]
heat has quit [Ping timeout: 260 seconds]
pretty_dumm_guy has quit [Ping timeout: 264 seconds]
Arthuria has quit [Ping timeout: 255 seconds]
theruran has joined #osdev
Vercas9 has quit [Quit: Ping timeout (120 seconds)]
vdamewood has joined #osdev
Affliction has quit [Quit: Read error: Connection reset by beer]
Affliction has joined #osdev
bradd has quit [Ping timeout: 264 seconds]
rustyy has quit [Quit: leaving]
Vercas9 has joined #osdev
jack_rabbit has quit [Ping timeout: 276 seconds]
jack_rabbit has joined #osdev
fkrauthan has quit [Quit: ZNC - https://znc.in]
fkrauthan has joined #osdev
fkrauthan has quit [Client Quit]
fkrauthan has joined #osdev
Brnocrist has quit [Ping timeout: 264 seconds]
Brnocrist has joined #osdev
gbowne1 has quit [Quit: Leaving]
<nikolar> zid love you too
ThinkT510 has quit [Quit: WeeChat 4.2.1]
ThinkT510 has joined #osdev
vdamewood has quit [Quit: Life beckons]
GeDaMo has joined #osdev
Brnocrist has quit [Ping timeout: 260 seconds]
Brnocrist has joined #osdev
Vercas93 has joined #osdev
Vercas9 has quit [Remote host closed the connection]
Vercas93 is now known as Vercas9
solaare has quit [Ping timeout: 246 seconds]
Matt|home has quit [Quit: Leaving]
Vercas9 has quit [Remote host closed the connection]
Vercas9 has joined #osdev
Vercas9 has quit [Quit: Ping timeout (120 seconds)]
Vercas9 has joined #osdev
Vercas9 has quit [Quit: Ping timeout (120 seconds)]
Vercas9 has joined #osdev
Vercas9 has quit [Remote host closed the connection]
Vercas9 has joined #osdev
Cindy has quit [Ping timeout: 260 seconds]
Cindy has joined #osdev
pog has joined #osdev
solaare has joined #osdev
Vercas9 has quit [Quit: Ping timeout (120 seconds)]
rustyy has joined #osdev
Gurkenglas has joined #osdev
heat has joined #osdev
Left_Turn has joined #osdev
netbsduser has joined #osdev
Gurkenglas has quit [Ping timeout: 250 seconds]
kof123 has quit [Ping timeout: 252 seconds]
gxt has quit [Ping timeout: 255 seconds]
gxt has joined #osdev
[itchyjunk] has joined #osdev
[_] has quit [Ping timeout: 260 seconds]
gxt has quit [Remote host closed the connection]
gxt has joined #osdev
<pog> hi osdev
<heat> grog
<nikolar> Hello plog
<mcrod> pog may i gog you
<pog> yes
* mcrod gogs pog
navi has joined #osdev
* pog prr
* heat pr
<Ermine> hi
<nikolar> Hello Ermine
<zid> nikolar
<nikolar> Yes zid
<zid> you know what I want
<nikolar> The motherboard?
<zid> No dear, how much honzuki?
<nikolar> A few more sentences
pallas has joined #osdev
pallas has quit [Quit: Connection closed]
pallas has joined #osdev
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
goliath has joined #osdev
heat has joined #osdev
heat_ has quit [Read error: Connection reset by peer]
<zid> gog not here, grindavik must have asploded
<nortti> heat: oh yeah re the pdp-11 to vax cross compilation and bootstrapping, pcc can be used for compiling to vax from pdp-11 (see https://www.bell-labs.com/usr/dmr/www/otherports/32v.pdf), and for a modern bootstrap thing there's https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-building-from-source-all-the-way-down/
<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"
<nikolar> Yeah it's really stupid
<mjg> you people need a chill pill
<mcrod> indeed
<bslsk05> ​i.imgur.com <no title>
<zid> killing cpus, sick
<zid> and a broken tar archive
pallas has quit [Quit: Connection closed]
<heat> interesting
<Ermine> idr the file where I should put a macro for verbose traces
<heat> if you reduce the memory to 512M, what happens?
heat has quit [Remote host closed the connection]
<Ermine> same
heat has joined #osdev
<Ermine> heat: same
<zid> heat: same
<heat> heat: same
<heat> huh.
<zid> why is your tar broken though
<heat> now do -cpu host,-la57
<Ermine> the same thing again
<heat> weird
<heat> give me your qemu cmdline
<heat> wait, uh, i wonder if your tar is borked/weird
<Ermine> qemu-system-x86_64 -s -cdrom Onyx.iso -m 512M -serial stdio -boot d -netdev user,id=u1 -device virtio-net,netdev=u1 -object filter-dump,id=f1,netdev=u1,file=net.pcap -cpu host,-la57 --enable-kvm -smp 4 -vga qxl -device usb-ehci -device usb-mouse -display gtk,gl=on -machine q35
<Ermine> GNU tar 1.35
<heat> xxd -l 300 initrd.tar
<Ermine> I can try installing arch before we enounter another opensuse kink?
<heat> do not
<zid> your code literally said the tar was broken though
<zid> why are we thinking it's the qemu options and not the tar first, *boggles*
<heat> found the problem with the tar
<bslsk05> ​gist.github.com: ustar.patch · GitHub
<heat> apply and try again, with la57
<zid> but.. it is 6 bytes
<zid> I think you mean + return !memcmp(header->magic, "ustar", 5);
<heat> the opensuse GNU tar seems to prefer a pax-formatted tar
<heat> sure, it's functionally the same
<zid> yea but it looks silly
<Ermine> This time, could not mount /sys
<heat> the tar format is so shit
<heat> now that's what i call a weird error
<zid> you should see the format actual tape archivers use
<heat> hah, i guess i can't parse pax-formatted tars
<bslsk05> ​i.imgur.com <no title>
<Ermine> Enough, I'm going to arch
<heat> noooooooooooOOOoooooooo
<heat> we're having fun!
kof123 has joined #osdev
<Ermine> ookay
<zid> does it symlink tar to pax or something
<bslsk05> ​gist.github.com: geninitrd.patch · GitHub
<zid> how are we getting a pax not a tar
<heat> i think this should work
<zid> oh tar frontends for pax?
<heat> yep
<heat> make sure to rm initrd.tar just to be sure
<Ermine> Do I need to resore initrd.cpp?
<heat> no
<heat> i wonder if cpio is as much of a mess as tar
<Ermine> tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
<bslsk05> ​www.gnu.org: GNU tar 1.35: 8.3.5 Ustar Archive Format
<Ermine> I heard bad things about cpio
<heat> oh okay, add a - before the cvf
<heat> so --format=ustar -cvf
<zid> gnu, oldgnu, pax, posix, ustar
<zid> v7 best
<heat> ar best
<Ermine> Yeah, this time it booted
<heat> ok good, with la57?
<Ermine> yes
<zid> I'd use the total annihilation archive format, HPI
<heat> now throw OVMF into the mix
<heat> -bios OVMF.fd if you have it installed
<pog> oumf
<Ermine> It reboots once I choose onyx in grub menu
<heat> ok, good
<heat> how much mem?
<Ermine> 512M
<zid> pog: Are you submerged in lava yet?
<heat> and if -cpu host,-la57?
<pog> yes
<Ermine> yes
<zid> smh we've covered this, lava is very dense, you'd be *floating* on lava
<pog> i'm lavapilled and magmamaxxing
<heat> Ermine, yes what
<heat> -la57 removes it
<Ermine> Ah, that reboot was with -cpu host,-la57
<Ermine> without -la57 same
<heat> ah okay, the efi handoff support broke
<heat> i'm fairly sure this is GRUB fucking me
<heat> i keep not touching it, and it keeps breaking
<nikolar> Kek
<Ermine> Time for linux boot protocol?
<heat> maybe
<heat> yep, grub fucked me
<heat> Ermine, reverting 1ea5c073b1eed09fac31593314e22932630ad94c fixes it
<heat> whatever is getting passed as the load base address is not consistent
<heat> have i mentioned how much i fucking hate grub
<zid> does it not just stick you at 1M
<heat> i relocate it
<heat> also i load myself at 16M when not relocatable
<zid> so you're to blame
<heat> no, grub is to blame because GRUB relocates me and doesn't know what the LOAD_BASE_ADDR means
<zid> I don't think that's what relocation means
<Ermine> still reboots, with and without -la57
<heat> in KVM?
rustyy has quit [Ping timeout: 264 seconds]
<Ermine> yes
<heat> weird
<heat> this is all optional anyway
<bslsk05> ​gist.github.com: boot.patch · GitHub
<Ermine> That worked,
<Ermine> either with or without -la57
<heat> Ermine, revert that last patch and try this please: https://gist.github.com/heatd/ae109f0874d0bdf1dc4e57323c718eea
<bslsk05> ​gist.github.com: boot2.patch · GitHub
<Ermine> Reboots
<heat> fork
<heat> i cannot repro that :(
<heat> can you send me the .iso?
<heat> it would be SO funny if an openSUSE GRUB patch was screwing me over
<heat> spasiba
<zid> That's russian for "Rush A"
<Ermine> Por favor
<heat> nope, cant repro it either
<zid> That's spanish for "give ak"
<nikolar> Lel
<zid> "Lel" is serbian for "kosovo great nation"
<Ermine> I can give you opensuse's ovmf image as well
<heat> sure
<zid> I wish kvm worked on windows 10
<heat> HYPERV!
<zid> yea, fuck hyper-v
<zid> Panic: /sbin/init exited with exit code 4!
<zid> What does that one mean
<heat> zid, SIGILL
<zid> Oh, it's ill?
<zid> Must be my dirty qem
<heat> yeah, got the flu
<heat> Ermine, nope, can't repro
warlock has quit [Ping timeout: 246 seconds]
<Ermine> fun
<Ermine> maybe its opensuse qemu
<heat> try -cpu Haswell
<Ermine> still reboots
<heat> shrug
<Ermine> Btw, I had to un-revert 1ea5c073b1eed09fac31593314e22932630ad94c because boot2 patch didn't apply
<heat> yeah
<heat> anyway, i'll probably #if 0 that code off
<Ermine> Also, with that patch reverted and without boot2 I've got an output on bare metal, but got "kernel fatal segfault"
<heat> oops
<heat> stack trace?
<bslsk05> ​i.imgur.com <no title>
<heat> oh wow that's really early
<heat> mind sending me that kernel? the -unstripped variant
<heat> thx
<nikolar> zid wrong
<zid> zid correct, always.
<heat> Ermine, whatever's serving traffic is really not enjoying serving me the vmonyx-unstripped
<zid> what are you claiming I am wrong about?
<heat> 40KB/s
<Ermine> ugh
<Ermine> i get 4021k with curl
<heat> oh its much faster now
<heat> i wonder if it was a caching thing?
<Ermine> Idk
<Ermine> It's my humble vps with a webserver on it
<Ermine> maybe kernel cached the file itself
<Ermine> Will investigate
<heat> your humble abode
<heat> ANYWAY
<heat> symbols aren't helping too much :(
<heat> i'll write a better stack tracer that dumps more context
<nikolar> zid: what lel means
<zid> oh!
<heat> anyway thanks for trying it out Ermine !
<zid> You're just not aware of that usage is all
<zid> It definitely also means that
<heat> yeah it's a regionalism
<nikolar> Oh yeah definitely
<Ermine> sortix didn't boot either btw
<heat> epic win
<zid> yea but that's sortix
xenos1984 has quit [Ping timeout: 256 seconds]
xenos1984 has joined #osdev
jack_rabbit has quit [Ping timeout: 268 seconds]
<antranigv> has anyone here ever tried to `gcore` a process that has wired 1.5TB of memoory?
<zid> 'wired'?
<heat> rss
<heat> but no, i have not
<zid> yea, but, wired?
<heat> wired is most definitely a term
<antranigv> yes, wired memory, aka ask the kernel not to swap it and keep it allocated.
<zid> ah, thanks
<zid> heat is no help as usual
<heat> what the fuck do you think rss meant
<heat> i wasn't talking about rss feeds
<antranigv> is there a reason for gcore to create the core.pid file but not write to it?
<zid> heat assumes everybody is a complete linux nerd and only responds in diffs of how linux operates, rather than using generic terms
<heat> i don't know
<heat> RSS is a generic term
<antranigv> zid don't worry, I'm not even on Linux.
<zid> failed and then didn't close() so it truncated?
<antranigv> zid it didn't fail... it's still running
<heat> what system are you on?
<zid> but I'd expect with the amount it was writing for it to at least partially flush
<antranigv> heat FreeBSD
<heat> /shrug
<zid> oh so it *is* writing to it?
<netbsduser> antranigv: on all unixes it's called RSS on windows "working set size"
<zid> it just hasn't closed yet, so you can't see it
<heat> you don't need to close a file to see the contents
<zid> for something that big I'd expect not, yea
<zid> but for small files it's absolutely a thing, due to various amounts of buffering all over
<heat> if there's literally 0 size or 0 blocks, something is wrong
<heat> but you're also tryign to coredump 1.5TB soooooooooooooooooooo
<antranigv> heat true, but here's the weird part, if I DTrace the process... it's not doing anything
<antranigv> I think it's waiting for something, but I have no idea how to check that
<zid> ask gdb for a stacktrace?
<zid> it'll be in some syscall somewhere
<Ermine> maybe mjg can help?
<antranigv> zid I have the stacktrace from procstat(1)
<antranigv> no, I lied, it's the kstack
<antranigv> Here's an image
<antranigv> Ermine I hope mjg can help :))
<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
<antranigv> (the Guest is Linux, if that matters)
<mjg> page = malloc(PAGE_SIZE, M_AMDVI, M_WAITOK | M_ZERO);
<mjg> i'm guessing it's this malloc
<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
<heat> there you go
<bslsk05> ​gist.github.com: gist:bafe808619f2d4b43c8712eb2980014a · GitHub
<heat> it'll scale right up to 128 cpus ezpz
<mjg> wut
<mjg> you got only < 1600 vnodes and 128G arc?
<heat> what the heck is ARC
<mjg> zfs cache
<antranigv> heat adaptive cache, it's basically read cache
<heat> so you have a cache behind the page cache?
<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> hey bslsk05 easy buddy
<Ermine> what if i daily drive freebsd
Maja has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<nikolar> Do it
<heat> do not
<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
<bslsk05> ​gist.github.com: 0001-DO-NOT-MERGE-Print-an-interrupt-s-stack-trace-and-st.patch · GitHub
<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!]
<sortie> How does accept work then?
<heat> sortie, https://github.com/heatd/Onyx/blob/master/kernel/kernel/net/tcp.cpp#L698 you can follow my syn + synack logic from there
<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
<bslsk05> ​github.com: Onyx/kernel/kernel/fs/vfs.cpp at master · heatd/Onyx · GitHub
<heat> if we're concerned that the 'containing object' may change, we simply need to recheck under the loop
<heat> s/the/the lock/
<heat> shit
<heat> s/loop/lock
<heat> there we go
<heat> the bslsk05 sed feature would be really handy here
zxrom has quit [Quit: Leaving]
<heat> /* I don't understand the comment above */
<heat> genius freebsd code
<zid> /* I don't understand compoter */
<heat> does anyone
<zid> compoter is easy, it's the stupid shit people do with them that is complicated
gabi-250 has quit [Remote host closed the connection]
xenos1984 has quit [Read error: Connection reset by peer]
xenos1984 has joined #osdev
Left_Turn has quit [Read error: Connection reset by peer]