All of lore.kernel.org
 help / color / mirror / Atom feed
* Problems with io_threads
@ 2021-03-19 23:27 Stefan Metzmacher
  2021-03-15 17:01 ` [RFC PATCH 00/10] Complete setup before calling wake_up_new_task() and improve task->comm Stefan Metzmacher
  2021-03-19 23:46 ` Problems with io_threads Jens Axboe
  0 siblings, 2 replies; 27+ messages in thread
From: Stefan Metzmacher @ 2021-03-19 23:27 UTC (permalink / raw)
  To: Jens Axboe; +Cc: io-uring

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;

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2021-03-20 22:39 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19 23:27 Problems with io_threads Stefan Metzmacher
2021-03-15 17:01 ` [RFC PATCH 00/10] Complete setup before calling wake_up_new_task() and improve task->comm Stefan Metzmacher
2021-03-15 17:01   ` [RFC PATCH 01/10] kernel: always initialize task->pf_io_worker to NULL Stefan Metzmacher
2021-03-15 17:01   ` [RFC PATCH 02/10] io_uring: io_sq_thread() no longer needs to reset current->pf_io_worker Stefan Metzmacher
2021-03-15 17:01   ` [RFC PATCH 03/10] io-wq: call set_task_comm() before wake_up_new_task() Stefan Metzmacher
2021-03-15 17:01   ` [RFC PATCH 04/10] io_uring: complete sq_thread setup before calling wake_up_new_task() Stefan Metzmacher
2021-03-15 17:01   ` [RFC PATCH 05/10] io-wq: protect against future set_task_comm() overflows Stefan Metzmacher
2021-03-15 17:01   ` [RFC PATCH 06/10] io_uring: " Stefan Metzmacher
2021-03-15 17:01   ` [RFC PATCH 07/10] fs/proc: hide PF_IO_WORKER in get_task_cmdline() Stefan Metzmacher
2021-03-15 17:01   ` [RFC PATCH 08/10] fs/proc: protect /proc/<pid>/[task/<tid>]/comm for PF_IO_WORKER Stefan Metzmacher
2021-03-15 17:01   ` [RFC PATCH 09/10] io-wq: add io_wq_worker_comm() helper function for dynamic proc_task_comm() generation Stefan Metzmacher
2021-03-15 17:01   ` [RFC PATCH 10/10] fs/proc: make use of io_wq_worker_comm() for PF_IO_WORKER threads Stefan Metzmacher
2021-03-17 22:42   ` [RFC PATCH 00/10] Complete setup before calling wake_up_new_task() and improve task->comm Jens Axboe
2021-03-17 23:06     ` Stefan Metzmacher
2021-03-17 23:26       ` Jens Axboe
2021-03-20  0:00   ` [PATCH v2 0/5] " Stefan Metzmacher
2021-03-20  0:00     ` [PATCH v2 1/5] kernel: always initialize task->pf_io_worker to NULL Stefan Metzmacher
2021-03-20  0:00     ` [PATCH v2 2/5] io_uring: io_sq_thread() no longer needs to reset current->pf_io_worker Stefan Metzmacher
2021-03-20  0:00     ` [PATCH v2 3/5] io-wq: call set_task_comm() before wake_up_new_task() Stefan Metzmacher
2021-03-20  0:00     ` [PATCH v2 4/5] io_uring: complete sq_thread setup before calling wake_up_new_task() Stefan Metzmacher
2021-03-20  0:00     ` [PATCH v2 5/5] fs/proc: hide PF_IO_WORKER in get_task_cmdline() Stefan Metzmacher
2021-03-20  1:24     ` [PATCH v2 0/5] Complete setup before calling wake_up_new_task() and improve task->comm Jens Axboe
2021-03-20 19:22       ` Stefan Metzmacher
2021-03-20 22:39         ` Jens Axboe
2021-03-19 23:46 ` Problems with io_threads Jens Axboe
2021-03-20  0:25   ` Stefan Metzmacher
2021-03-20  1:20     ` Jens Axboe

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.