[go] runtime: reusable intrusive doubly-linked list

7 views
Skip to first unread message

Michael Pratt (Gerrit)

unread,
Oct 22, 2025, 5:56:27 PMOct 22
to Michael Pratt, goph...@pubsubhelper.golang.org, Michael Knyszek, golang-co...@googlegroups.com
Attention needed from Michael Knyszek

Michael Pratt voted and added 1 comment

Votes added by Michael Pratt

Commit-Queue+1

1 comment

File src/runtime/list_nih.go
Line 22, Patchset 1: _ sys.NotInHeap
Michael Knyszek . resolved

does the lsitHead need to be NotInHeap? it would be nice to be able to put this on the stack (to carry lists around).

Michael Pratt

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Michael Knyszek
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I6a6a636c62d83fa93b991033c7108d3b934412ac
Gerrit-Change-Number: 714020
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Pratt <mpr...@google.com>
Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
Gerrit-Attention: Michael Knyszek <mkny...@google.com>
Gerrit-Comment-Date: Wed, 22 Oct 2025 21:56:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Michael Knyszek <mkny...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Michael Pratt (Gerrit)

unread,
Oct 24, 2025, 5:16:54 PMOct 24
to Michael Pratt, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Michael Knyszek

Michael Pratt uploaded new patchset

Michael Pratt uploaded patch set #3 to this change.
Following approvals got outdated and were removed:
  • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit

Related details

Attention is currently required from:
  • Michael Knyszek
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I6a6a636c62d83fa93b991033c7108d3b934412ac
Gerrit-Change-Number: 714020
Gerrit-PatchSet: 3
Gerrit-Owner: Michael Pratt <mpr...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Michael Pratt (Gerrit)

unread,
Oct 30, 2025, 2:17:32 PM (14 days ago) Oct 30
to Michael Pratt, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Michael Knyszek

Michael Pratt uploaded new patchset

Michael Pratt uploaded patch set #4 to this change.
Open in Gerrit

Related details

Attention is currently required from:
  • Michael Knyszek
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I6a6a636c62d83fa93b991033c7108d3b934412ac
Gerrit-Change-Number: 714020
Gerrit-PatchSet: 4
unsatisfied_requirement
satisfied_requirement
open
diffy

Michael Pratt (Gerrit)

unread,
Oct 30, 2025, 2:21:12 PM (14 days ago) Oct 30
to Michael Pratt, goph...@pubsubhelper.golang.org, Go LUCI, Michael Knyszek, golang-co...@googlegroups.com
Attention needed from Michael Knyszek

Michael Pratt voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Michael Knyszek
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I6a6a636c62d83fa93b991033c7108d3b934412ac
Gerrit-Change-Number: 714020
Gerrit-PatchSet: 4
Gerrit-Owner: Michael Pratt <mpr...@google.com>
Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
Gerrit-Attention: Michael Knyszek <mkny...@google.com>
Gerrit-Comment-Date: Thu, 30 Oct 2025 18:21:08 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Michael Knyszek (Gerrit)

unread,
Oct 30, 2025, 3:48:06 PM (14 days ago) Oct 30
to Michael Pratt, goph...@pubsubhelper.golang.org, Go LUCI, golang-co...@googlegroups.com
Attention needed from Michael Pratt

Michael Knyszek voted and added 2 comments

Votes added by Michael Knyszek

Code-Review+2

2 comments

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Michael Knyszek . resolved

looks great! one comment about safety, but we can improve that in a follow-up.

File src/runtime/list.go
Line 19, Patchset 4 (Latest): nodeOffset uintptr
Michael Knyszek . unresolved

maybe we should add a bool or something indicating that we've initialized it, so if we forget to do so it crashes instead of assuming the intrusive node is at offset 0.

the overhead (and repeated checking) for that is a little bit annoying... perhaps there's another way to make the zero value invalid? like perhaps we expect obj to point to some global sentinel?

Open in Gerrit

Related details

Attention is currently required from:
  • Michael Pratt
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I6a6a636c62d83fa93b991033c7108d3b934412ac
Gerrit-Change-Number: 714020
Gerrit-PatchSet: 4
Gerrit-Owner: Michael Pratt <mpr...@google.com>
Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
Gerrit-Attention: Michael Pratt <mpr...@google.com>
Gerrit-Comment-Date: Thu, 30 Oct 2025 19:48:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Michael Pratt (Gerrit)

unread,
Nov 11, 2025, 3:32:38 PM (2 days ago) Nov 11
to Michael Pratt, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Michael Pratt

Michael Pratt uploaded new patchset

Michael Pratt uploaded patch set #10 to this change.
Open in Gerrit

Related details

Attention is currently required from:
  • Michael Pratt
Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: newpatchset
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I6a6a636c62d83fa93b991033c7108d3b934412ac
    Gerrit-Change-Number: 714020
    Gerrit-PatchSet: 10
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michael Pratt (Gerrit)

    unread,
    Nov 11, 2025, 3:33:07 PM (2 days ago) Nov 11
    to Michael Pratt, goph...@pubsubhelper.golang.org, Go LUCI, golang-co...@googlegroups.com

    Michael Pratt voted and added 1 comment

    Votes added by Michael Pratt

    Commit-Queue+1

    1 comment

    File src/runtime/list.go
    Line 19, Patchset 4: nodeOffset uintptr
    Michael Knyszek . resolved

    maybe we should add a bool or something indicating that we've initialized it, so if we forget to do so it crashes instead of assuming the intrusive node is at offset 0.

    the overhead (and repeated checking) for that is a little bit annoying... perhaps there's another way to make the zero value invalid? like perhaps we expect obj to point to some global sentinel?

    Michael Pratt

    Done

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I6a6a636c62d83fa93b991033c7108d3b934412ac
    Gerrit-Change-Number: 714020
    Gerrit-PatchSet: 10
    Gerrit-Owner: Michael Pratt <mpr...@google.com>
    Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
    Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
    Gerrit-Comment-Date: Tue, 11 Nov 2025 20:33:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Michael Knyszek <mkny...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michael Pratt (Gerrit)

    unread,
    Nov 11, 2025, 4:04:35 PM (2 days ago) Nov 11
    to Michael Pratt, goph...@pubsubhelper.golang.org, Go LUCI, golang-co...@googlegroups.com

    Michael Pratt voted

    Auto-Submit+1
    Commit-Queue+1
    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
      • requirement satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      • requirement satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I6a6a636c62d83fa93b991033c7108d3b934412ac
      Gerrit-Change-Number: 714020
      Gerrit-PatchSet: 11
      Gerrit-Owner: Michael Pratt <mpr...@google.com>
      Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
      Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
      Gerrit-Comment-Date: Tue, 11 Nov 2025 21:04:32 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Gopher Robot (Gerrit)

      unread,
      Nov 11, 2025, 4:08:51 PM (2 days ago) Nov 11
      to Michael Pratt, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Go LUCI, Michael Knyszek, golang-co...@googlegroups.com

      Gopher Robot submitted the change with unreviewed changes

      Unreviewed changes

      4 is the latest approved patch-set.
      The change was submitted with unreviewed changes in the following files:

      ```
      The name of the file: src/runtime/list.go
      Insertions: 7, Deletions: 1.

      The diff is too large to show. Please review the diff.
      ```
      ```
      The name of the file: src/runtime/list_manual.go
      Insertions: 7, Deletions: 1.

      The diff is too large to show. Please review the diff.
      ```

      Change information

      Commit message:
      runtime: reusable intrusive doubly-linked list

      Unfortunately we have two nearly identical types. One for standard types
      and one for sys.NotInHeap types or cases that must avoid write barriers.
      The latter must use uintptr fields, as assignment to unsafe.Pointer
      fields generates a write barrier.
      Change-Id: I6a6a636c62d83fa93b991033c7108d3b934412ac
      Reviewed-by: Michael Knyszek <mkny...@google.com>
      Commit-Queue: Michael Pratt <mpr...@google.com>
      Auto-Submit: Michael Pratt <mpr...@google.com>
      Files:
      • M src/runtime/export_test.go
      • A src/runtime/list.go
      • A src/runtime/list_manual.go
      • A src/runtime/list_manual_test.go
      • A src/runtime/list_test.go
      Change size: L
      Delta: 5 files changed, 949 insertions(+), 0 deletions(-)
      Branch: refs/heads/master
      Submit Requirements:
      • requirement satisfiedCode-Review: +2 by Michael Knyszek
      • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
      Open in Gerrit
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: merged
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I6a6a636c62d83fa93b991033c7108d3b934412ac
      Gerrit-Change-Number: 714020
      Gerrit-PatchSet: 12
      Gerrit-Owner: Michael Pratt <mpr...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages