From nobody Fri Aug 26 21:40:19 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MDtY06fQCz4b0NQ for ; Fri, 26 Aug 2022 21:40:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MDtY05cHNz3sst for ; Fri, 26 Aug 2022 21:40:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MDtY04gLDzXVv for ; Fri, 26 Aug 2022 21:40:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 27QLeKCq070368 for ; Fri, 26 Aug 2022 21:40:20 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 27QLeKTm070367 for bugs@FreeBSD.org; Fri, 26 Aug 2022 21:40:20 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 265974] SMR has several missing barriers Date: Fri, 26 Aug 2022 21:40:19 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: pierre@habouzit.net X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661550020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MGLq/+/UZqpQoq+Yj0dXxy1EVpBU+qf0mOox/lUXB4A=; b=jRhlBde+28WUwI57FUxAlxonIp9BTYSHwWbRCHSViko3zylNeyv3Mqm8hAEqjlCXc6FnYV lD4xERMH/mTVTHkWYE7C7akd4FGapz9EjRZwXt3L9GWNSdAqiIDlSy+zKg7tEm70S3VUiB lipaU3R8gaRCKK6sS+haew4tBzFerVDbQqA3b/9HS0f2lWRKHD824mgK9MhRfLiVfaLORi Q/aSru46+HXTzJUB+rcfAxPAEy/KJwTY3kJh4eNFf2x1dRf6iElY+k2GoayilLzRaslkD/ 09JjFtEAwodhinqim5/0FC+VmXthpc9j0RLzb00WSCltObkTxVhSK+OEVST3Mg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661550020; a=rsa-sha256; cv=none; b=Aobhu7+S8hk2o/o88xhMYRrK8v8Kv33fDQkT3stadjYI+yLhBvcBMhATd+kLdxgeJ5e40q bN84UU+9E4K+P9VK0Moi38X1olCKn5Y8JpYQrG3kR/N2WC18Zjks1UiHR8Vk5+SnFCOdaQ 7eA5Frfv3IBBd9pEyTVTLK/SNjCtjmxq9fOEh/hL25gpB+khVuAZ9ml6/PLB2yYNJPe1aH SrY6ldj8ZDAtmAzihLhrCCiZ4KzbBH5qbMGpq3pWV5u1/7I20qT1txDSI14hb97LLIu1Rd J7D4tLCnWYWoNI9UwW/YMIeKZJQt4xda7MSvBKVbOInLsl6z5dJnkGNzJY86YQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D265974 --- Comment #6 from Pierre Habouzit --- (In reply to Mark Johnston from comment #4) > The suggested patch adds two barriers to smr_poll_scan() and none to smr_= poll(), is that intentional? Yes, I cover this in my (2) paragraph: > 2. similarly smr_poll_scan() needs a full barrier after the scan _before_= it updates the global rd_seq, this is about serializing the fast path of s= mr_poll with CPUs that weren't in a critical section (while the one on entr= y of smr_poll() is about synchronizing with the CPUs inside an active SMR c= ritical section and was demonstrated in (1)). fundamentally the first barrier is about sequencing the "scan" operation wi= th CPUs actively inside an active SMR section (and basically pairs with their smr_enter()), but the second barrier is about all the sections we ignored because they weren't active and pairs with the last `smr_leave()` that that core executed. Writing the litmus test to exhibit this problem was more work than I was willing to put in. For full disclosure I am the author of XNU's smr.[hc] an= d am reporting this bug as a courtesy given that FreeBSD was the inspiration. In= XNU I'm definitely going to put both barriers (the current open source drop doe= sn't have it but as I was reasoning through this code recently I convinced myself they were needed). --=20 You are receiving this mail because: You are the assignee for the bug.=