Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Nov 2024 14:43:22 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        freebsd-fs <fs@FreeBSD.org>
Subject:   tmpfs loses (sub-page chunks of) data?
Message-ID:  <a301f26f-0c67-48c3-af08-5f36c7ce764f@FreeBSD.org>

next in thread | raw e-mail | index | archive | help

We have a number of servers based on FreeSBD 13.3 that initially write some data 
to files on tmpfs and then the files are dispatched elsewhere.  The writes are 
done by appending variable sized records to a file.  There are no seeks or 
overwrites.

I observe that occasionally (very rarely indeed given the amount of data 
produced) we get a corrupted file.

In all cases so far the corruption follows the same pattern: data range from the 
end of a record until the next page-aligned boundary is zeroed out.
That is, good data always continues from an offset which is multiple of 4096 and 
the zeroed area never crosses such offsets.

Because of the page boundary, I have a suspicion that either tmpfs or, perhaps, 
the broader VM subsystem might have a race where writing to a page does not mark 
it dirty.  Maybe this is related to paging out of a tmpfs page to the swap.

The problem is that I have never been able to observe this happening, the 
corruption gets detected after the fact, hours after it occurs.

If anyone could suggest any areas / changes / techniques to explore the problem, 
I would be much obliged.

Thank you.
-- 
Andriy Gapon




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a301f26f-0c67-48c3-af08-5f36c7ce764f>