From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (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 7B1B43F9F3D for ; Wed, 29 Apr 2026 12:44:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777466694; cv=none; b=j+iomXP9/IMsC3CVDEU8oNzmk8LExljDznf7jZxfgKgPwEdvzgs5DfJkNiiZuVajpYNScdkO/ezsSmsFWdvSc6P4vLvp9CFhQp+Hg1w7XDTfhFttgjI/HjYQQPd+DaqIsx87NzEthac2H9devRzJ4dt+iYzmgJ2eBX/9v0NVuQU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777466694; c=relaxed/simple; bh=cH/0qZ1LJLqk2hgeVUqmt+2yHUuaR5aF35EFiEHHd1Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KK8bzSszMUHjreQaPCulcyv2Xbv452lX1H2y5OmJos45qi7kzjbbx0q5J3ZfFnVLKB619ZF+ag/EmGYItwBLJZ3oQn6eHYqZx/wTV5q1fNmHJeAIqh54Fa/R2jrShuFbchosmp2vlWS0943X3zVWpz89/iCI+m+vfRlnusc32fc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=cjdOky50; arc=none smtp.client-ip=209.85.219.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="cjdOky50" Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-8aca6bd57cfso115851976d6.0 for ; Wed, 29 Apr 2026 05:44:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1777466692; x=1778071492; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=cH/0qZ1LJLqk2hgeVUqmt+2yHUuaR5aF35EFiEHHd1Q=; b=cjdOky503JQ9yaX5eUxHq1FyaTqO6CmB0Lxv5TIoctF+80Zj0oBshdaoS2+bsgV0Da pO6PrLwbXT+hFJCIwhoK8x9wkdkCXrTEbEnjyaTxCV7eh9uYnkNGg5zzkwanvFcIT0Sd j72sRmqFoSgWZv8Y2GVgbaYzh+osMBCIIjpbXhiyKxpfI3viVP9DjvW1nOO1Mx/Sj6sJ IIiRMEUk8JUJmYhNdNVL1sMID2TzAVXhDYQDyYfi/UMRY/7sjkoA2RKH9clpF9maeByy xbzhCUKiXviH4utGdllvkb+1gf6gAM8nJ1YMJqkw/1pWHBC3hjntIe16Xphy5zy201nQ s7Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777466692; x=1778071492; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cH/0qZ1LJLqk2hgeVUqmt+2yHUuaR5aF35EFiEHHd1Q=; b=bItUpr9wYVkxXiAq0lLDaAu17iIgoEawFKOwoFtVE8Lx2DURFGSxnN/W94DNDDuMiM 7c4fn4686znQiNf2Dd8tvJpPns+ud/w0UqTqLAeMPQJCOAn+TeUFXLnJdMJMkqR6m4Gs kcnJegicWcV5/62mD/jdkK/XM5H/ik0SGPAM9YSLuq0lHwbncJ/bcHQHHQPTqDu2A4Vr BrHRd1m7/RQbf4XwgUPU9tKPrXaAhxYT7q4+XmTACpSZBrYOJ+iQgczxqVnMZ4iyXTJX GRz01NlvfMbcxZ2E1nRx+DZlDzh2kM+F5E0Vt7fp7JxIb3icnz1ZEijFS/2taLrQ2ikt XixQ== X-Forwarded-Encrypted: i=1; AFNElJ+WJgWn62yvl+0fvwahuEb3EIVFCcQ9GEx27JowM1WJddIrc9CYnG6yUNMByZgZ7QSLsoW4b7o=@vger.kernel.org X-Gm-Message-State: AOJu0YwiqdwS4XUODltAY9tGGwzcNJO8+hJ8dfx+YlDY7t7V5nK8UzaC GkkZeOJr9TvQb8tuwoIyjY6oG8fKwGyKEFdAAxrpYy6gyAF64U7PwXSQjt4P6eJuWzM= X-Gm-Gg: AeBDiesBhHjpnTY3aS2ghKGfKT9eYSzGFpEXtE3EvZ0CWPApiT10zjUBmvpTcacHpPQ XIqtOvdb0SgDDKenhxs1c2D6xLWyLVwrCrvfcjejECd3eqfw6mn1moTTYj1R3XNbxCgQO4f5kqs EmVUXhOqPXfLxComonXLQDJAg14H8dTwiAFxdE6U5oZLfZxiH2IiMnvhRQC+pzcgqSJCZ6IOARF 0TRmrSnUaBnqCRx24+jjKB3iFawQfEgLqpvL1aItRXXBFtVQ7lWlDaDU6QWrZ4NKMqg/Q1wS2OG Xadb+to9CwD37kGCKUANy/+Xb41CUzMlN3NOU84hyYKw2a3ejLbYV9HWCGRg73HXMfzatubEvNa H4bjfYHdw+wReSqRM7sUsfQRuKSuN0BhK181GgXTufaAz1E53T/FmLY8AxAeEy586rStrteLwqA OITpI+k7F7NAO9Gg/bck01qpPzrDdgup2M99rmYEja3i9SAVvekeqw7Pmt0lakP1ZkX6eG8Lh2p +nAmr5zQbAszsCj X-Received: by 2002:ad4:5dc5:0:b0:89c:d7e3:7f01 with SMTP id 6a1803df08f44-8b3eddea081mr56284876d6.48.1777466692493; Wed, 29 Apr 2026 05:44:52 -0700 (PDT) Received: from ziepe.ca (crbknf0213w-47-54-130-67.pppoe-dynamic.high-speed.nl.bellaliant.net. [47.54.130.67]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8b3ef6fb56esm17072716d6.7.2026.04.29.05.44.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 05:44:52 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wI4Hb-0000000HNPu-2ciA; Wed, 29 Apr 2026 09:44:51 -0300 Date: Wed, 29 Apr 2026 09:44:51 -0300 From: Jason Gunthorpe To: Ginger Cc: Tariq Toukan , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, ttoukan.linux@gmail.com Subject: Re: [bug report] Potential refcounting Message-ID: <20260429124451.GN849557@ziepe.ca> References: <345650f0-6da6-447c-9b27-0bbefca0558f@nvidia.com> Precedence: bulk X-Mailing-List: netdev@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: On Wed, Apr 29, 2026 at 06:13:40PM +0800, Ginger wrote: > Side note: to see if T1 (i.e., IRQ) can fire, I checked the calling > path to 'mlx4_cq_free' and only 'synchronize_irq()' is seen, but not > 'disable_irq()'. It means that T1 may still happen after T0 calls > 'mlx4_cq_free()'. synchronize_irq() is supposed to wait for any concurrently running IRQ threads to finish. New IRQ threads will then be guarenteed to see the radix_tree_delete() and can't see the CQ being removed here. Since the refcount is != 0 until after synchronize_irq(), and the irq can't see the cq after synchronize_irq() there should be no issue. Jason