On Thu, 25 Sep 2025 07:15:45 -0400
Steven Rostedt <[email protected]> wrote:

> I have yet to cause the retry path under stress tests. I had to insert
> a msleep() for testing purposes to make sure it worked.

I wanted to update on this. My stress test wasn't stressing enough. So
I took a "cp-mmap" program I had that did this:

        map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, ifd, 0);
        if (map == MAP_FAILED)
                exit(-1);
        ofd = open(argv[2], O_WRONLY | O_TRUNC | O_CREAT, 0644);
        if (ofd < 0)
                exit(-1);
        do {
                r = write(ofd, map + w, st.st_size - w);
                if (r < 0)
                        exit(-1);
                w += r;
        } while (w < st.st_size);


Where it mmaps the source file and then writes that. This would most
definitely fault at every write. Then I ran this while tracing
sys_entry_write() and an added trace_printk() in the goto again block:

 # mkdir /tmp/dump
 # for f in `find /usr/bin/ ` ; do n=`basename $f`; ./cp-mmap $f /tmp/dump/$n & 
done

And this did cause triggering:

 12771 writes where it triggered the again loop 1635 times.

Thus, it triggered 12% of the time under a very intensive stress.
That's still faster than allocation, not to mention if one is tracing
both system calls and allocations, it will start to dirty the trace.

-- Steve

Reply via email to