From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6E843FF1AD for ; Fri, 14 Aug 2026 08:56:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786697775; cv=none; b=cmJ7UH8B7Yxf0gmpX/FjYS6nipby3fp+pNsoIQJe364ygxSpZumiocfSEvIuo0nP0BahnahBIUK6jmEIZMt9Y0ColV8ITbY7EPeXZcsbnUk9Wbl8w/6WkrzRnSgGhe85V2KcQd6gje2mHxhk+M0EyHna5wY5Eb2PGK58VUCA/QA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786697775; c=relaxed/simple; bh=bVAgDn7pZ6U7fn2/zMvYI8/azE1IareUlrmsoG/d7jA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nF9Jbs3QSozoP6L04IBhMWKsCiHoJjG3ixNfExV/zXey98FNhhDihpNynrU3kOe7Oo4UdHVZsDaT/8KzQ5OAQQMjPrE+K+w+9QE0oO7p1QmvxjeYZKg2nkBfdobY9KY1jon7h7lXQ0s0+wJFUNaqpR4pEDvKWD3sAIY4niWSdRE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=PmICT01l; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="PmICT01l" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4954a9e8490so11278525e9.1 for ; Fri, 14 Aug 2026 01:56:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1786697772; x=1787302572; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=JIGp9HjE1JQI0cU/AR14+B+jOi/q9Yhu0Kcy46p6P3U=; b=PmICT01lQM9gH5CjM69qsnWB6ydRea8K03065Kci4XW4m79PJYDy5CSMAPFJJ5jWeq feeXxZv+nQvE0f9rh2BE2bI5ZLLJ2oDsZ+xCPpfDQWsyOQ0kRRyI01EAKiyk5CT1NoTp crFDamDzyJPgdskqCjWtYQHTh1wjVRaFz5qvSRlTQCUv0PQZaxOdCZBl3ttNVFmJXNS4 8rD4SIKtE1Pe76CnXoEJXtqFPmUfZcyFE+x1vH9mMz7zbDVS2iQsjvC3S1GaUOv11E/n NXh6xLNblEWXddkQqStAJ2z5baXJXUYz4cSA3aASdpiGaEN32uvdLtDPpHB+k6M8rI/8 xicw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786697772; x=1787302572; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=JIGp9HjE1JQI0cU/AR14+B+jOi/q9Yhu0Kcy46p6P3U=; b=Bj/pbHE8wJCOgl/Its1EVeFiiZMwDBvQ4LzNBTsXBty6zFFkv9VJ1374sH77tvaHrd i7OBf03+9toPpjv8jOPng7sl83ilsH2CELtWOxiKOWWOQILWkPJy1LZOU++t84s4QgYC jEd44WDXmkuAulppz5kD6hcR8tck1EBaATYZAlx2494PP9k+CEVopNtL1D5VAFvj/QlJ W70xSNamaZ7eX/hK6mM90a3XUsNK2toksl8SWUkj64MM8okxe2VGUpV7Dhj/9Lg+q+mD y+mkE3aislnW4fwnAEGcr8p0cLMUcLsNRvPMm0YB5OtN5n9IX2SqutmnsKGrWX1XF6hN 3bYw== X-Forwarded-Encrypted: i=1; AHgh+RpYP+RD/Um4eN3buIU3vRdmJS8cSdAThB+EXsfp6xWZL1qs/tDnn8VeMiuh+z9LdcLO5wlST6okDej98HA=@vger.kernel.org X-Gm-Message-State: AOJu0YwJM0kQ4qLp+DbtmWyyzPtQA8If9Y6b1+1Np4n87w3UAp7IQ89+ asBc6PZpZjBCOuQZgWWj2i9e/Tgpin3O3tz026v2FKD9UbpQEm2DJjywubdmgDva5hQ= X-Gm-Gg: AR+sD12WjAMawwpV1oCPeDkbppsPNRq8a2aJVf+CIQVk70DkPVBertc9PhoeKEob/bz oWWKljQ7afh3ZBkEezW5TWbR0rvgWgOgluTDSgoiXzrgChWUc1EFEIfOAXHLuzVnbvW6Fcn4U9i DsSq4lf/1eG1/adIyPhBa814bya3iW/MDHh0NXm40zKoZlLwAi3IUMpsXyRhncCivKyDiyQQc94 JCu84W8WzulUG7B1nQfueG81EJR+eIxSeZcC0/tokg1Pq12rm4JaBjX6fWDzIWcjR138KO+vGcD SGvtD5klOVw8Zyga0rrSTOXz4/E8xPW1Gv4iWII7Yb/5RA2YA6nwmGfb4ttO4Bt166FQ+oxtqRU 4ihR7pcuQ3tApnmEx1cV8BZDd3f/yttJLs3i1IqEWknPFt5AL/DnJeYbvUOvLJjbt5p74rHq3RX 4p2ztDoOfuiLajqFK/zLgCYDnnOZdejCvLMqUmzIwp1n9yNcG/Md06jvVdd9aq1cBKqg== X-Received: by 2002:a05:600c:19c8:b0:495:69eb:27d3 with SMTP id 5b1f17b1804b1-49987ad94c3mr42378445e9.8.1786697772202; Fri, 14 Aug 2026 01:56:12 -0700 (PDT) Received: from [192.168.1.3] ([37.18.141.193]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49987b3a6dcsm19775145e9.1.2026.08.14.01.56.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Aug 2026 01:56:11 -0700 (PDT) Message-ID: Date: Fri, 14 Aug 2026 09:55:58 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 3/8] coresight: etm-perf: Flush workqueue before unloading module To: Leo Yan 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 References: <20260728-james-cs-multiple-per-threads-v3-0-6aee7579f1dc@linaro.org> <20260728-james-cs-multiple-per-threads-v3-3-6aee7579f1dc@linaro.org> <20260813141957.GB8904@e132581.arm.com> Content-Language: en-US From: James Clark In-Reply-To: <20260813141957.GB8904@e132581.arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 13/08/2026 15:19, Leo Yan wrote: > 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 Nice catch. This was fixed in Perf core in 95ff4ca26c49, very shortly after the Coresight Perf mode was merged. I'll change this commit to drop the workqueue completely.