Problems with io_threads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jens,

as said before I found some problems related to
the new io_threads together with signals.

I applied the diff (at the end) to examples/io_uring-cp.c
in order to run endless in order to give me time to
look at /proc/...

Trying to attach gdb --pid to the pid of the main process (thread group)
it goes into an endless loop because it can't attach to the io_threads.

Sending kill -STOP to the main pid causes the io_threads to spin cpu
at 100%.

Can you try to reproduce and fix it? Maybe same_thread_group() should not match?

Thanks!
metze

--- a/examples/io_uring-cp.c
+++ b/examples/io_uring-cp.c
@@ -116,17 +116,18 @@ static void queue_write(struct io_uring *ring, struct io_data *data)
        io_uring_submit(ring);
 }

-static int copy_file(struct io_uring *ring, off_t insize)
+static int copy_file(struct io_uring *ring, off_t _insize)
 {
        unsigned long reads, writes;
        struct io_uring_cqe *cqe;
        off_t write_left, offset;
        int ret;

-       write_left = insize;
+       write_left = _insize;
        writes = reads = offset = 0;

-       while (insize || write_left) {
+       while (_insize || write_left) {
+               off_t insize = _insize;
                int had_reads, got_comp;

                /*
@@ -219,6 +220,10 @@ static int copy_file(struct io_uring *ring, off_t insize)
                        }
                        io_uring_cqe_seen(ring, cqe);
                }
+
+               sleep(1);
+               write_left = _insize;
+               writes = reads = offset = 0;
        }

        return 0;



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux