All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Petr Chmelar <petr.chmelar@innovatrics.com>
Cc: dhowells@redhat.com, Christian Brauner <christian@brauner.io>,
	Paulo Alcantara <pc@manguebit.org>,
	Matthew Wilcox <willy@infradead.org>,
	Namjae Jeon <linkinjeon@kernel.org>,
	Marc Dionne <marc.dionne@auristor.com>,
	Stefan Metzmacher <metze@samba.org>,
	Eric Van Hensbergen <ericvh@kernel.org>,
	Dominique Martinet <asmadeus@codewreck.org>,
	Ilya Dryomov <idryomov@gmail.com>,
	netfs@lists.linux.dev, linux-afs@lists.infradead.org,
	linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org,
	ceph-devel@vger.kernel.org, v9fs@lists.linux.dev,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v12 4/5] cachefiles: Don't rely on backing fs storage map for most use cases
Date: Tue, 13 Oct 2026 08:54:58 +0100	[thread overview]
Message-ID: <1655268.1791878098@warthog.procyon.org.uk> (raw)
In-Reply-To: <20261011.cachefiles-partial-zeros.pchmelar@innovatrics.com>

Petr Chmelar <petr.chmelar@innovatrics.com> wrote:

> Reproducer: random 64 KiB reads covering half of a 256 MiB file of
> random data, then a full read after dropping the page cache, compared
> with the original per 64 KiB block:
> 
>   fio --name=half --filename=/mnt/part.bin --rw=randread --bs=64k \
>       --ioengine=psync --fadvise_hint=random --size=256m --io_size=128m \
>       --randrepeat=1
>   sync; echo 3 > /proc/sys/vm/drop_caches
>   cmp /mnt/part.bin /path/to/original

Unfortunately, I can't reproduce this.  Can you get me some tracing?

echo 65536 >/sys/kernel/tracing/buffer_size_kb
echo 1 >/sys/kernel/tracing/events/netfs/netfs_read/enable
echo 1 >/sys/kernel/tracing/events/netfs/netfs_write/enable
echo 1 >/sys/kernel/tracing/events/netfs/netfs_rreq/enable
echo 1 >/sys/kernel/tracing/events/netfs/netfs_sreq/enable
echo 1 >/sys/kernel/tracing/events/netfs/netfs_failure/enable
echo 1 >/sys/kernel/tracing/events/cachefiles/cachefiles_coherency/enable

before running, then after running do:

cat /sys/kernel/tracing/trace | bzip2 -9 >/tmp/cachefiles-bug.trace.bz2

When I do this and grep the trace output for 'WRITEBACK\|WRIT TERM\|cachefiles'
it all looks reasonable, looking something like:

fio-5895 : netfs_write: R=00001301 WRITEBACK c=00000006 o=00000004 i=c6a742 by=0-ffffffffffffffff
fio-5895 : netfs_sreq: R=00001301[2] WRIT TERM  f=100 s=0 100000/100000 s=7 e=0
fio-5895 : netfs_sreq: R=00001301[4] WRIT TERM  f=100 s=100000 100000/100000 s=15 e=0
fio-5895 : netfs_sreq: R=00001301[6] WRIT TERM  f=100 s=200000 100000/100000 s=23 e=0
fio-5895 : netfs_sreq: R=00001301[8] WRIT TERM  f=100 s=300000 100000/100000 s=0 e=0
fio-5895 : netfs_sreq: R=00001301[a] WRIT TERM  f=100 s=400000 100000/100000 s=8 e=0
fio-5895 : netfs_sreq: R=00001301[c] WRIT TERM  f=100 s=500000 100000/100000 s=16 e=0
fio-5895 : netfs_sreq: R=00001301[e] WRIT TERM  f=100 s=600000 100000/100000 s=24 e=0
...
fio-5895 : netfs_sreq: R=00001301[1f4] WRIT TERM  f=100 s=f900000 100000/100000 s=15 e=0
fio-5895 : netfs_sreq: R=00001301[1f6] WRIT TERM  f=100 s=fa00000 100000/100000 s=23 e=0
fio-5895 : netfs_sreq: R=00001301[1f8] WRIT TERM  f=100 s=fb00000 100000/100000 s=0 e=0
fio-5895 : netfs_sreq: R=00001301[1fa] WRIT TERM  f=100 s=fc00000 100000/100000 s=8 e=0
fio-5895 : netfs_sreq: R=00001301[1fc] WRIT TERM  f=100 s=fd00000 100000/100000 s=16 e=0
fio-5895 : netfs_sreq: R=00001301[1fe] WRIT TERM  f=100 s=fe00000 100000/100000 s=24 e=0
fio-5895 : netfs_sreq: R=00001301[200] WRIT TERM  f=100 s=ff00000 100000/100000 s=1 e=0
 kworker : cachefiles_coherency: o=00000004 SET ok   B=46012e oz=10000000 c=2 aux=0 dsk=0

You can see the writes to the cache terminating and then the cache is set c=2
which is CACHEFILES_CONTENT_ALL indicating that the cache file has no holes in
it.

That happens pretty much as soon as fio lays out its file and then all future
accesses are just reads from the cache.

Looking at the UPLD lines is interesting:

fio-5895 : netfs_sreq: R=00001301[185] UPLD TERM  f=110 s=c1fedd0 fffe8/fffe8 s=8 e=0
fio-5895 : netfs_sreq: R=00001301[187] UPLD TERM  f=110 s=c2fedb8 fffe8/fffe8 s=16 e=0
fio-5895 : netfs_sreq: R=00001301[189] UPLD TERM  f=110 s=c3feda0 fffe8/fffe8 s=24 e=0
fio-5895 : netfs_sreq: R=00001301[18b] UPLD TERM  f=110 s=c4fed88 fffe8/fffe8 s=1 e=0

I guess 9P can't quite squeeze 1M of data in a packet as metadata has to go in
as well.

One further question occurs to me: does the entire 256M file fit in the test
VM's memory?

Thanks,
David


  reply	other threads:[~2026-10-13  7:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 22:02 [PATCH v12 0/5] netfs, cachefiles: Changes for next, primarily occupancy tracking-related David Howells
2026-09-10 22:02 ` [PATCH v12 1/5] cachefiles: Clean up cachefiles_do_prepare_read() David Howells
2026-09-11 20:19   ` Paulo Alcantara
2026-09-10 22:02 ` [PATCH v12 2/5] netfs, cachefiles: Add a couple of traces for write failure David Howells
2026-09-11 20:19   ` Paulo Alcantara
2026-09-10 22:02 ` [PATCH v12 3/5] cachefiles: Add a tracepoint to log insufficient space errors David Howells
2026-09-11 20:19   ` Paulo Alcantara
2026-09-10 22:02 ` [PATCH v12 4/5] cachefiles: Don't rely on backing fs storage map for most use cases David Howells
2026-10-11  5:29   ` Petr Chmelar
2026-10-13  7:54     ` David Howells [this message]
2026-10-13  9:56       ` Petr Chmelar
2026-10-14  9:45         ` David Howells
2026-09-10 22:02 ` [PATCH v12 5/5] cachefiles: Preset the state xattr when creating a new file David Howells
2026-09-11 20:21   ` Paulo Alcantara
2026-09-25 14:15 ` [PATCH v12 0/5] netfs, cachefiles: Changes for next, primarily occupancy tracking-related Christian Brauner
2026-10-11  5:29 ` Petr Chmelar
2026-10-13  8:14   ` David Howells
2026-10-13 10:43     ` Daire Byrne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1655268.1791878098@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=asmadeus@codewreck.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=christian@brauner.io \
    --cc=ericvh@kernel.org \
    --cc=idryomov@gmail.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=marc.dionne@auristor.com \
    --cc=metze@samba.org \
    --cc=netfs@lists.linux.dev \
    --cc=pc@manguebit.org \
    --cc=petr.chmelar@innovatrics.com \
    --cc=v9fs@lists.linux.dev \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.