Cake - FQ_codel the next generation
 help / color / mirror / Atom feed
From: Pete Heist <pete@heistp.net>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: Cake List <cake@lists.bufferbloat.net>
Subject: Re: [Cake] lockup with multiple cake instances on 3.16.7
Date: Fri, 1 Feb 2019 00:10:29 +0100	[thread overview]
Message-ID: <B3CD1030-61D2-4D1A-A6E7-F19A7E6720E1@heistp.net> (raw)
In-Reply-To: <60A1337C-DE0E-43DE-B5CA-5815F615124D@heistp.net>


> On Jan 31, 2019, at 9:25 PM, Pete Heist <pete@heistp.net> wrote:
> 
> 1) Why is nla_put_u32 suddenly failing for TARGET_US after adding five cake instances?

nla_put_u32 is returning -EMSGSIZE, so the skb space in tailroom isn’t large enough (per nla_put doc).

After it fails, cake_dump_stats is called a second time right away, which succeeds. I _think_ what’s happening here is that after it sees -EMSGSIZE, the kernel allocates more tailroom and calls cake_dump_stats again. This doesn’t happen for kernel 4.9.0, it always succeeds, so presumably the initial size is larger.

> 2) Is calling sch_tree_unlock the right thing to do in the failure case, or am I working around a kernel bug, and doing something that would fail in other kernels?

I don’t think we’d want to do this after that same edb09eb17 commit. :) So at a minimum, to unlock after error:

 nla_put_failure:
        nla_nest_cancel(d->skb, stats);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
+       sch_tree_unlock(sch);
+#endif
        return -1;
 }

The question still is, would that break other kernel versions if an error occurs? If the tree is unlocked again elsewhere in some kernel versions after an error, that would end badly. It looks like in tc_fill_qdisc (sch_api.c) that gnet_stats_finish_copy, which unlocks, is not called if q->ops->dump_stats returns < 0. So I’m not sure how it ever unlocked properly in case of error. Hrm.

Do you think this is a correct patch?


  parent reply	other threads:[~2019-01-31 23:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30  8:58 Pete Heist
2019-01-30 22:59 ` Toke Høiland-Jørgensen
2019-01-31  7:15   ` Pete Heist
2019-01-31 14:53     ` Toke Høiland-Jørgensen
2019-01-31 20:25       ` Pete Heist
2019-01-31 23:09         ` Toke Høiland-Jørgensen
2019-01-31 23:18           ` Pete Heist
2019-01-31 23:10         ` Pete Heist [this message]
2019-01-31 23:18           ` Toke Høiland-Jørgensen
2019-01-31 23:23             ` Pete Heist
2019-01-31 23:31               ` Toke Høiland-Jørgensen

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

  List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/

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

  git send-email \
    --in-reply-to=B3CD1030-61D2-4D1A-A6E7-F19A7E6720E1@heistp.net \
    --to=pete@heistp.net \
    --cc=cake@lists.bufferbloat.net \
    --cc=toke@redhat.com \
    /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