From owner-freebsd-current@freebsd.org Wed Jul 1 22:28:49 2015 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 CA305992A04 for ; Wed, 1 Jul 2015 22:28:49 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ie0-x22f.google.com (mail-ie0-x22f.google.com [IPv6:2607:f8b0:4001:c03::22f]) (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 92D0C24A9 for ; Wed, 1 Jul 2015 22:28:49 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by iecuq6 with SMTP id uq6so44617265iec.2 for ; Wed, 01 Jul 2015 15:28:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7cbsL2cobg+B0lvAN9Ae/DS31GPLQg6Hx7Y2wV3/m4g=; b=rlpZUGGP/iHg9+YCLRyfDncSE3Vc8Lc7xshEoLAspVanIOwSBO2HjOV2WP9/unavmo FlKWAFaLT9a5RHcw8Rsn1aibMER4qtta7a/w0kir6If/zLfzzt1d+8cbcO4FRgKUh0WB 6qV2nsw/r4C52x++XY/UlSIImntqA/hoSgDXIYh1uln1qMd+o0aQiW2cb3wfubccYA0l kl3NXsi/RBoVwk/wuN0smfEGh+IhEQJzipficDJUD7a/jg/G39MapsaV+L8kGsSzW4Qu 0zfYR2CnjcAFeWmJuiIrAH/LW1mk+5u5OJNGT4lkPTxPs1T3JVAWQRlHqio4/tY/d1Pn pADA== MIME-Version: 1.0 X-Received: by 10.50.87.74 with SMTP id v10mr9008588igz.37.1435789729083; Wed, 01 Jul 2015 15:28:49 -0700 (PDT) Received: by 10.107.145.68 with HTTP; Wed, 1 Jul 2015 15:28:49 -0700 (PDT) In-Reply-To: <20150701213241.GG2080@kib.kiev.ua> References: <20150701213241.GG2080@kib.kiev.ua> Date: Wed, 1 Jul 2015 18:28:49 -0400 Message-ID: Subject: Re: How should a driver shutdown a taskqueue on detach? From: Ryan Stone To: Konstantin Belousov Cc: Jack Vogel , FreeBSD Current Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 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: Wed, 01 Jul 2015 22:28:49 -0000 On Wed, Jul 1, 2015 at 5:32 PM, Konstantin Belousov wrote: > Do you mean, you want some KPI like > boolean taskqueue_is_draining(struct taskqueue *p); > so that e.g. executed task could see if it is executing in the > shutdown state ? I'd prefer a KPI that stops a taskqueue from accepting new tasks (and drops attempts to enqueue on the floor). Then I could do something like: taskqueue_stop() disable_interrupts() taskqueue_drain_all() taskqueue_free()