From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10683 invoked by alias); 6 Sep 2010 16:12:21 -0000 Received: (qmail 10670 invoked by uid 22791); 6 Sep 2010 16:12:18 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Sep 2010 16:12:13 +0000 Received: from wpaz17.hot.corp.google.com (wpaz17.hot.corp.google.com [172.24.198.81]) by smtp-out.google.com with ESMTP id o86GCB56003488 for ; Mon, 6 Sep 2010 09:12:11 -0700 Received: from yxd5 (yxd5.prod.google.com [10.190.1.197]) by wpaz17.hot.corp.google.com with ESMTP id o86GCA8f026536 for ; Mon, 6 Sep 2010 09:12:10 -0700 Received: by yxd5 with SMTP id 5so1646221yxd.9 for ; Mon, 06 Sep 2010 09:12:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.171.20 with SMTP id y20mr1106239ano.150.1283789529927; Mon, 06 Sep 2010 09:12:09 -0700 (PDT) Received: by 10.220.178.139 with HTTP; Mon, 6 Sep 2010 09:12:09 -0700 (PDT) In-Reply-To: <20100906094821.GA20484@host1.dyn.jankratochvil.net> References: <20100823185008.GA2926@host1.dyn.jankratochvil.net> <20100902160216.GA10848@host1.dyn.jankratochvil.net> <20100903153955.GA3236@host1.dyn.jankratochvil.net> <20100906094821.GA20484@host1.dyn.jankratochvil.net> Date: Mon, 06 Sep 2010 22:29:00 -0000 Message-ID: Subject: Re: [patch] Fix DW_OP_call2 and DW_OP_call4 for max-cache-age 0 From: Doug Evans To: Jan Kratochvil Cc: Tom Tromey , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-09/txt/msg00166.txt.bz2 On Mon, Sep 6, 2010 at 2:48 AM, Jan Kratochvil wrote: > On Fri, 03 Sep 2010 17:59:16 +0200, Doug Evans wrote: >> Unless code that needs a CU reads it in as necessary, and the API into >> the dwarf reader only ages the cache at well defined points that no >> longer need CUs (e.g. when we're done psymtab->symtab expansion). >> (right?) > > This means only one CU is guaranteed to be read in at one time. =A0And wh= en you > hold that CU you must not call any GDB function as this function can (upon > a change in the future) request its own CU and thus invalidate CU at the > caller. =A0I find it as a too fragile policy. > > Still I find it even ineffective. =A0Regular aging means CUs get flushed = even if > only a few of them is now read-in. > > >> > Therefore I find prepare_execute_command as the only safe place to flu= sh any >> > CU. >> >> OOC, If we did move cache aging to a higher level, is there a reason >> it can't be done at cleanup time? >> [For reference sake, it's actually done today for free_stack_comp_unit.] > > The aging currently affects all CUs read-in. =A0There can be several nest= ed > calls each requesting its own CU and doing aging at the (inner) cleanup t= ime. > That means a cleanup in the inner call may age-out CU in the outer call s= till > before the outer cleanup. > > Without any CU locking in place I still do not see a safe point other tha= n at > the top level idle time (that is prepare_execute_command). How about we take a step back and enumerate the entry points into the dwarf subsystem (at least those that need CUs). Then we can see if/when a CU needs to survive calls across the dwarf API. If there's a correctness issue here, perhaps we want to separate it from the internal optimization detail of CU flushing. E.g. we may find that only flushing CUs in prepare_execute_command has issues as well.