NetBSD Problem Report #48873

From  Wed Jun  4 23:57:36 2014
Return-Path: <>
Received: from ( [])
	(using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "", Issuer "Postmaster" (verified OK))
	by (Postfix) with ESMTPS id 86C8AA6516
	for <>; Wed,  4 Jun 2014 23:57:36 +0000 (UTC)
Message-Id: <>
Date: Wed,  4 Jun 2014 23:57:35 +0000 (UTC)
Subject: xbdback kernel thread created with wrong priority
X-Send-Pr-Version: www-1.0

>Number:         48873
>Category:       port-xen
>Synopsis:       xbdback kernel thread created with wrong priority
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    port-xen-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 05 00:00:00 +0000 2014
>Closed-Date:    Sat Jun 23 15:33:28 +0000 2018
>Last-Modified:  Sat Jun 23 15:33:28 +0000 2018
>Originator:     Andy Tucker
>Release:        6.1.4
Bracket Computing
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.




State-Changed-From-To: open->closed
State-Changed-When: Sat, 23 Jun 2018 15:33:28 +0000
Fixed in rev. 1.61 of xbdback_xenbus.c on 2015-11-15 already. Thanks for report.


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.