From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: MPS prstack Date: Mon, 27 May 2024 17:08:24 +0200 Message-ID: <878qzvl2c7.fsf@gmail.com> References: <87o790qsgm.fsf@gmail.com> <874jap95hi.fsf@gmail.com> <874janpa4m.fsf@gmail.com> <87le3vogt8.fsf@gmail.com> <87a5kbobt4.fsf@gmail.com> <86sey3v5p8.fsf@gnu.org> <87ed9nmnsm.fsf@gmail.com> <86ed9nv1nw.fsf@gnu.org> <87zfsbl4s9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24871"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , gerd.moellmann@gmail.com, emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 27 17:09:12 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 1sBbyJ-00065s-Da for ged-emacs-devel@m.gmane-mx.org; Mon, 27 May 2024 17:09:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBbxh-00067g-Pr; Mon, 27 May 2024 11:08:33 -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 1sBbxf-00061y-Us for emacs-devel@gnu.org; Mon, 27 May 2024 11:08:31 -0400 Original-Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sBbxc-0006s6-Gx; Mon, 27 May 2024 11:08:29 -0400 Original-Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-351d309bbcfso3870417f8f.3; Mon, 27 May 2024 08:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716822505; x=1717427305; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=kyq/lfSf7ZCXK8+FHchGRQbbIg9Fpv9BQ5Alu8j1t+k=; b=CWrPmL+nY9zd6xHHSCxi2BTHDdvMieEpvfJ9yX0DhU51c7ktiYgVO0aytMi/2no6PZ tmBGO8in0KUawo0COQmaIRyLyQMB6W4w5rEVqqtLSu4gDw5AHMfpyJ5AtGMZxORFHHsN LIAKLMidiO5DHwinon2mjtUxdJ4c11SvD299rQfgyKQ3RYzWPn/PRBgAxlDMVw1URBvD 6yY3lmnOJKAvPqj0FjhDxBpbgD2b0NJsT72fPXnV7ACELdScUqqHRikHAfJ+S9zcVLB9 7uS4LSk1Y8aijTNwBEpQAoeV2QFHBOFAEAVtpldKm1xratsICLbqIDcPQTdbkGR+l5kQ Ab4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716822505; x=1717427305; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=kyq/lfSf7ZCXK8+FHchGRQbbIg9Fpv9BQ5Alu8j1t+k=; b=K50c2il2JEzyWvcWXHpjDJfB4rkYEebfXZ1yqmkbri02QxDx2Phl1HzRrq/xsL2pGH KEeVUJwpHv6bNWfafMJNlzlcOpdcGRlP7pnCfKwq8lccpTLZGmcDqPD2xuMy+GGPw3aF Nn5P3l/ARGCRSZOsVOQnFljPQSPlvAmi4F1pmoq4sBb9Qji2AvKEFa7s7oua7RDz/vtz +Vi4SLXtl7mOMecNH7GDh1J3bCwLqM7qVONqotX+ivRDnFcFySrzFfz3csrfdBH0huFs 7v+d4Jw/IBfGU6n31Cv/QBE8hHzgwVVsb978lVio5DsgLm2r7I+WsOlzsWqV/cx4Zz4o EJqQ== X-Forwarded-Encrypted: i=1; AJvYcCXt93r29avzanoXQFTQ1ozTEGEnBCXKwPzsmZLaRqvnPDqgNokJVqHF+YVT56lufZWKiwuFD0JFzUyumHhprdYa+MuL X-Gm-Message-State: AOJu0YweNWH/wJZ9kV0r7/+v2KenMk9iM8u5ZYrPRY6AZSN3QUVBUnMZ KWtt/x0bBKN4PJxAMTrsgI6hdFLzLkb1miS3b8QELjEFZ6Y/zOHt7SNTZQ== X-Google-Smtp-Source: AGHT+IEfgogItglDdFwTrR9JuEtDwg8+l0kEjjaIpy7df/XNr24A4uiiQ2GzKF9ssO77o5QYyfkOug== X-Received: by 2002:a05:6000:d88:b0:354:f34c:646f with SMTP id ffacd0b85a97d-3552fe020afmr6414841f8f.58.1716822505319; Mon, 27 May 2024 08:08:25 -0700 (PDT) Original-Received: from caladan (dial-188233.pool.broadband44.net. [212.46.188.233]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3557a08aba8sm9226739f8f.42.2024.05.27.08.08.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 08:08:25 -0700 (PDT) In-Reply-To: (Po Lu's message of "Mon, 27 May 2024 22:43:34 +0800") Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=eller.helmut@gmail.com; helo=mail-wr1-x429.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, T_SCC_BODY_TEXT_LINE=-0.01 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:319614 Archived-At: On Mon, May 27 2024, Po Lu wrote: > Helmut Eller writes: > >> Yes. I think >> >> prstack.stack[prstack.sp] = e; >> __atomic_store_n (&prstack.sp, prstack.sp + 1, __ATOMIC_SEQ_CST); >> >> is quite sufficient. > > How so? This doesn't guarantee that MPS cannot pause the thread after E > is saved into prstack but before prstack.sp is incremented, Right. But we are sure that prstack.sp is not incremented before E is saved. And scan_prstack doesn't care what is beyond prstack.sp. > or that E > will remain on the control stack or in the register file until it is. Yes. But that's another issue. That could be solved by making print_stack_push a non-inline function that takes a reference to E as argument.