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?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: MPS: profiler Date: Fri, 21 Jun 2024 14:41:59 +0200 Message-ID: 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> <87zfre1p3r.fsf@gmail.com> 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="6873"; 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: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 21 14:42:57 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 1sKdbV-0001cs-83 for ged-emacs-devel@m.gmane-mx.org; Fri, 21 Jun 2024 14:42:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKdag-0002E1-FQ; Fri, 21 Jun 2024 08:42:06 -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 1sKdaf-0002DD-EB for emacs-devel@gnu.org; Fri, 21 Jun 2024 08:42:05 -0400 Original-Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sKdad-0005QD-Ui; Fri, 21 Jun 2024 08:42:05 -0400 Original-Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a6e43dad8ecso334954466b.1; Fri, 21 Jun 2024 05:42:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718973721; x=1719578521; 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=+Vp3pbjhZPP9rUomB3NNswBwlBTP+bPlDJup+x40kQc=; b=bOYEQOPQPT9//GlgkCgJLrqYCguiOrV3RmoiaXRQarze1ABCxQTdhHOWPMR5GtzAoA chiJgSgwDcJVZLWVOsqYlYw6/36hlfKs+b9n+LbPNaAyF1d3JC9AducPWcYmdfbCdeli vcjN2jfoFQCTqHysKJZE24KcPmJvniXvnxJoIZVoh3gTQQ3M79OXVGYYiMhDOmRe4tPG xIYoI/nCPAHF6QsbyUZ1GeQ2lNgB574/oUlSCy4WtNHJjrPkTXSiOpQlxoLy5CneIbwY Ep5a6ssTeFnDQEWA17IfxyKRl7AHZhKrrvUypRvv5luFXQU/yjKC44oM0kzqtyuy1QZY GEoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718973721; x=1719578521; 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=+Vp3pbjhZPP9rUomB3NNswBwlBTP+bPlDJup+x40kQc=; b=cXxKOB8QIwODDDXCX7XW7rvdtxYfV0HdAWIM67yKRisEuD6pN5PvJ4Ggi9LGrI3SM8 /vDAvDw8LXp22oTnqA92KqpNnAwheSERFrncVUzxiYoMNa2UpCBEbDCFsxgNctny8r3L vb4F7of7ZyjQuCrRUTfT3QZgChvZV+wa5Gm9j0nEj8HkZh0dDF7IPXgch3hem/D2ZZdE iDXEnUPzGi5HcFWSJbuUIindkrdrD+M3oxmvCipKfJrWMe2ClI8B8bZxrIX8I159UQRe wpkpoqLJHvmRpJudvNA1k+qYbLM1AwYT1icO1ZU6jp8eWL4z6NU3GxyYOPxtM1TeYIJB PrJw== X-Forwarded-Encrypted: i=1; AJvYcCXKq7ZzyX8MjWK0mxBtL1aNVZ03lAME73VPkyKdArSo101nlSuPExQKLtEbzdLTH5X4ARCUmlLh08mZT/kvmq0zCbrb X-Gm-Message-State: AOJu0YxroAZLKeLQE58YGAq1iJeqWeng8YFCFmI7dWQvvsI8RClP1yUv oY+UoBSm+bubDdSYCf0Pvwsnpz1RtYerHINsA4T0W9Ci4tZLSeCpiBH/qg== X-Google-Smtp-Source: AGHT+IE1/Ge42bY6SC2dwUxmGjkCpieJCFKFP0AeSeaL1VEZh765bjQBYsMJneMN0bzY9LOmBcOGaw== X-Received: by 2002:a17:907:a645:b0:a62:49ae:cd7b with SMTP id a640c23a62f3a-a6fa438df9fmr574322766b.24.1718973720507; Fri, 21 Jun 2024 05:42:00 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a72a.dip0.t-ipconnect.de. [79.227.167.42]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fcf56c48fsm79423366b.192.2024.06.21.05.41.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 05:42:00 -0700 (PDT) In-Reply-To: <87zfre1p3r.fsf@gmail.com> (Helmut Eller's message of "Fri, 21 Jun 2024 14:01:44 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=gerd.moellmann@gmail.com; helo=mail-ej1-x62d.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:320398 Archived-At: Helmut Eller writes: > 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. That would be SIGPROF delivered while client has not hit a barrier before. SIGPROF handler runs and may hit a barrier or not. If it doesn't hit a barrier, that's a good case, I think. If the SIGPROF handler does hit a barrier, MPS handles the SIGSEGV resulting from it, presumably, and let's say it takes some time. If no SIGPROF arrives during that time, we are in case 2 (SIGSEGV before SIFPROF). If a SIGPROF arrives kind of also. > 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? Hmmmmmmm, I guess it wouldn't hurt to try, so I've pushed your patch :-)