Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Sep 2011 18:29:05 -0400
From:      Ryan Stone <rysto32@gmail.com>
To:        Arnaud Lacombe <lacombar@gmail.com>
Cc:        freebsd-net@freebsd.org, Jack Vogel <jfvogel@gmail.com>
Subject:   Re: FreeBSD 7-STABLE mbuf corruption
Message-ID:  <CAFMmRNwrD-v52iW5%2Bw_hbgL9battHjXSKcOWBTiMnBHM-cURXg@mail.gmail.com>
In-Reply-To: <CACqU3MV7JRxQ_mNeHCk7RVyzETZLAcc3XL=xyZ-qqtPfRxkZeQ@mail.gmail.com>
References:  <CACqU3MUs9Z9GeuGe=8iVp=MWV6eG-tO%2BkHb1znatsTq2uEqwvA@mail.gmail.com> <CACqU3MXf52tLajTfVCEiGGhtCuXsesrdM65LfsoGecuZj2tNwA@mail.gmail.com> <CAFOYbc=mu7rGU8LudLSzZwKfM3QHFw%2BPGEHHKD3rcA2=dxGfoQ@mail.gmail.com> <CACqU3MV7JRxQ_mNeHCk7RVyzETZLAcc3XL=xyZ-qqtPfRxkZeQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--0015174be814e31ea404acda2b4a
Content-Type: text/plain; charset=ISO-8859-1

On Tue, Sep 13, 2011 at 2:36 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
> It did not crash, yet. The only downside is that after 3h30 and ~4h,
> igb(4) queues' handler started spinning infinitely, breaking network
> connectivity.

I saw a similar issue on HEAD last week.  The attached patch fix the
problem for me.  The problem was that if a struct task's ta_pending
field overflows, the task will be inserted into a list when it is
already in that list, causing a cycle in the list of tasks to be run.
This causes the taskqueue thread to spin indefinitely as it looks over
the cycle again and again.

In case the list eats the patch, it was:

Index: sys/kern/subr_taskqueue.c
===================================================================
--- sys/kern/subr_taskqueue.c   (revision 225537)
+++ sys/kern/subr_taskqueue.c   (working copy)
@@ -173,7 +173,8 @@
         * Count multiple enqueues.
         */
        if (task->ta_pending) {
-               task->ta_pending++;
+               if (task->ta_pending < UINT16_MAX)
+                       task->ta_pending++;
                return (0);
        }

--0015174be814e31ea404acda2b4a
Content-Type: application/octet-stream; name="taskqueue.patch"
Content-Disposition: attachment; filename="taskqueue.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gsjgcqyn2

SW5kZXg6IHN5cy9rZXJuL3N1YnJfdGFza3F1ZXVlLmMKPT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL2tlcm4v
c3Vicl90YXNrcXVldWUuYwkocmV2aXNpb24gMjI1NTM3KQorKysgc3lzL2tlcm4vc3Vicl90YXNr
cXVldWUuYwkod29ya2luZyBjb3B5KQpAQCAtMTczLDcgKzE3Myw4IEBACiAJICogQ291bnQgbXVs
dGlwbGUgZW5xdWV1ZXMuCiAJICovCiAJaWYgKHRhc2stPnRhX3BlbmRpbmcpIHsKLQkJdGFzay0+
dGFfcGVuZGluZysrOworCQlpZiAodGFzay0+dGFfcGVuZGluZyA8IFVJTlQxNl9NQVgpCisJCQl0
YXNrLT50YV9wZW5kaW5nKys7CiAJCXJldHVybiAoMCk7CiAJfQogCg==
--0015174be814e31ea404acda2b4a--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFMmRNwrD-v52iW5%2Bw_hbgL9battHjXSKcOWBTiMnBHM-cURXg>