From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: MPS: Bytecode stack Date: Mon, 6 May 2024 14:12:46 +0200 Message-ID: <3174C6A6-28A6-492E-A268-E391A13FEA36@gmail.com> References: Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17545"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Helmut Eller , Emacs Devel To: =?utf-8?Q?Gerd_M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 06 14:13:53 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s3xE8-0004J5-Nu for ged-emacs-devel@m.gmane-mx.org; Mon, 06 May 2024 14:13:52 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3xDE-0003kL-6C; Mon, 06 May 2024 08:12:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3xDC-0003kA-6I for emacs-devel@gnu.org; Mon, 06 May 2024 08:12:54 -0400 Original-Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xD8-0006Ag-Nx; Mon, 06 May 2024 08:12:53 -0400 Original-Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-51ab4ee9df8so2228146e87.1; Mon, 06 May 2024 05:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714997568; x=1715602368; darn=gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=aFXag9I26wrvLZUvNoNCquQXBv/ngUhF/obbPIj/BVw=; b=fppCfqFxZszyvmXFjJzqeQ7LWMLmeU1oTrNVNVGs4C8mw9RPglkc7PHX2JXfblTnDK 9Bn25ne1wCjW8JiOBL5YYg3pPVWKAanjov+yn4yLNj2b9qEu0oz1H50GTGYG0vNBVEPt PmgGIM6Yheme+S7u5c1ADITosnGfxqZaBRlm/1P/HihORm36oTAXpC0ypw2JwJzZkK6/ ecHLCKy4y14OZmi32DYxPqMt+Ji9j2Xx5XQ2QYOt66q42L4BSBo2Upu5On2juOQvoPuQ xEj0MKMGTdQQEU7U6MnXY6j+7OI5mj4emHN2MwLp2L7z2TeVxNSz16NNdgxGI6nuAirO C0RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714997568; x=1715602368; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=aFXag9I26wrvLZUvNoNCquQXBv/ngUhF/obbPIj/BVw=; b=Wv7e8w8SufCTKlLrU8Ew9V4iagl7cDTGZjVahobIit6WkmXF2kHbopnhysorN3rhxI Bxtb3YCifBeJ/RZbMm3U5aAPXZr/GL0zFdnis9SZV34IbK76DyULXJVDlLM/JV1SAisD ViODDkuudJRJdvrUvijGpb/miPWxP89i107fV9VAyrYul7xUxBRDZbUjHK6QohbadZ+i zAEAwZunf1k9Fq0lk3ZzGo8Uw4S15R1LPJLgb8VpDxyIkLDm/bp1XvJ4+2E9BiWV28fN aesnBemd3ZBcHShFYPU+NPoPD5hSMk2JG0QKtrxxnk5dmMaepaLvGSVzhDQ5iNRtVLie RY7A== X-Forwarded-Encrypted: i=1; AJvYcCV1UM1Hq8KjI1F6ibl3O9ST7dcyUZMJXM4E2XSNSbRoYABsDjeW19MmHnXUeh68N+JevMVIRTYhA28Jw382JSjvvGqK X-Gm-Message-State: AOJu0YzYqGCszH3X5GlUNBqG9W6We7qb6F+JiB//4LBwO7tQHdhqHzAV pwwdk0nzaJlyS8l7Sg4h1CCzoh3cmwYyxRo9L9Jq4cZHpvxLvZsX X-Google-Smtp-Source: AGHT+IGYe8noi+ATwJ9DlkG9Rjw5d6SHCw5H88runmPhD3w3iJ8zUuwOYT0OqfRp0679z4BktB1MYg== X-Received: by 2002:a05:6512:20c7:b0:516:cc06:fa03 with SMTP id u7-20020a05651220c700b00516cc06fa03mr5925299lfr.56.1714997568194; Mon, 06 May 2024 05:12:48 -0700 (PDT) Original-Received: from smtpclient.apple (c80-217-1-132.bredband.tele2.se. [80.217.1.132]) by smtp.gmail.com with ESMTPSA id c6-20020a056512324600b0051b0f4e1b0dsm1648270lfr.276.2024.05.06.05.12.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 May 2024 05:12:47 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3654.120.0.1.15) Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=mattias.engdegard@gmail.com; helo=mail-lf1-x12a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:318886 Archived-At: 6 maj 2024 kl. 11.58 skrev Gerd M=C3=B6llmann = : > I think I fixed, or better said worked around, something important = today > in scan_bc which can lead to objects being "lost". Might be = interesting > to see if some errors magically disappear. I'm not sure what you are trying to fix. Dodging a data race? To see if I understood what your problem is, and how MPS works, consider = the thread state Lisp_Object *a; int top; where `a` is a heap-allocated array of some size, but only indices = [0..top] are actually used so the GC doesn't need to look at the rest. = The mutator thread does: 1 x =3D a[top]; 2 top =3D top - 1; What does the GC thread see? Even if it reads a (signal-atomic) snapshot = of the mutator's register and stack, does this atomicity extend to `top` = which isn't even a Lisp_Object? Is the mutator suspended during this = scan? Furthermore, the compiler is allowed to hoist the store in line 2 past = the load in line 1. If that's the only problem, it may just be a matter = of adding a compiler barrier (acquire).