Page MenuHomeFreeBSD

Improve error reporting in swap_pager
ClosedPublic

Authored by trasz on Mar 25 2019, 11:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Aug 10, 11:44 AM
Unknown Object (File)
Thu, Jul 25, 6:03 AM
Unknown Object (File)
Jul 16 2024, 8:57 PM
Unknown Object (File)
Jul 9 2024, 6:11 PM
Unknown Object (File)
Jul 9 2024, 6:05 PM
Unknown Object (File)
Jul 8 2024, 4:40 AM
Unknown Object (File)
Jul 5 2024, 10:20 PM
Unknown Object (File)
Feb 26 2024, 7:07 AM
Subscribers

Details

Summary

Improve error reporting when swap pager runs out of memory.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Why do you consider this to be an improvement ?

sys/vm/swap_pager.c
1258 ↗(On Diff #55421)

If mentioning improvements for messages from swap pager, this one is the thing that I always wanted to fix when I see it, but forget right after.

Note that the message above is printed unconditionally after timeout, regardless of the page state. It should be only printed if page is still being read from the swap.

2696 ↗(On Diff #55421)

cannot allocate bio.

I consider this an improvement, because swap pager's failure to allocate stuff is not an I/O error: it's an error internal to the swap_pager itself, and not eg the swap device. Besides, it makes it easier to find out exactly what happened, and find the source code line responsible for it.

sys/vm/swap_pager.c
1258 ↗(On Diff #55421)

Not sure I understand. If the wait timed out, how can the page be already successfully read in?

2696 ↗(On Diff #55421)

Ok, will fix.

sys/vm/swap_pager.c
1258 ↗(On Diff #55421)

Reading is async, on loaded machine we might be woken up too late, e.g. the done callback could race with the callout which wakes up the thread. Also, this message probably should be printed only once for swapping attempt.

trasz added inline comments.
sys/vm/swap_pager.c
1258 ↗(On Diff #55421)

To be honest I'd rather leave it for another time - I don't have a good way to reproduce that problem right now.

This revision is now accepted and ready to land.Mar 26 2019, 7:03 PM
This revision was automatically updated to reflect the committed changes.