From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8626E481250 for ; Thu, 13 Aug 2026 14:20:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786630806; cv=none; b=oO3smCAkaLjbHHBd7lkIzOp/AO7D8X2FIdzzMdQix11FgSgzHREvnikXErzfIxf3odDFM3FpWFoKUfpGjcYGXC6eUDuq7B11RlnQa5KTXkZHJBTtTb2SgfL9Ny9o7bGmcHjT1AwuwacGQld/jaRatfECjm7cF8r2n6BWZVLC5K0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786630806; c=relaxed/simple; bh=wjUMRlc+Y1doDFq1aZ6ziincgKcIfc8ASE042zFyLrk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VOwMewStv9XbxCr3Eu+ZeG8SunSiXfB7Wp7k1AG+kjNc8rcP3bo23rQzeqaMtmzEJkMHyUeDE+3cwz4BTUc3K2DbvymIvadL/QjnTFuo2i8hS+d/udQdIVK91zQptLL9PVBSfYYRu7GvD9a3oGRaDb1M45fcNgc9Nj7f2gJObL4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=nupE95MJ; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="nupE95MJ" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 22E5F1596; Thu, 13 Aug 2026 07:19:56 -0700 (PDT) Received: from localhost (unknown [10.2.196.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B07E53F632; Thu, 13 Aug 2026 07:19:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1786630800; bh=wjUMRlc+Y1doDFq1aZ6ziincgKcIfc8ASE042zFyLrk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nupE95MJPy4vZp6MAdt3R4myZZ0F2Uw3J9oXPYgRFhrkoc6/fUI6EHhltRSADx7CV KyIzZ2Ldzq8uhv+2AX730uoUJJT/F4sPTAopdcujeAytQtYEyTUQ2P/FfpeB150TcI SRpxnC3W2feH+lpz8Llo7608WHiaEplNYi7ee6pE= Date: Thu, 13 Aug 2026 15:19:57 +0100 From: Leo Yan To: James Clark Cc: Suzuki K Poulose , Mike Leach , Suyash Mahar , Yeoreum Yun , Greg Kroah-Hartman , Qi Liu , Junhao He , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jonathan Cameron , sashiko-bot Subject: Re: [PATCH v3 3/8] coresight: etm-perf: Flush workqueue before unloading module Message-ID: <20260813141957.GB8904@e132581.arm.com> References: <20260728-james-cs-multiple-per-threads-v3-0-6aee7579f1dc@linaro.org> <20260728-james-cs-multiple-per-threads-v3-3-6aee7579f1dc@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260728-james-cs-multiple-per-threads-v3-3-6aee7579f1dc@linaro.org> On Tue, Jul 28, 2026 at 04:00:15PM +0100, James Clark wrote: > The work queue is never flushed on module unload, so pending work items > can run after coresight-config is cleaned up or the .text section is > unloaded. The global workqueue also can't be flushed manually, so change > it to a local workqueue and flush it on exit. Why can't we drop the workqueue if it introduces race conditions and complexity? In particular, I don't see much benefit from deferring the resource release. According to the comment in __rb_free_aux(), the free_aux() callback should never be called from atomic context. It should be safe to release the resources directly from the free_aux() callback, without going through a workqueue. Thanks, Leo