From owner-freebsd-current@freebsd.org Thu Feb 9 18:02:44 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 888D4CD3931 for ; Thu, 9 Feb 2017 18:02:44 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53D9AD50 for ; Thu, 9 Feb 2017 18:02:44 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-io0-x22a.google.com with SMTP id l66so23352487ioi.1 for ; Thu, 09 Feb 2017 10:02:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=5ebC8YW1PhbSlrvvgTMvp/cveIhl/3qR9tBFrRfnyzM=; b=s7BD3qyR7wLIVT58QPb83pMzeAeyjxL4T0EPOCILK3agHLnH3v2wIvNyb2Z6PyznyD HleOm3YmXWuFhPwXXvolCWOUDR5QzEabHOEQRvBFtLRb4xEQT9uy0qJxY77t+3PAwaCp X80As42S4m94hpKv2ed6AINfap3Od23meGGX9azpWa280IEG4NuL708jfQ5VhmsN+pCb 5IQRhRRq7iAaGcPcHGkQlp8aNpyxHkC7+AyGRM4mCB2pvLkAzbLox9FQySQd2rlUhCId 3RDtvk4JZOd48kwfTVDRVYY0ScBvT4CbuzNIBTY2RxTm+MDL6/nya1AMecVVMI2JZV8I 5mLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=5ebC8YW1PhbSlrvvgTMvp/cveIhl/3qR9tBFrRfnyzM=; b=LThZphXfLy7O6L2cByY3klSXqpfyjIwUMd1kWn4zeYobUUzk6jJqtNYUac0/ZyoTAW Dc94NC2d9OLkCaAykKy8ZNNfVf61vjzIfKVU2KOO/xnyGmqFpUAwI5IVbglnEg+HZImf hPxQk/KDcHQbDGpjwcfheG+/ITMwbdnjK7JugCuwRWtT84CTfHmPKdsnN/LZ2zNBImo0 Ih3oZFuesdcUvxXur44h0cWDAZXHs0/IEPnz6wOBqH024fk2AQ55lw8yFYSsqOe+/fqi pnppfUCjL5nKVmZJbP2BBXPE2ZUBLpSNaEBxnebI3/t0cFUvQKO0GbGElYo5rlR5EFxc RoIg== X-Gm-Message-State: AMke39kvBevJ+hIkDYKb/Q4dNV8ed2nOJL5WXdSLkQE6lKmMo9673Vhal2NUwoUiQUP2HS7tBUtErL0Q4EY8AA== X-Received: by 10.107.15.70 with SMTP id x67mr4295461ioi.103.1486663363523; Thu, 09 Feb 2017 10:02:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.190.71 with HTTP; Thu, 9 Feb 2017 10:02:43 -0800 (PST) From: Ryan Stone Date: Thu, 9 Feb 2017 13:02:43 -0500 Message-ID: Subject: [PATCH] Check for preemption after lowering a thread's priority To: FreeBSD Current Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2017 18:02:44 -0000 I've just put up a phabricator review for a fix to ULE and 4BSD for a priority inversion problem. The issue is that after a running thread's priority is lowered (usually due to releasing a mutex and having a priority load revoked), the scheduler does not check whether the thread should now be preempted by a thread waiting in the runq. See this old ML post for a detailed description of one instance that I saw: https://lists.freebsd.org/pipermail/freebsd-current/2013-January/039261.html The review can be found here: https://reviews.freebsd.org/D9518