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
alexander has joined #osdev
foudfou has quit [Remote host closed the connection]
foudfou has joined #osdev
Burgundy has quit [Ping timeout: 248 seconds]
<heat> windows is the only one that has a paged heap
<zid> heat what's a paged heap
<heat> heap that can get swapped out
<heat> so every access to that memory is a russian roulette of pain
<zid> why would you do such a thing
<heat> i dont know
<heat> ask dave cutler
<heat> i had to check xnu wasn't doing something dumbass like that, but thankfully no
gog has quit [Ping timeout: 258 seconds]
<heat> it's still mostly the bsd semantics of the krenel malloc
<zid> krenal
Turn_Left has joined #osdev
<geist> iirc beos had a paged heap too
<heat> krenal marloc
<zid> do we know why beos did it?
<heat> self sabotage
<geist> but as a result you needed to put all the VM structures in a separate heap that wasn't
<geist> nah, it was because the world didn't have infinite memory back then
<zid> It doesn't really explain anything to me though
<geist> and/or the kernel was a more substantial footprint relative to all the web browsers and shit you run now
<geist> therefore there's a bit more value to making the kernel itself pagable
<zid> oh, so that they could page bits of the kernel out, I see
<childlikempress> generally, the point of being able to apge things is so that you can page things, yes
<geist> like if you had a 8MB system and the kernel footprint was like 4, was nice if you could pull 1MB out or whatnot
<zid> that seems like a nightmare of fault conditions to fix it all back up correctly though, *shudder*
<geist> yep, hence why it's really not worth the effort now
<childlikempress> it is really nice that we have infinite memory now!
<zid> childlikempress: Some of the time it is, some of the time it's so you can do weird tricks with dirty bits and crap
<geist> hah speaking of i just fixed a zircon bug today where large pages were being split up in the mmu code and wasn't setting the A/D bit from the page it split
<geist> and thus would fault in the kernel
<geist> boop
<heat> classic ARM64
<geist> riscv this time
Left_Turn has quit [Ping timeout: 246 seconds]
<heat> but riscv doesn't work like that though?
<geist> i found a way to disable qemus full A/D bit emulation (svadu=off on the cpu command line)
<heat> unless im super misremembering things
<geist> riscv works very much like that
<zid> riscv doesn't exist heat, so it does everything and nothing
<zid> riscv is a *concept*
<childlikempress> riscv is _two_ concepts--fragmentation and fusion
<geist> riscv is a wave function
<bslsk05> ​github.com: Onyx/kernel/arch/riscv64/mmu.cpp at master · heatd/Onyx · GitHub
<heat> and it works?
<heat> maybe you're enabling something i'm not?
gog has joined #osdev
<geist> heat: have you run on real hardare yet?
<heat> no
<geist> there's yer problem
<heat> riscv is not real
<geist> so: riscv is the same as arm: the A/D bits may be implemented in hardware or not (see Svadu/Svade features)
<zid> I want spring rolls :(
<geist> qemu by default emulates full A/D support, so it by default acts like x86 and you dont have to worry about it
<heat> ohhhhhh
<heat> sweet
<geist> real hardware, like anything sifive based, etc, generates a page fault on accesses and writes for the A/D bits
<heat> x86!!!
<geist> so you can avoid it by having the bits pre-set
<geist> you can disable qemu's default behavior by setting `svadu=off` in the cpu command line
<geist> 'supervisor a/D updates`
heat has quit [Quit: Client closed]
heat has joined #osdev
<heat> i finally got the courage to write more kernal
<heat> what's the shortcut for "next-match" in nvim?
Turn_Left has quit [Ping timeout: 258 seconds]
gog has quit [Ping timeout: 246 seconds]
Beato has quit [Remote host closed the connection]
Beato has joined #osdev
orccoin has quit [Ping timeout: 250 seconds]
johanne has quit [Quit: CGI:IRC (Session timeout)]
freakazoid332 has quit [Read error: Connection reset by peer]
[itchyjunk] has quit [Ping timeout: 246 seconds]
<geist> probalby just 'n'
<heat> geist, does zircon always do shotgun mappings?
<geist> not always, but a lot of time it does
<geist> it's configurable
<heat> ah
<heat> do you play funny tricks with traditional mapping allocation?
<heat> or is it just a boring O(n)
frkzoid has joined #osdev
netbsduser has quit [Ping timeout: 244 seconds]
<immibis> heat: why would userspace processes have paged heaps?
<heat> what?
<immibis> heat: why would userspace processes have paged heaps?
<heat> all userspace processes have paged heaps
<immibis> yes. why should they?
<heat> because most of them are actively useless
<heat> and memory wasteful
<immibis> that is also your answer for kernel paged heaps
<heat> but that's wrong for the kernel
<immibis> if a process opens 1000000 files do you want to hold all the file descriptors in memory at all times?
<heat> the penalty for swapping something in thats *core to the kernel* is huge
<heat> sure
<immibis> the penalty for swapping something in is huge
<immibis> why do you think i, as a user, care whether you're swapping in something in the kernel or something in firefox
<immibis> either way I have to wait for it
<heat> because the kernel may halt everything
<heat> :)
<immibis> (actually I don't think the penalty for swapping is that bad. It's the penalty for swapping 100000 different chunks of 4k that's huge. Do it in one contiguous sweep and it takes a few seconds)
<heat> also introduces possible huge latency spikes
<immibis> heat: okay so don't swap out the scheduler
<immibis> that's why there's also a nonpaged heap
<heat> ok so i want everything to be fast and simple
<heat> which goes to... the non paged heap
<heat> great, now everything's in the non paged heap
<immibis> this also applies to userspace processes then. don't page them
<heat> the kernel gives you tools to do so, if you want
<immibis> if you page userspace heaps, it's slow and complex again
<heat> wrong
<immibis> wrong
<heat> the cost of fucking trapping on a page fault on a random memory access that needs to swap things in is huge in complexity and performance
<heat> better check your locks
<immibis> yes so it's slow and complex
<immibis> paging is slow and complex, we agree
<heat> im talking about the kernel
<immibis> so don't page
<heat> yes, don't page the kernel
<heat> swap userspace, because the kernel and userspace are not in parity
<immibis> the cost of fucking trapping on a page fault on a random memory access that needs to swap things in is huge in complexity and performance
<heat> the kernel may and does sacrifice userspace to keep itself or other more important processes alive
<heat> and it does give userspace the tools to not swap certain pages up to whatever limit it has perms for
<immibis> oh so that's when it decides that thunderbird is more important than xmonad
<immibis> or worse Xorg
<immibis> or wireshark running as root and capturing to tmpfs. It's root so it must be important right?
<heat> should've configured your cgroups
<immibis> so if you're adding so much complexity as cgroups and so much performance sacrifice as swapping, why are you not willing to also do those inside the kernel?
<immibis> you're clearly not opposed to complexity or bad performance
<heat> what
<heat> i dont give a shit if chrome is 100ms slower once or twice because its using too much memory
<immibis> you're saying kernel swapping is bad because of high complexity and bad performance, so let's add high complexity and bad performance everywhere but the kernel
<immibis> i don't give a shit if CreateFile is 100ms slower once or twice because its using too much memory
<heat> well, that's you
<immibis> well, that's you
<heat> swapping core kernel structures because a process is abusing them solves nothing
<heat> you can't stop the abuser
<heat> who owns a file? no one knows
<heat> unless you have proper limits, then there's no problem
<immibis> swapping userspace memory because a process is abusing it solves nothing. you can't stop the abuser. who owns a page? no one knows. unless you have proper limits, then there's no problem
<immibis> have you ever actually looked at memory statistics in your favourite OS? they just fudge them to account for shared pages
<heat> yeah im... not doing this
<heat> i dont have energy for bad faith arguments at this time of th day
<immibis> windows reported memory isn't vsz or commit charge, it's "private working set" - working set being some estimation of the pages actively used by the process
<immibis> and private meaning it excludes shared pages entirely
<immibis> everything you disagree with is bad faith? you are now blocked
<immibis> if you reply to this message I won't see it on my screen
<heat> lmao
<zid> no idea who that was, they were already ignored :P
<immibis> it was heat
<zid> ah, no wonder, that fucker
<heat> hahaha
<immibis> apparently swapping is fine but only if it happens in the part of the system where it happens to be easier to implement swapping
<zid> sounds like a viable strategy ngl
<heat> easier, safer, faster
<immibis> there is no reason to think that the arbitrary dividing line of where it happens to be easier to implement swapping lines up with the other arbitrary dividing line of where it's actually useful and good.
<heat> but no, lets do the non-obvious thing
<geist> re: kernel swappjg vs user swapping,i think the key is that kernels haven't generally increased in size at the rate at which memory has in the last 20-30 years
<heat> i want pain for the sake of pain
<immibis> he also said swapping is high complexity and low performance so don't do it here... but do do it there, where it's still high complexity and low performance, because apparenly that doesn't matter?
<geist> so nowadays kernels use a much smaller part of the total system memory, and thus doesn't apply as much memory pressure to the system
<geist> and thus you dont really get as much back from adding the feature
<immibis> that is probably a factor, but user processes surely use more kernel data
<heat> geist, right, and user processes have limits
<geist> yes but not at the same scale
<heat> you can't open 10k files, you can only open 1024 (by default in linux)
<geist> say 30 years ago and yo uhad like 4 or 8MB of ram,. the kernel itself might use up 1/4 of it, or more
<geist> now that'd be ridiculous if you had a 8GB system and the kernel used up a solid 2GB of ram
<immibis> unless you're writing KeyKOS and eschewing all dynamic allocation in the kernel, you probably do want to treat kernel data allocated on behalf of a user process the same as you treat memory directly allocated by the process
<heat> you can only have up to N vmas, etc
<zid> The unfairness is ignorable, is how I'd put it
<kazinsal> yeah if your kernel is taking up a significant fraction of your memory you're probably doing something uncommon that needs it
<zid> i.e that a process with 100 open files technically uses more memory than one with 1 open
<kazinsal> like, say, holding the full internet routing table
<geist> right
<zid> because on the scale of "system memory", the difference between 100 files open and 1 file open is approximately 0
<immibis> there are probably bittorrent systems out there that keep millions of files open
<zid> to the nearest few powers of ten
<geist> also it was a different era in that in general you did and could seriously overcommit your system, frequently
<geist> nowadays folks will scoff at how much swapping you may have done back then
<geist> but at the time it was frequently just the price you paid to get stuff done
<immibis> pretty sure i still have lots of swapping because of web browsers
<immibis> DHTML was a mistake
<zid> I think also there was a lot more.. timesharing going on
<zid> we *do* do full kernel memory swapping between customers today
<zid> we just do it with VMs
<geist> right. at the time memory was relatively expensive
<heat> ksm is nice
<geist> of course depends on the use case, etc etc
<zid> with more timesharing and 'customers' and 'clients' involved, but pre-kvm, you need internal mechanisms to dump out open file handles etc
<zid> and suspend a user's memory useage to tape
<zid> so that you can run jobs for a different user, that might need *all* of the memory
<geist> indeed
<zid> These days we just swap the entire OS image out so who cares if the kernel can individually dump out files from a single process to disk
<zid> we're chucking the entire memoryset
<zid> that code is just overhead to that process
<geist> also we can spend more cpu cycles doing things ike page deduplication, zero detection, page compression
<geist> since that's relatively cheap now
<heat> page compression is veeryyyyyyyyy good
<heat> you can actually enable it on servers
<heat> and perf/latency doesnt go to the shitter
<kazinsal> yeah my machine is currently compressing 14 GB down to 3 GB
<kazinsal> it's handy
<heat> is that windows?
<kazinsal> yeah
<heat> yeah windows always has some craaaaazy stats there
<zid> could probably dedicate 127 cores to doing that
<zid> while I play dwarf fortress on the real core
<kazinsal> which technically means I'm overcommitted but in the magical future of cheap fast RAM and cheaper fast secondary storage, wheeeeeeeee
<geist> and also dont forget M1+ cpus just have compression instructions built in
<geist> risc baby!
<heat> very risc much wow
<zid> My friend implemented 'page compression' for the long-running java program that his device was designed to run.
<zid> And by 'page compression' I mean every half an hour it'd free any page that hadn't been used since last time it checked.
<zid> java program stayed rock stable, and stopped OOMing :p
<heat> LRU for dummies
<zid> I mean that's just an LRU, yes, but it's funnier explained that way
<heat> gosh that's not even LRU
<heat> NRU
<heat> it's more or less how SVR4 did page replacement too
<zid> that's your buzzword for this week I noticed btw
<zid> page replacement
<zid> it's a step up from pessimal or spinlock I guess
<heat> MUTEX
<heat> i don't say the p-word
<heat> that's not my catchphrase
<heat> but yes i've been thinking about page repl*cement for a bit these past few weeks
<heat> oh yes i see
<heat> <heat> it's more or less how SVR4 did geese replacement too
<zid> peace was never an option
<immibis> the leopard is still the best input device though
<zid> a goose is a way better input device than a leopard
smeso has quit [Quit: smeso]
smeso has joined #osdev
Hammdist has joined #osdev
heat has quit [Ping timeout: 246 seconds]
mahk has quit [Ping timeout: 255 seconds]
Vercas has quit [Quit: buh bye]
Vercas has joined #osdev
sebonirc has quit [Ping timeout: 246 seconds]
Hammdist has quit [Quit: Client closed]
Hammdist has joined #osdev
sebonirc has joined #osdev
bgs has joined #osdev
Hammdist has quit [Quit: Client closed]
stefanct has quit [Ping timeout: 246 seconds]
goliath has joined #osdev
nyah has joined #osdev
Hammdist has joined #osdev
Left_Turn has joined #osdev
Turn_Left has joined #osdev
xenos1984 has quit [Read error: Connection reset by peer]
xenos1984 has joined #osdev
Left_Turn has quit [Ping timeout: 260 seconds]
stefanct has joined #osdev
danilogondolfo has joined #osdev
Turn_Left has quit [Ping timeout: 245 seconds]
Turn_Left has joined #osdev
orccoin has joined #osdev
antranigv has quit [Quit: ZNC 1.8.2 - https://znc.in]
antranigv has joined #osdev
gog has joined #osdev
GeDaMo has joined #osdev
Burgundy has joined #osdev
zxrom has quit [Quit: Leaving]
zxrom has joined #osdev
Nixkernal has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
Nixkernal has joined #osdev
Nixkernal has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
Nixkernal has joined #osdev
Nixkernal has quit [Client Quit]
stolen has joined #osdev
heat has joined #osdev
Nixkernal has joined #osdev
xenos1984 has quit [Read error: Connection reset by peer]
netbsduser has joined #osdev
xenos1984 has joined #osdev
<bslsk05> ​elixir.bootlin.com: mmap.c - mm/mmap.c - Linux source code (v5.14.21) - Bootlin
<heat> struct vm_area_struct *******____this_code_sucks
<sham1> But it has your favourite, underscores
<heat> i like underscore upperscore, not underscore underscore
<heat> upperscore? uppercase
<sham1> Why
<mjg> you know what really sucks
<mjg> linux :X
<sham1> __this and _This are just as reserved
<heat> but _This is cooler
<heat> __this is lame
<mjg> memmoryMappingFactoryEx is the shit innit
<mjg> ey heat, do you employ TDD while developing your kernel?
<heat> i think im going to write a maple syroup tree
<heat> i have some tests
<heat> not TDD because that's lame
<mjg> heat == asshole confirmed
<heat> mjg, mmap3
<heat> mjg, that has been long known
<mjg> mmap4.1
<mjg> mmap4.3RENO
MarchHare has quit [Read error: Connection reset by peer]
<sham1> MemoryMappingFactoryEx
<sham1> Have you ever seen a Microsoft API with camelCase? Me neither. It's all PascalCase
<mjg> Kurwy
<mjg> FairPointByHandle
<mjg> i looked at that file manager they opensourced from win 3.1 days
<mjg> it has some bllshit about a pascal calling cnvention
<sham1> bllsht
<mjg> the code is beyond atrocious
<mjg> ey that's unix
<sham1> Oh, fair
<sham1> Also standard C
<mjg> you could argue True Unix would be bllsh
<sham1> But that's a bull shell
<sham1> Although nowadays you could easily end up with stdc_bullshit
<sham1> With some UwU and OwO in the code examples
<mjg> the standard has been updated for the current year
<heat> linux ppl cant design syscalls
<heat> "This adds the fchmodat2() system call. It is a revised version of the
<heat> fchmodat() system call, adding a missing flag argument."
<mjg> ofc not
<mjg> see close_range
<mjg> fucking flags for expansion is syscall 101
<sham1> Well the real problem is that they don't break userspace so you can't even fix that
<bslsk05> ​lkml.org: LKML: Linus Torvalds: Re: [Regression w/ patch] Media commit causes user space to misbahave (was: Re: Linux 3.8-rc1)
<mjg> well known klassikkk
<sham1> If I have to give any props to Windows (aside from it having page views to files, obviously), it's that they don't need to deal with this as much due to how you call the syscalls
<heat> don't forget the paged heaps
<heat> they're great
<sham1> Yes
<sham1> And it also has a book from two decades ago about its design which you can't even verify
<heat> that's untrue
<heat> the latest windows internals covers windows 10 even
<sham1> Err yeah
<sham1> I only remembered the one from like original NT, 2K and so on
<heat> windoze has better books about its internals than linukz
<heat> "mm documentation? what's that?"
<sham1> Code is the documentation
<sham1> That's also only half sarcastic
<heat> glhf
<bslsk05> ​elixir.bootlin.com: vmscan.c - mm/vmscan.c - Linux source code (v6.5) - Bootlin
<mjg> there was an entire book about linux mm
<heat> the gorman one?
<mjg> albeit old af
<heat> old ass shit
<mjg> yea
<heat> 2.4
<mjg> ey 2.4 greatest kernal
<heat> i think it covers bits of early 2.6 though
<mjg> well second place to 2.2
<sham1> At $JOB I've had to deal with exactly the kind of BS you get from having outdated docs and stuff like misleading class and variable naming
<sham1> Not exactly fun
<netbsduser> linux is a mystery kernel about which we don't really know anything
<mjg> dude i don't trust docs whatsoever
<mjg> i remember tracking a bug in nfs or xfs
<mjg> i trusted a fucking comment
<mjg> it sent me a goose chase
<mjg> on a*
<mjg> would you believe sham1 comments can be wrong
<sham1> What? Never
<sham1> Who'd do something like that? Just change some code and then not update comments
<mjg> i mean it's only the stupid comments are wrong
<mjg> real comments are always right, for example
<mjg> return 3; // return 1 since we failed
<sham1> It's like going to the Internet to lie
<mjg> i don't think people do that anymore
<sham1> Oh yeah, it's not called lying anymore. Now it's shitposting or whatever
<mjg> my "fav" bit in the area is that some dude was being considered an ass, right or wrong
<mjg> some dudzes were shitting on him
<mjg> i pointed out their shitting is bogus
<mjg> they said "so what, he is an ass" and continued
<mjg> intellectual integrity on the internet 101 right there
<netbsduser> why do linux structs get named `struct x_struct` anyway
<sham1> Seriously though, the fact that people online tolerate lying because it's a joke is a weird phenomenon
<sham1> netbsduser: because while Linus and/or the Linux style guide advocates against Hungarian notation, it doesn't seem like it's always enforced
<heat> netbsduser, some do but that's old as fuck
<heat> like vm_area_struct and files_struct and shit
<mjg> i suspect that's leftover from typedefs
<sham1> And refactoring that? Useless busy work
<mjg> bro i'm so busy switching between snake and camel case
<heat> snek
<mjg> there is literally no time to do any changes
<heat> average linux mm/ developer
<sham1> how-about-some-nice-kebab
<heat> PagePrivate? PG_Private? alloc_pages.
<mjg> also release_pages
<mjg> makes sense since that's the opposite of allocating them
<mjg> as in makes sense it has words backwards
<sham1> Symmetry
<mjg> dragonfly vm has a bunch of cameling as well
<mjg> pretty weird
<sham1> Even though the symmetry is broken by the fact that the argument(s) come after the name
<heat> why did you look at dfly vm
<heat> that's pretty sus mjg
<sham1> Wanted to get HAMMERed
<mjg> i was young
<mjg> and freebsd vm was busy waiing on a lock :X
<heat> the fuck
<heat> is dfly vm just bsd vm?
<heat> fucking mach?
<mjg> you do realize dfly forked off freebsd 4
<heat> probably
<mjg> and mach was there since liek almost the inception
<heat> how did they grow camel then?
<mjg> ask dillon
<mjg> he camelz in his userspace code
<heat> ew
<heat> fucking ew
<mjg> says the c++ guy
<heat> im the least c++ guy
<sham1> The real fun starts once you start an argument about whether the file ends in .cpp, .cc, .C or something just as funky
<heat> my code is still readable
<heat> wasn't .C holyC or am I misremembering?
<heat> sham1, don't forget .cxx
<sham1> Holy-C was also written by someone with literal schizophrenia
<sham1> Oh yea, .cxx
<sham1> I think that in some polls I've also seen .c++
<mjg> :A
<mjg> ok i'm creating a project named CON jus so that it does not run on windows
<nortti> can you use + in filenames in windows?
<sham1> + seems to be allowed in Windows
<mjg> is a forward slash allowed?
<sham1> Nope
heat_ has joined #osdev
<mjg> :O
<sham1> Neither is the backslash
<heat_> this ruckin fouter
<mjg> well backslash is expected
<mjg> heat_: install pfsense
<mjg> unless you got a mips on it
<heat_> over my grave
<bslsk05> ​stackoverflow.com: What characters are forbidden in Windows and Linux directory names? - Stack Overflow
<sham1> Well you can also use the forward slash as a directory separator in Windows
<heat_> mjg, but srsly my C++ is very light, seriously readable still
heat has quit [Ping timeout: 245 seconds]
<heat_> i could use C and frequently do, but C lacks some niceties
<mjg> use rust
<mjg> you gonna have to learn it mon
<heat_> <heat_> over my grave
<mjg> rly
<heat_> yes
<sham1> C++ is a language with a good language struggling to get out from under all the piling features
<mjg> rust is here to stay mofo
<sham1> Ada
<heat_> i don't care
<sham1> SPARK
<heat_> i don't want to work on rust software
<mjg> sham1: SPARK64
<heat_> if you paid me to maintain fuckin SVR5 unixware i would do it in a heartbeet
<heat_> heartbeat*
<mjg> says fucking guy who wont contribute to open
<mjg> bsdi
<heat_> i could submit a rm -rf patch yeah
<mjg> you think you would be redundant in the project given they already have theo?
<sham1> We need a bot for Theo quotes
heat has joined #osdev
<heat> my router is fantastic
<heat> mjg, why are you insulting me
heat_ has quit [Ping timeout: 258 seconds]
<mjg> what's your objection to obsd?
<mjg> just "no"?
<mjg> i mean any reasons is valid but now i'm mildly cuirous
<gog> i'm going to fork openbsd and make closedbsd
<mjg> you gonna have antitheo?
<gog> yes
<mjg> closedbsd: scales to multicore, has lts support
<mjg> but also plenty of remote holes in the default install :(
<mjg> i stick with open, sorry gogs!
<heat> mjg, i mean, i've stated my objections to openbsd plenty of times
<mjg> that may be, i don't recall
<heat> tinpot security (while being super proud of muh sekuriteh), crap code, slow
<mjg> aight
<heat> theo is an ass
<heat> no review process
<mjg> there is review process
<mjg> ok@ shit mate
<heat> apparently all done in private
<heat> they don't even have fuzzing
<mjg> i think they do
<heat> they disable tmpfs by default
<bslsk05> ​syzkaller.appspot.com: syzbot
<mjg> there it is mcmoffer
<heat> oh wait, is it sanitizers they are lacking?
<netbsduser> they disabled tmpfs because they bit rotted it
<mjg> i don't know about sanitizers
<netbsduser> there was also a problem with it having an improper implementation with UVM on openbsd
<mjg> tmpfs is not something they /object/ to but as netbsduser said there was nobody to work on it
<netbsduser> namely if you mmap'd a tmpfs file, you would end up with a duplicate set of pages
<mjg> that came from the original netbsd port
<mjg> i would not be shocked if that was the case on netbsd as well
<netbsduser> no, this was one of the things tmpfs was invented specifically to avoid on netbsd
<mjg> freebsd has the netbsd port of tmpfs
<mjg> and it came with this bullshit
<mjg> had to be fixed later
<netbsduser> the principle was that tmpfs files should have their data represented as UVM objects and be mappable directly into the address spaces of processes
<netbsduser> if freebsd had that issue, i assume it's simply the case that they didn't do the adaptation immediately
<mjg> now, while this does not mean netbsd definitely has (or had) this problem
<mjg> i would suspect it very much does
<mjg> because of the stuff i had seen there, for example linear scans in directories
<mjg> it's basically turbo inefficient
<netbsduser> netbsd tmpfs was designed inspired by the sunos tmpfs paper and this unity with mmap() was the centrepiece of the whole thing
<mjg> that does not mean they did it
<heat> what sunos tmpfs paper?
<netbsduser> https://github.com/NetBSD/src/blob/ec9336561227af07020742d7fb925c32c9e1d6bd/sys/fs/tmpfs/tmpfs_vnops.c here is the original commit of tmpfs, you can see it has a custom getpages() vnode op
<bslsk05> ​github.com: src/sys/fs/tmpfs/tmpfs_vnops.c at ec9336561227af07020742d7fb925c32c9e1d6bd · NetBSD/src · GitHub
<heat> oh cool thanks
<netbsduser> if you look in tmpfs.h you'll see tmpfs nodes have a tn_aobj anonymous uvm object, you can also see another sunos inheritance in the read vnode op
<mjg> thatu vm object may be there to facilitate mmap to begin with
<mjg> or any other i/o
<mjg> it was literally the case on freebsd
<mjg> as in you need one to do anything
<mjg> does not mean there are no duplicated pages
<netbsduser> if you look at tmpfs_read, you can see that uiomove is used to do i/o by directly copying from a kernel-space mapping of the same uvm object; tmpfs_getpages also retrieves pages from the same object
<mjg> as i said the uvm thing may be needed to do antyhing to begin with
<mjg> you wanto make a case, show me the code refing the existing page on mmap
eddof13 has joined #osdev
<mjg> or the fault
<netbsduser> i already pointed you to tmpfs_getpages
Vercas has quit [Remote host closed the connection]
Vercas has joined #osdev
<mjg> that uvm_loan is long gone
<mjg> instead
<mjg> + error = (*uobj->pgops->pgo_get)(uobj, offset, ap->a_m, ap->a_count,
<mjg> + ap->a_centeridx, access_type, ap->a_advice, flags);
<mjg> and that came in the following:
<mjg> commit 647aa7753883bbc82411f8e4043706ec6a05cffc
<mjg> Date: Tue Sep 13 14:29:18 2005 +0000
<mjg> Author: yamt <yamt@NetBSD.org>
<mjg> - don't waste/leak kva. - implement getpages/putpages. support mmap. - eliminate meaningless memcpy. - ubcify.
<mjg> so... the code you linked did not even support mmap
<mjg> i don't see any magic in this commit to avoid duplicating pages
<mjg> and i'm willing to bet they are getting duped
<netbsduser> what do you think the function of the getpages vnode op is?
<netbsduser> to grab pages so you can duplicate them after getting them?
<mjg> on netbsd? i don't know what they do
<gog> what's the opposite of a net
<mjg> you can trivially make the claim that since getpages is used on openbsd
<mjg> it clearly does not dup pages
<gog> i'm gonna fork netbsd and call it <opposite of a net> bsd
<gog> the antonym
<sham1> anti-net-bsd
<sham1> offlinebsd
<mjg> workbsd
elastic_dog has quit [Ping timeout: 240 seconds]
<mjg> only supports 1 arch
<mjg> ... but it actually works
<mjg> :d
<sham1> ITANIUM
<netbsduser> you can see that getpages is passed as one of its arguments a pointer `struct vm_page **a_m` and the job of the getpages routine is to put page pointer(s) (potentially more than one for efficiency) into the pointer(s) pointed to by the same
<mjg> netbsduser: you can literally state this to claim that openbsd does not dup pages for tmpfs
<netbsduser> if there is an implementation of that in openbsd which does the same, picking out pages of the uvm object and plopping them in, then i will say, mea culpa, i told a lie about openbsd
<mjg> mate the api returning a bunch of pages is expected
<mjg> whether they are duped or not is ortoghonal
<mjg> the very same api *WAS* duping pages on freebsd
<mjg> and then it the underlying func was chnaged to not do it
<mjg> iow not an argument
<netbsduser> perhaps because freebsd didn't care to adapt the code initially
<mjg> i also stress the initial tmpfs code on netbsd clearly did not support mmap to begin with
<mjg> as evidenced by the above commit
<netbsduser> that surprises me, but i will accept that it sounds as if it didn't initially support it, which does surprise me
<mjg> this bit surprises me too
<netbsduser> as that was one of the objectives of the whole thing
<mjg> i would assume the objective was to avoid having to fuck with md + ufs on ti
<netbsduser> i am looking at openbsd's implementation and i don't see anything comparable that arranges for the pages of the uvm object to be supplied on demand
<mjg> look mate this convo exhausted my "curiosity" in the subject
<netbsduser> it does still do as netbsd does (reading the tmpfs file by mmap'ing it into the kernel's address space) but openbsd has no ubc so they do a fresh mapping on every read and then unmap it right away
elastic_dog has joined #osdev
<heat> >(reading the tmpfs file by mmap'ing it into the kernel's address space)
<heat> what?
<netbsduser> heat: a sunos inheritance
<heat> aren't the pages always mapped?
<heat> is this some high-mem kind of thing?
<netbsduser> originally they had a permanent mapping of the whole file, but in the commit mjg linked that was replaced with UBC use
<netbsduser> UBC being a cache of mappings in kernel-space of (parts of) files
<netbsduser> it can also use the direct map to do this without needing to map anything, if there is a direct map available
troseman has joined #osdev
troseman has quit [Client Quit]
troseman has joined #osdev
xenos1984 has quit [Read error: Connection reset by peer]
osdever has joined #osdev
<Ermine> gog: may I pet you
<osdever> hello, who knows about io request packets??
troseman has quit [Quit: troseman]
stolen has quit [Quit: Connection closed for inactivity]
<gog> Ermine: yes
* Ermine pets gog
SGautam has joined #osdev
* gog irp
<bslsk05> ​learn.microsoft.com: _IRP (wdm.h) - Windows drivers | Microsoft Learn
mjg is now known as ChavGPT
<gog> ME_TOO
xenos1984 has joined #osdev
<heat> ChavGPT, brad spengler or theo de raadt?
<heat> it'd be the nightmarest blunt rotation ever
<gog> 80 chars is a fake idea
<ChavGPT> you know spender?
<ChavGPT> i got an e-mail from him once, he was nice
<sham1> If anything it would have to be smaller than 80 if we're thinking about how eyes work
<ChavGPT> but then again, he wanted something :X
<heat> heck, throw matthew dillon onto the mix
<heat> those 3 motherfuckers are like top 5 toxic kernel devs
<ChavGPT> are you sure
<heat> yes
<ChavGPT> i have weak reollection we had similar convo in the past
<ChavGPT> and you confused dillon with someon else
<ChavGPT> whatd o you think this guy is doing
<heat> wasn't dillon the one who was kicked out after flaming out?
<ChavGPT> he did write a rather nasty commitm essage
<ChavGPT> but it's not like it came out of nowhere
<ChavGPT> it's basically the thing you see in public
<heat> spender's twitter is basically just a wall of throwing shade at upstream developers
<heat> with some nasty personal attacks from time to time
<ChavGPT> ye i used to read him for lulz
<sham1> heat: the social media formerly known as Twitter
<ChavGPT> got tiresome after a while
<ChavGPT> fwiw viro has a significantly worse track recored
<ChavGPT> and you did not evne mention the guy
<sham1> 𝕏
troseman has joined #osdev
<heat> does big ol al have a twitter/mastocrapper?
<heat> crapperdon
<sham1> You better watch your words
<ChavGPT> no but he has linux mailing lists
<ChavGPT> you obnoxious cunt
<heat> plop
<ChavGPT> he also had irc at red hat
<ChavGPT> if you wanted something from the fucking guy he would not respond most of the time
<ChavGPT> but apart from that he would spend tons of time ranting about code
<ChavGPT> one sentence i remember off hand is something about "who defecated this"
<heat> hey that reminds me of someone here
<heat> some three letter guy
<ChavGPT> i don't talk like that
<ChavGPT> besides i'm 7
<heat> who pessimaled this
<ChavGPT> i am writing a long rant about PESSIMAL stuff though
<osdever> gog: Thanks I will do some thing like IRP for my kernel
<gog> enterprise quality
heat has quit [Remote host closed the connection]
heat has joined #osdev
<Ermine> gog: not so fake when it's all that fits in a half of the screen
<osdever> What do other people here kernels do for their asynchronos IO driverstack
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
troseman has quit [Quit: troseman]
heat_ has quit [Remote host closed the connection]
troseman has joined #osdev
gog has quit [Quit: Konversation terminated!]
danish_pirate has joined #osdev
goliath has quit [Quit: SIGSEGV]
troseman has quit [Quit: troseman]
troseman has joined #osdev
gog has joined #osdev
troseman has quit [Quit: troseman]
MiningMarsh has quit [Quit: ZNC 1.8.2 - https://znc.in]
danish_pirate has quit [Quit: Leaving]
stolen has joined #osdev
xenos1984 has quit [Ping timeout: 245 seconds]
xenos1984 has joined #osdev
MiningMarsh has joined #osdev
Hammdist has quit [Quit: Client closed]
gog has quit [Quit: Konversation terminated!]
troseman has joined #osdev
MiningMarsh has quit [Quit: ZNC 1.8.2 - https://znc.in]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<osdever> Kernel
SGautam has quit [Quit: Connection closed for inactivity]
mahk has joined #osdev
<nikolar> kernal
<GeDaMo> Colonel
MiningMarsh has joined #osdev
<acidx> mahk: uzix? hadn't heard that word for a *long* time
Hammdist has joined #osdev
troseman has quit [Quit: troseman]
zxrom has quit [Read error: Connection reset by peer]
zxrom has joined #osdev
gog has joined #osdev
goliath has joined #osdev
kof123 has quit [*.net *.split]
kof123 has joined #osdev
heat has joined #osdev
<heat> posix AIO
<heat> the bestests most AIO interface ever
xenos1984 has quit [Ping timeout: 245 seconds]
eddof13 has joined #osdev
eddof13 has quit [Client Quit]
xenos1984 has joined #osdev
heat has quit [Ping timeout: 246 seconds]
danilogondolfo has quit [Quit: Leaving]
<ChavGPT> quality triage by heat: is it posix?
<gog> hi
<gog> i'm posix
<nikolar> hello posix
* childlikempress pets posix
nikolar is now known as posix
posix is now known as nikolar
<Ermine> hello posix, I'm N.T.
<kof123> hi, i'm cow tools guy
<kof123> *cow
<kof123> i have to check, but the thing is, his barn was standing. it is only the humans that are confused, they work fine for him
troseman has joined #osdev
terminalpusher has joined #osdev
sprock has quit [Ping timeout: 260 seconds]
sprock has joined #osdev
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
xenos1984 has quit [Ping timeout: 246 seconds]
goliath has quit [Quit: SIGSEGV]
<netbsduser> posix aio is one thing
<netbsduser> but whether it's backed by a profoundly asynchronous layered driver model makes all the difference
zxrom has quit [Remote host closed the connection]
zxrom has joined #osdev
<gog> i like that
* kof123 .oO( it is almost MVC )
<gog> i don't like that as much
<gog> but it's what i do every day
goliath has joined #osdev
<sham1> MVC!
troseman has quit [Quit: troseman]
stolen has quit [Quit: Connection closed for inactivity]
<gog> fibsh
<zid> UMVC3 when?
<sham1> MVC kernel when
eddof13 has joined #osdev
Matt|home has joined #osdev
<zid> I need
<zid> the black fizzy fluid
<Ermine> gog: may I pet you
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dude12312414 has joined #osdev
x8dcc has joined #osdev
<x8dcc> Hello everyone, after a pause with programming in general and osdev in particular, I decided to come back. I was adding multitasking and I need to save the SSE state using the fxsave instruction. My question is that in the example in wiki.osdev.org, they use: "fxsave [SavedFloats]", shouldn't it be "fxsave SavedFloats"?
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<zid> not typically, in x86 syntax
<zid> it's accessing memory so that's a memory operand, and gets []
<zid> same as lgdt
<zid> it's effectively `fancymov bigword ptr [addr]`
<x8dcc> yeah but isn't using [SavedFloats] the same as passing the dword at SavedFloats? Instead of the address of SavedFloats
<zid> only if you think mov dword [rax], 12
<zid> is the same as passing the contents at *rax to mov, along with 12
<zid> which I'd assume you don't
<zid> `inc byte [rsi]`
<x8dcc> hmm I think I know what you mean but that mov makes sense as *rax += 12
<zid> what about the inc then
<zid> 'do operation on the memory at *rsi'
<x8dcc> yeah
<x8dcc> yeah I know what you mean now
<x8dcc> it just feels weird to have a big 512byte variable
<zid> yea, it's one of those "huh that looks odd but makes total sense, I must be the weird one" things, along with lgdt and friends
<zid> (lgdt takes a pointer to.. 10 bytes?)
<x8dcc> so it would be more of *ptr = fxsave() instead of fxsave(*ptr)
sprock has quit [Remote host closed the connection]
<zid> I think you're just showing how poor of a mapping it is to treat them as parameters that are passed by value
<x8dcc> and yeah, just checked and I did lgdt [descriptor] without issue
<zid> because that fails for 'inc'
<x8dcc> but *rsi++ makes sense in my head :p
<zid> inc(*rsi) doesn't though
<zid> it needs to be *rsi = inc(*rsi)
<x8dcc> yeah exactly
<zid> neither of your schema fit even `inc`, so imo your schema is bad and should feel bad
<x8dcc> the weirdness was how big the "parameter" was
<zid> it suddenly highlighted the subtle out-of-touchness of your mental model
<zid> You're right though, the [] thing is actually weird.
<x8dcc> well I understand now, but it didn't feel weird because inc [rsi] was just like "yeah so nasm understands I want to do *rsi++"
<zid> It's totally unnescesary, and is only for people
<x8dcc> well, you helped me understand once again dear zid, thank you
<x8dcc> you won't be removed from my project's credits :p
<zid> like, inc [0xDEADBEEF] just encodes to ?? EF BE AD DE, [] is just how we write memory address literals into instructions
<zid> in assemblers
<zid> there's nothing saying the [] *have* to be there, it's just convention to disambiguate inc [rsi] from inc rsi, you could do it other ways, like inc rsi vs inc.m rsi, then you'd just have fxsave.m ptr instead
<x8dcc> I see
<clever> and RISC based cpu's just ban `inc [rsi]` style, so there is no need to disambiguate
<zid> but then you'd still have the un-orthogonallity, because there'd be no `fxsave` without the .m
sprock has joined #osdev
<x8dcc> So you couldn't escape from my question :D
vancz_ is now known as vancz
eddof13 has joined #osdev
x8dcc has left #osdev [ERC 5.4 (IRC client for GNU Emacs 28.2)]
<gog> hi
alexander has quit [Quit: ZNC 1.8.2+deb3.1 - https://znc.in]
<zid> Jello, Hog.
<zid> Sorry, sow.
<nikolar> Gollo, Heg
alexander has joined #osdev
osdever has quit [Quit: CGI:IRC (Session timeout)]
bgs has quit [Remote host closed the connection]
JTL has quit [Ping timeout: 250 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<gog> meow
<gog> oink
<ChavGPT> burp
troseman has joined #osdev
Yukara is now known as meisaka
xenos1984 has joined #osdev
Turn_Left has quit [Read error: Connection reset by peer]
<immibis> i am looking at the sata specification and it's based around transferring copies of the PATA register block, and there's a PIO emulation mode where the drive tells the host adapter how many bytes the CPU is going to write to the host adapter. Yuck. At least the DMA packets use "buffer identifier + offset" instead of physical address
<immibis> (apart from that it seems pretty sane)
<immibis> (they have integrated too many drive electronics)
zxrom_ has joined #osdev
zxrom has quit [Ping timeout: 255 seconds]
Burgundy has quit [Ping timeout: 245 seconds]
heat has joined #osdev
deckard has quit [Quit: l8r]
deckard has joined #osdev
<heat> gog: sup
<gog> heat
* gog applies a block of copper to heat
<gog> let that sink in
troseman has quit [Quit: troseman]
goliath has quit [Quit: SIGSEGV]
eddof13 has joined #osdev