NetBSD-Bugs archive

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

port-xen/48873: xbdback kernel thread created with wrong priority



>Number:         48873
>Category:       port-xen
>Synopsis:       xbdback kernel thread created with wrong priority
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    port-xen-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 05 00:00:00 +0000 2014
>Originator:     Andy Tucker
>Release:        6.1.4
>Organization:
Bracket Computing
>Environment:
>Description:
I noticed that the xbdback_xenbus driver (the backend driver for the Xen 
virtual block device) is passing the wrong value for the thread priority when 
creating a worker thread. It has:

        if (kthread_create(IPL_NONE, KTHREAD_MPSAFE, NULL,
            xbdback_thread, xbdi, NULL, "%s", xbdi->xbdi_name) == 0)

but the first argument of kthread_create is a thread priority, not an IPL. 
IPL_NONE evaluates to 0 on amd64, which results in a priority of 0. I assume 
that what was intended was PRI_NONE, which will result in a priority of 
PRI_KTHREAD or 96.

A priority of 0 could result in a priority inversion problem with user threads, 
where a spinning user level process prevents the xbdback thread from running 
and processing block I/O requests.
>How-To-Repeat:

>Fix:
Change IPL_NONE to PRI_NONE.



Home | Main Index | Thread Index | Old Index