From nobody Sat Aug 27 00:13:30 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 4MDxxl2k9Tz4bDTX for ; Sat, 27 Aug 2022 00:13:31 +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 4MDxxl1b66z44kb for ; Sat, 27 Aug 2022 00:13:31 +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 4MDxxl0dzKzZQT for ; Sat, 27 Aug 2022 00:13:31 +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 27R0DVte053616 for ; Sat, 27 Aug 2022 00:13:31 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 27R0DVvE053615 for bugs@FreeBSD.org; Sat, 27 Aug 2022 00:13:31 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: Sat, 27 Aug 2022 00:13:30 +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: markj@FreeBSD.org 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=1661559211; 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=IARXUAn7J26xtbil1f8xbfL/HOW0JP8tDKwXOWQtasQ=; b=vz5f4FoTsOnypqd5Yqcd9WG4yBC61qcZziUPKtbxnNlyhzlFlos7tkLQvGlVnDj2/a4QRN 48x0Tw9m4GlpxtK5KdYQkFxxgygGt0q/RlUih6zaxPhoH3aNK/7g3RtodAuensKoGQ4JYi zgAJnA5ez3Pe8geCwZ/ie0yCZKASvnvB+hunl8nM/osHaIMOcY9LaTpuby5lNHdwKvZOuT nxqgTQZaGq/xnLqCB/RJ6heSuyXVseZri+ZegkzmZO2BYrFKfi5XOaRw5cWDkGH57HUIqW XRjUFWjmBbnWjZEDtLr5la+htM4OmMuqq27765mgyzYlMSaur7mqkKlQ1zuiLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661559211; a=rsa-sha256; cv=none; b=IN+zrI9x29wA272NI2VAjLJNgxUcCFNsRs5yRJOpzaD6LPnYZJR8XjARt2ETnn6e9b2tP6 fEPKpg7bz3oASn5jQSTrg49VnujO3VYQ9rC3aMTEnZ/A7yfbW9ZORBc0SI6O4zP4va3IUv 0dkIDR2BMQrrEBDkzHl/4ZgRJzn3+bRFteMFzuLsyTqcdf9HJbWwmzgPY3zSI4e5cUIUld MmuSBdNc8b4TIeoCjRf9YKAsVCs9R1mn0buj2b9kaITXZ8p3v49yXQr+rqJyL8gDA8V1fQ j/LxO3UggMVhXmh2tZXLFfjkadOlujVkh9tSU6hXiASNoP2FACSdnt1daBZnJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D265974 --- Comment #8 from Mark Johnston --- (In reply to Pierre Habouzit from comment #6) I'm sorry, but I still don't quite see the problem. I spent some time tryi= ng to write litmus tests to explore interactions between readers, writers, and smr_poll(), but didn't find anything surprising (yet). For now I'm ignoring the deferred and lazy modes of SMR since they're not used in FreeBSD curren= tly. I note that your litmus tests don't seem to take into account the fact that smr_advance() issues a atomic_thread_fence_rel() before updating the write sequence. (On arm64 this expands to DMB SY, the same as atomic_thread_fence_seq_cst().) With smr_enter() patched, both readers and writers issue a full memory barrier on arm64. What I don't really understand is why readers need to synchronize with smr_poll() at all. Even with the barriers you proposed, it's possible for a reader to store a snapshot of wr_seq that is older than the global rd_seq.= =20 This could happen if an interrupt or vmexit occurs between the load of wr_s= eq and the store to per-CPU memory. So long as smr_poll() does not advance rd= _seq beyond that of any CPU actively executing a read section, it's ok, and I do= n't see how that can happen. What am I missing? Thanks for your patience and for taking the time to report these problems. = I posted a first patch for review here: https://reviews.freebsd.org/D36370 --=20 You are receiving this mail because: You are the assignee for the bug.=