Posts
5724
Following
218
Followers
554
Linux kernel mm contributor, kernel/systems developer, writing a book about mm.

C/C++/(rust at some point!)

Book - https://linuxmemory.org/
Me - https://ljs.io/
Music - https://soundcloud.com/distal_music/

Arsenal fan, cat maniac, synth experimentalist. Brit.

Opinions are all my own and represent nobody else.

Lorenzo Stoakes

Was hoping I could finish the swap chapter today, but swap readahead has thwarted me.

Back on it tmr.
0
0
1

i cant login to discord because they forgot to add the 0 key to the numpad

10
12
4

Lorenzo Stoakes

Signs the book is (too?) big - I am constantly having to grep for things to see if I mentioned them before...
0
0
1

Lorenzo Stoakes

One of the ways you can get tripped up in kernel code is that sometimes something really major happens and it isn't in any way highlighted.

For instance - when reading from disk into a folio (whether file-backed or from swap), the folio is locked and will become unlocked once it is 'uptodate' (i.e. has the PG_uptodate flag set).

That renders all instances of trying to lock a folio a barrier that either waits for the read to happen or, as if often the case, incorporates some ability to tell the caller 'ok I need to wait on I/O try again later' as userland experiences with async I/O.

A good example of this is do_swap_page() [0], where we kick off either a synchronous or async read from disk (see block starting at line 3766), but later (line 3878) indicate SIGBUS if the page isn't uptodate.

The key here? Line 3826:

locked = lock_page_or_retry(page, vma->vm_mm, vmf->flags);

We try to lock the page, if I/O is done already we can, if it was synchronous we can, otherwise we either return VM_FAULT_RETRY to indicate the I/O is needed or we wait to acquire the lock.

After this line, we can safely assume the swap has been read from.

I kind of feel that a comment would be helpful here :>) [checking tip I see there isn't one, might add one myself], at the same time it's sort of assumed you'd know this was the case...

While I'm writing the book primarily to learn the mm in more depth, I hope pointing out stuff like this in it will help others over these kind of stumbling blocks.

[0]: https://elixir.bootlin.com/linux/v6.0/source/mm/memory.c#L3718
0
0
4

Lorenzo Stoakes

Transcendence.
0
0
4

Martin Boller 🇺🇦 tux freebsd windows mastodon

2
1
1

Lorenzo Stoakes

Mary chilling on #caturday
0
1
8

Lorenzo Stoakes

A great deal of harm has been done to society by people who have zero understanding of the internet and social media taking things said there at face value.
0
2
4

Lorenzo Stoakes

Hey @cwayne I'm coming to the US soon + since I'm on a strict diet I'm a bit limited what I can eat but I hear that arby's is the best restaurant in america, what would you recommend from their menu? Cheers!
1
0
1

Lorenzo Stoakes

Just hit over 1,200 pages :) We are now in the end stages for the 1st draft of the book.
0
2
13

Lorenzo Stoakes

Going to go ham on the swap chapter this long weekend (public hol on mon in UK).

Really, really need to finish this damn book soon haha (sanity slowly slipping away).

It's been a couple years of (really) hard work and even though I went to imperial so am used to being smashed down into the ground like those skulls in terminator 2, there are limits even to that...
0
0
1

Lorenzo Stoakes

Linus was a serpent in a previous life. And this one!
0
2
7

Kinda crazy that artificial intelligence needs the entire output of a nuclear reactor but actual intelligence can run on Twix bars and cocaine, for example.

8
15
3

Lorenzo Stoakes

Takes seen on masto recently:

- wfh caused google layoffs
- there's no such thing as talent in programming

If it wasn't for @ptesarik 's excellent shit post today I'd despair
0
0
3

Lorenzo Stoakes

A good rule of thumb for detecting whether something is evidenced/sensible or not is whether advocates can provide SPECIFIC and rational arguments for their beliefs.

If they hand wave, give generalisations + isolated examples, they're probably bullshitting.
1
0
0

Lorenzo Stoakes

Anti-WFH people continue to be totally unable to defend their position, waving their hands ever more vigorously, or referring to crap studies done by awful management consultancies employed by... err companies that want RTO...

WFH for jobs that permit it is obviously superior, the arguments in favour of RTO are really uncompelling and HUGELY outweighed by the negatives.

I'm yet to actually hear a compelling argument against WFH, the fact that corporations continue to push for RTO shows you how little (much) corporate behaviour relates to reality.

There's also a HUGE carbon cost for forcing people to come in. I thought we were meant to be concerned about climate change? Or do we just forget about that when bosses want to feel important?

The pandemic was the ultimate litmus test.
1
1
5

Mold 2.31 Released. It's up to 10% faster when linking very large executables with lots of debug info. https://github.com/rui314/mold/releases/tag/v2.31.0

0
5
2

Lorenzo Stoakes

Lots of people hating on the 14900 because of a few utterly critical issues with the bios. I stay loyal.*

*Mostly because I found a random Reddit post explaining how to fix the issues without degrading performance too badly
2
0
0

Foreign Secretary David Cameron visited Kyiv. The Foreign Secretary also kicked off negotiations with Ukraine on a 100 Year Partnership - a new agreement that will build enduring links between our two countries across the spectrum of trade, security and defence cooperation, science and tech, education, culture, and much more.

United Kingdom of Great Britain and Ukraine. Finally, .uk ccTLD will make sense.

0
1
2
Show older