public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Glauber Costa <[email protected]>,
	[email protected], Avi Kivity <[email protected]>
Subject: Re: Kernel BUG when registering the ring
Date: Mon, 10 Feb 2020 20:25:30 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAD-J=zZ7OFgqp88HrpKt4sW10AzjasaPkKSM7Gv68TiJt_3RxQ@mail.gmail.com>

On 2/10/20 6:22 PM, Glauber Costa wrote:
> Hello my dear io_uring friends
> 
> Today I tried to run my tests on a different, more powerful hardware
> (70+ Hyperthreads) and it crashed on creating the ring.
> 
> I don't recall anything fancy in my code for creating the ring -
> except maybe that I size the cq ring differently than the sq ring.
> 
> The backtrace attached leads me to believe that we just accessed a
> null struct somewhere

Yeah, but it's in the alloc code, it's not in io-wq/io_uring.
Here's where it is crashing:

struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data)
{
	[...]
	for_each_node(node) {
		struct io_wqe *wqe;

		wqe = kzalloc_node(sizeof(struct io_wqe), GFP_KERNEL, node);

I guess the node isn't online, and that's why it's crashing. Try the
below for starters, it should get it going.


diff --git a/fs/io-wq.c b/fs/io-wq.c
index 182aa17dc2ca..3898165baccb 100644
--- a/fs/io-wq.c
+++ b/fs/io-wq.c
@@ -1115,8 +1116,11 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data)
 
 	for_each_node(node) {
 		struct io_wqe *wqe;
+		int alloc_node = node;
 
-		wqe = kzalloc_node(sizeof(struct io_wqe), GFP_KERNEL, node);
+		if (!node_online(alloc_node))
+			alloc_node = NUMA_NO_NODE;
+		wqe = kzalloc_node(sizeof(struct io_wqe), GFP_KERNEL, alloc_node);
 		if (!wqe)
 			goto err;
 		wq->wqes[node] = wqe;

-- 
Jens Axboe


  reply	other threads:[~2020-02-11  3:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11  1:22 Kernel BUG when registering the ring Glauber Costa
2020-02-11  3:25 ` Jens Axboe [this message]
2020-02-11  3:45   ` Glauber Costa
2020-02-11  3:50     ` Jens Axboe
2020-02-11 13:01       ` Glauber Costa
2020-02-11 18:58         ` Jens Axboe
2020-02-11 19:23           ` Glauber Costa
2020-02-11 19:24             ` Jens Axboe
2020-02-12 22:31           ` Jann Horn
2020-02-13 15:20             ` Jens Axboe

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox