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: profiler Date: Fri, 21 Jun 2024 14:01:44 +0200 Message-ID: <87zfre1p3r.fsf@gmail.com> References: <87v823xvq1.fsf@localhost> <86cyobmmhc.fsf@gnu.org> <87r0crxung.fsf@localhost> <87le2zxsqx.fsf@localhost> <8634p6n7jd.fsf@gnu.org> <87tthm3gq2.fsf@gmail.com> <87sex6ags5.fsf@localhost> <87msne3flr.fsf@gmail.com> <87frt63dvt.fsf@gmail.com> <86o77ulgk8.fsf@gnu.org> Mime-Version: 1.0 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="9913"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , yantar92@posteo.net, emacs-devel@gnu.org To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 21 14:03:13 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 1sKcz2-0002TA-QV for ged-emacs-devel@m.gmane-mx.org; Fri, 21 Jun 2024 14:03:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKcxo-0002BE-Ur; Fri, 21 Jun 2024 08:01:57 -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 1sKcxi-0001tw-4j for emacs-devel@gnu.org; Fri, 21 Jun 2024 08:01:50 -0400 Original-Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sKcxg-00047Z-Fc; Fri, 21 Jun 2024 08:01:49 -0400 Original-Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2ec408c6d94so23103781fa.3; Fri, 21 Jun 2024 05:01:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718971306; x=1719576106; darn=gnu.org; h=content-transfer-encoding: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=JmhsX5kJfJQCXyI3V0/NiWgkKxZeZ3SkWqmbVq4z6s8=; b=Bp6XgQCrXTYxhj/DIOy+dUCg6u5jMxPSsAZsycP2IVXemJxVoE72aldSws7xmbrZHr l8hmysynKJIkXmjHSj88ZDpgSLEn+P06yey7YB0/iw4hYfzSG4fnhPj0rozcg7kotctd T7CMmO7/tyVGR7QnwMvFKdLZhoEtGiC/PPql4Hmrt3xasmp3ObD3dzgpyBRHNoUWfb6L 1dWOEvZhVOW3uAqe5TzBDfBVtkQycTbUCDJKxU52rs80tlIsMUMKMQzebo7KTP7qmaOx 6GjsWtbh/b8WtbQTF/BPsStPtg5dcNPQurjrAAfNx9G6+D5niveUcfbKQExO/ltpUlsI BXVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718971306; x=1719576106; h=content-transfer-encoding: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=JmhsX5kJfJQCXyI3V0/NiWgkKxZeZ3SkWqmbVq4z6s8=; b=CekZ9vzzguvBlWDBE9Rv8GSayKHPLcjpTAELbYnPc8Eh/WKG7JMVxwLLjhihIgQPws 5+7ZJJ7mjKUC7/4aBKEvAbNeUAp+BVAqu8ZfVChFegKcHFLW/Xmf2fzs+G7b2PGpjkoJ bDmqk5kJsEZOtqVf0jmRaJXvTjOGZlcuE2Bq3828fkEdiHdVVQ/f0dqaxaLsqDulNC4h GF+KJXNG8JudvyIieF0FgMhTZIL2mcEe+0iUdeANDlrszUx1sH2icaRWCppWXWi9wjOb iBpRJCw/hri17U4Htfekp0U0wv2LCFRfxnj1q6Q7oi/2tqvQs1z0c6iWETT61QglZ8FP hJFQ== X-Forwarded-Encrypted: i=1; AJvYcCXW+BOqwAi+CStWe4bP9xRZWdfhlz8VeeiPXDJnOPJd2Ug6EDXth+B3VBsKYFd8xjspTvFx0/W/Nq5U34abeKF2TtNM X-Gm-Message-State: AOJu0YwxrFETvIa3Djs49TptSdx3mzOlkeUx4FbDeLg0GQebEBjwxsbl mt+s8EPXRCrN82CKUjXylRLbYK4AwKcwtJZ/isEB/9c/ApGyjGhq3tx7kg== X-Google-Smtp-Source: AGHT+IGy7yspn+o3jJuxuPMR4NE91UeHnJVtVmWKlZbcQzulRNkAt5Awtk5foxaCwbwtpaq8Fk0bHg== X-Received: by 2002:a2e:3815:0:b0:2ec:165a:2252 with SMTP id 38308e7fff4ca-2ec3cfe9d58mr51826871fa.40.1718971305670; Fri, 21 Jun 2024 05:01:45 -0700 (PDT) Original-Received: from caladan ([31.177.116.19]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57d3040f636sm850523a12.22.2024.06.21.05.01.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 05:01:45 -0700 (PDT) In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Fri, 21 Jun 2024 13:47:12 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::229; envelope-from=eller.helmut@gmail.com; helo=mail-lj1-x229.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:320396 Archived-At: On Fri, Jun 21 2024, Gerd M=C3=B6llmann wrote: > I'm still not sure. What I'm trying to say is that we need to be sure > that there are no windows left in which things can change. I'd be most > comfortable ATM if the first thing the SIGPROF handler does is check > is_busy and immediately returns, doing nothing. Let's assume for moment that SIGPROF and SIGSEGV are handled in the same thread. Then either SIGPROF comes before SIGSEGV or after. Case 1 (SEGPROF before SIGSEGV): here mps_arena_busy will return false and will access the MPS-managed memory. This is fine, because to MPS this is no different than any other client code. Case 2 (SEGSEGV before SIGPROF): here mps_arena_busy will return true and we only increase a counter. This is also fine. Convinced this is safe and that we that have covered all cases? Now for the harder situation where SIGPROF and SIGSEGV aren't handled in the same thread. Well, I would say that this doesn't happen in Emacs. But maybe somebody can come up with example where it does.