From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 DBEA2401A25 for ; Wed, 3 Jun 2026 20:28:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780518489; cv=none; b=iIbvRu91IVeG2zIcalZiCV5jQzfVbm8JCwWJL44Vs8Mg+XLeJKxLFLjlw3r27Pxu++TMbozZpvNXFcRwawBk+jIQdq6+KO0hYjm1DO7rHexz7lD657+1hOqfdxryp2BP+ULRnZjWwUYoz4Lhwp/WXYyTY9G/uguIwN+OTKiWhj4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780518489; c=relaxed/simple; bh=VbrujYzk/Kt70jnqfCTt3NCF2m9icQA5HNmlxNrUsQ4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=SgKHL2tu1w7AUiFE+dT5rgckflIjZXHYq4OVoB0yDvRCAk90xbhLgqzcVKiIQZ38vUn4GvrHuXrAaMpG6NNC9qiPo3y4addZFm2envvmkO8pYS35aKLcHNov0tDxZWgG9pFqgQtgfvslyfHA5kPzJ3DVpjaLqaz/JxUkjAckNTU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CHOEZZzK; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CHOEZZzK" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-490a76757e5so32300705e9.2 for ; Wed, 03 Jun 2026 13:28:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780518486; x=1781123286; darn=vger.kernel.org; h=content-transfer-encoding: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; bh=z+DWIlNIG3f/eL+eaLnXdVcfcuXoaF88jz/IhoI85/U=; b=CHOEZZzKh/kIWSO8ag6/NEHYEZAsMLWLzNjK+aQHlKNiG7ts0jAMGjwcbiJspYkZ+H m/iCCOQE89kptvQXUe+EFvY/EICBc54nEkcIEcJ5FOB0uHDYi+tTJiycxj+mMMfzKlfd mpDi1Zfjmg1SJrGI+cd43T4Px6RW+K7KuYQkd1jCfF2q2yPL5+ORdB+TURQ60J+HCy4F e2EXup9KDtEz4AjCy+nqPFQL2EZtA5zHIPuGjK16UVEuLs4xSLeZg4KTwpkJI2RlLSko yU53aT6xw02o8zPg2v36lS4ZoCpUSEf6cMbdnhJC2Y4GtMTDpCwiiNYROBdYRE33paID WSmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780518486; x=1781123286; h=content-transfer-encoding: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; bh=z+DWIlNIG3f/eL+eaLnXdVcfcuXoaF88jz/IhoI85/U=; b=nYp1vwKtro6GX281cip2fDLFEbZ4hWaHG7oyEPYiwwN6FDzR7xYM5K38zbCkTisaHx HxkB2oZVm5gsjkvLyNo37hpN+AQL6ps77vnjxbNs/KJN27rjVMVUCvw2VAaLJcZiZpHu Ecjm5e2joBNgmxgN88BxTYPnN5+wN2hW8ZNhL2l0hqIPDNikn4yvtTICoDyOsYWaUOzB ZDdpWpcuZyUgC7ZMM+zJ2O3LMUhbfQb+Lt8hl4CikmIAyFJ/SDcp4vbtncyPJdH/mabX mwV2Rd7wXgZV8RvpK/gpfUZ4+U4Z+3Y45VMpmd3bXykScO1E+EAABm+4xtnhC+XoQh83 whoQ== X-Forwarded-Encrypted: i=1; AFNElJ8dBWAAajQHHw3vt5XRhUzadkPayBtSv8X8zBHe8OIyFQv56zrDOTg+HFO7QB9qfGi7bjvSikG0HZu7lRk=@vger.kernel.org X-Gm-Message-State: AOJu0YyGOTZsuE0W0FQoTb6rdmR905uWNhhbt3B8iag/Eped0R0cUqax I/8FqEHVSeyG4uzK8ggzBnkXrJxsfKK8iDPgrZAkZaapD791ULGSHmI4NroRiw== X-Gm-Gg: Acq92OHQ3zoMeM3o1SMLtvvAq6b6Qj/QBLEGI3QdWHch4xb/bo6Dv8L70k6RQ7/uqcJ DupkflooYHdahKE6r64dDnmTn3NTSkF18LzmYRe5EIWHOnxYLCa5IfNN+JmdQAbiXLOllR0ibjY 8tJ0VT+BzW0XbaeWnt5XDH13lGN2dYVlolM86L9IYS9Fcot9cESHBZebPwYTRliOSHI6yITafv0 p60ybUEeebv/vRoLXX+P+y6zWTu8Yqp9c5nF9UkFS66ZjLnmJg76iR9q55nhPveoXabGUee4idW e0DReULs6NV9NXR1zBt8Pl4JPH2R9IuQgHMJEIMtOzCJGJmroi/PmExTSKGN5Oamfn92GdlrhtN sJ16LPhHgTV2DUiR+FLZZfV7dTN5drElhlVc8kCryhSIwMGb5ohK5bSkMpXDbzzG0LgPlbCOSVD wIMm8uHeg4zZcipzNeG399JzOh5WeXkGE4rvGXgJSTvvNXry42akGS68MMLeD98j3g0Np0bsQfy TwLFPYfxmUmcvxKl/dT4luh X-Received: by 2002:a05:600c:19cd:b0:490:50eb:b777 with SMTP id 5b1f17b1804b1-490b5e9fc71mr84945695e9.5.1780518486086; Wed, 03 Jun 2026 13:28:06 -0700 (PDT) Received: from [192.168.1.122] (cpc159313-cmbg20-2-0-cust161.5-4.cable.virginm.net. [82.0.78.162]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490bc3a8632sm27996995e9.8.2026.06.03.13.28.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Jun 2026 13:28:04 -0700 (PDT) Message-ID: <74e6932f-a755-4931-8d4d-0025826a5502@gmail.com> Date: Wed, 3 Jun 2026 21:28:02 +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] sfc: Use acquire/release for irq_soft_enabled To: Jakub Kicinski , Gui-Dong Han Cc: netdev@vger.kernel.org, linux-net-drivers@amd.com, linux-kernel@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, baijiaju1990@gmail.com References: <20260528092838.2099352-1-hanguidong02@gmail.com> <20260603112035.0866d7d4@kernel.org> Content-Language: en-GB From: Edward Cree In-Reply-To: <20260603112035.0866d7d4@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 03/06/2026 19:20, Jakub Kicinski wrote: > On Thu, 28 May 2026 17:28:38 +0800 Gui-Dong Han wrote: >> Use release stores when updating the gate and acquire loads in interrupt >> handlers before touching channels. Keep the existing smp_wmb() after gate >> updates, preserving the current ordering with event queue start and stop. > > Why are you keeping the smp_wmb() tho? You don't have to repeat what > the patch does. The goal of the commit message is to explain the why. > > Ed, WDYT? I think... that my head hurts from trying to understand this. What I particularly don't understand is why it wouldn't suffice to just put smp_rmb() after every read of irq_soft_enabled, pairing with the existing smp_wmb(). And, conversely, why any of this works at all — what stops an interrupt handler passing the gate, because the write to irq_soft_enabled has propagated to its CPU, but the writes to channel pointers haven't? Naïvely I'd expect the smp_wmb() in efx_soft_enable_interrupts() to come _before_ the write to irq_soft_enabled. (The smp_wmb() in efx_soft_disable_interrupts(), I'm not sure exactly what that pairs with, since the ordering that matters there is between the irq_soft_enabled=false write and the synchronize_irq().) Anyway, this code predates my involvement with sfc and I've never had to touch it, so frankly I don't know any more here than anyone else, and if a memory-models expert reviews it and says 'this is needed and correct', that would mean more than a review tag from me. That's not a cop-out "I won't review this", rather I'm saying that if Gui-Dong can't convince me because I'm too dumb, but can convince you, then you don't need to wait for me to show up and add my tag. -ed