From owner-freebsd-current@FreeBSD.ORG Fri Nov 12 14:22:17 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6C80106566B for ; Fri, 12 Nov 2010 14:22:17 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.swip.net [212.247.154.225]) by mx1.freebsd.org (Postfix) with ESMTP id 344668FC16 for ; Fri, 12 Nov 2010 14:22:16 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=4dE6tNKVm/0afO7MQGRPv7y2YwMo4emTIiDjbh74onY= c=1 sm=1 a=WrOSKJTHxIAA:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=6I5d2MoRAAAA:8 a=8kQB0OdkAAAA:8 a=cUOH5WmIVjWt6NUKwbwA:9 a=Hed6BA7jrvOL-rD0coUSZYBcI7EA:4 a=wPNLvfGTeEIA:10 a=SV7veod9ZcQA:10 a=9aOQ2cSd83gA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 48426232; Fri, 12 Nov 2010 15:22:15 +0100 From: Hans Petter Selasky To: freebsd-current@freebsd.org Date: Fri, 12 Nov 2010 15:23:17 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.1-STABLE; KDE/4.4.5; amd64; ; ) References: <06D5F9F6F655AD4C92E28B662F7F853E039E389A@seaxch09.desktop.isilon.com> <201011120956.04501.hselasky@c2i.net> In-Reply-To: X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'( =?iso-8859-1?q?=3B=5FIjlA=3A=0A=09hGE=2E=2EEw?=, =?iso-8859-1?q?XAQ*o=23=5C/M=7ESC=3DS1-f9=7BEzRfT=27=7CHhll5Q=5Dha5Bt-s=7Co?= =?iso-8859-1?q?TlKMusi=3A1e=5BwJl=7Dkd=7DGR=0A=09Z0adGx-x=5F0zGbZj=27e?=(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201011121523.18044.hselasky@c2i.net> Cc: mdf@freebsd.org Subject: Re: sleep bug in taskqueue(9) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 12 Nov 2010 14:22:17 -0000 On Friday 12 November 2010 15:18:46 mdf@freebsd.org wrote: > On Fri, Nov 12, 2010 at 12:56 AM, Hans Petter Selasky wrote: > > On Thursday 29 April 2010 01:59:58 Matthew Fleming wrote: > >> It looks to me like taskqueue_drain(taskqueue_thread, foo) will not > >> correctly detect whether or not a task is currently running. The check > >> is against a field in the taskqueue struct, but for the taskqueue_thread > >> queue with more than one thread, multiple threads can simultaneously be > >> running a task, thus stomping over the tq_running field. > >> > >> I have not seen any problem with the code as-is in actual use, so this > >> is purely an inspection bug. > >> > >> The following patch should fix the problem. Because it changes the size > >> of struct task I'm not sure if it would be suitable for MFC. > > > > 1) The u_char is going to leave a hole in that structure on ARM platforms > > for example. > > > > 2) The existing taskqueue implementation also has a missing check for the > > pending count wrapping to zero. I.E. it should stick at 0xFFFF and not > > wrap to 0. > > This commit mail is rather old, and this fix was incorrect, because > the task cannot be referenced after it has been run. Some task > handlers will free the task as part of the handler. Ok, maybe the e-mail got stuck somewhere. Have you fixed the above mentioned issues in a newer patch? --HPS