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: staticpro everything Date: Wed, 01 May 2024 18:06:19 +0200 Message-ID: <87jzkdfres.fsf@gmail.com> References: <86jzkhu5rv.fsf@gnu.org> <87ttjlabic.fsf@gmail.com> <87v8408wsr.fsf@gmail.com> <87o79sasl5.fsf@gmail.com> <87plu72y8h.fsf@gmail.com> <877cgfwe5g.fsf_-_@gmail.com> <871q6mptkj.fsf@gmail.com> <86frv2pse5.fsf@gnu.org> <87v83ynhuc.fsf@gmail.com> <86v83xof5w.fsf@gnu.org> <878r0thbfl.fsf@gmail.com> <86jzkdo9rm.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10500"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 01 18:07:08 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 1s2CU7-0002Xn-KM for ged-emacs-devel@m.gmane-mx.org; Wed, 01 May 2024 18:07:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2CTX-00028l-Sv; Wed, 01 May 2024 12:06:31 -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 1s2CTQ-00027M-S2 for emacs-devel@gnu.org; Wed, 01 May 2024 12:06:29 -0400 Original-Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s2CTP-0004Tt-4g; Wed, 01 May 2024 12:06:24 -0400 Original-Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a58fbbcd77aso447370166b.2; Wed, 01 May 2024 09:06:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714579580; x=1715184380; 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=H5bxjSp5sTP2ynGPOf33r7Dk3BWgPjy4gpnERbSoFt4=; b=FBxj6e33MGPzZpMfqlE8nmvuXrmPT42s/604WepF5auy/O6yMtLjPA64CGtuUL/bZb SPWsfG/UOPhVx1vmPQC3ZMic6ZxWBjEs6GTUXIbL6jcJYBe+v0pgIlUEf85vPTEyBzgb 2ZNegLWavrgDJfnM72UGhyIQjyfF7OAiWO6NO7j5nNpixdi2ucOPCvy356RCpYAvZ62j VkQOzQDPajUDLb6phUXdHhNQ2/hZhwoqI/P8wWNYmGYblLu1O4/F4YQYHcg34Sg1GQ1V +7jukSCoiNffbrwz2Y6dTLdq3hXj9S09dmJd8MygdlrsxF4QbvErwef1lgifB7yngSTM yIGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714579580; x=1715184380; 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=H5bxjSp5sTP2ynGPOf33r7Dk3BWgPjy4gpnERbSoFt4=; b=OlQZ6GKsiQlMdqKn4f89+kNgInK0zeFthO9RuFJwgQV/qX+hUaTfHv7Ga5TPXH7g9O eDZYOTkynbOwwjNBXE2BPJPRcicSQ9+a5VhxX9kwwMCOHUv71WDFLSmF1lxSmnA8vlgQ 6tY2AES1mMeP/ZXPP3C4nT6iL5y6UvT3SZYxfeJDl21/RThPBWgFCyzBLZqOEsEggvtj HbLHOBp0p4s5ngdF8LvvrkpQcDNP/3qtNGegeYxwVFXsL7fhe6upEyxu+fKkoLCeycea r4FD67sU6NwIDJKY2pyqU6QKcI5AfRrsfN+kPAPyMKqfpbZqVqvulEtQWHFAhYH+dNTZ v06A== X-Forwarded-Encrypted: i=1; AJvYcCUl+DkNEuue3NAgoYpsJmLyryQrBJWIDHNCyN6hULBP5OlFpzmqwv5JDGTqVRFaaqO160YRarVkeZ2oMWhQ8QU49bCn X-Gm-Message-State: AOJu0Yw7yI87TzBQTzVkmfMvBp+a0x0MjtnJ1xNykA6aZq8dycGMf0qN R+/chHY2bnfYQ/BXnewiG8yygRcbrJEt3rBDpLCaW1BthyDuLGFboMfcrw== X-Google-Smtp-Source: AGHT+IEjxXnLQ/e+pi42HkCbYidku4XG7Vk9Gyq39JXSJ4Ycd3rA/3pihbsB30kW1ljbAQduZr3JIA== X-Received: by 2002:a17:906:ae8a:b0:a58:e8d6:a9d8 with SMTP id md10-20020a170906ae8a00b00a58e8d6a9d8mr1991644ejb.37.1714579580257; Wed, 01 May 2024 09:06:20 -0700 (PDT) Original-Received: from caladan (dial-184253.pool.broadband44.net. [212.46.184.253]) by smtp.gmail.com with ESMTPSA id f5-20020a170906138500b00a5531e61002sm16408794ejc.206.2024.05.01.09.06.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 09:06:19 -0700 (PDT) In-Reply-To: <86jzkdo9rm.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 01 May 2024 18:02:37 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=eller.helmut@gmail.com; helo=mail-ej1-x62f.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:318493 Archived-At: >> I don't know. I only looked at the global variables. Maybe there isn't >> one of type struct it. Or maybe I overlooked it. > > So the problem is that bidi_cache is global, and it holds bidi_it > objects, which have a pointer to 'struct window'? Exactly. Somebody could follow the path bidi_cache -> bidi_it -> window. And if window moves, we must update bidi_it. But bidi_it objects are normally not scanned, because they aren't allocated in an MPS pool (I think). So we need to do it some other way. E.g. by registering bidi_cache as root with mps_root_create and then our special scan code follows the path to bidi_cache -> bidi_it to update the reference to window. Another solution would be to always allocate bidi_it objects with igc_xzalloc_ambig. Then MPS is forced to keep window in place. But the bidi_it structure is rather large so this might be somewhat costly, because MPS must then scan all fields in bidi_it conservatively. >> > This goes back to my other questions about MPS GC: which pointers to >> > what objects should be audited for possible need of "doing something"? >> >> For all exact references to objects in MPS pools we need to do >> something. We need to update them when our scan method is called. >> If we want to store exact references in global variables or in >> objects that are not normally scanned than we must register them as >> roots. > > Sorry, I don't think I understand what is "exact reference". In MPS we classify references either as exact or ambiguous. For exact references we are certain that they point to an MPS managed object. For ambiguous references we aren't sure: it could be a reference to an object or it could just be an integer. When MPS scans the stack, it treats all bit patterns there as ambiguous references.