From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7452 invoked by alias); 2 Dec 2013 07:34:43 -0000 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 Received: (qmail 7441 invoked by uid 89); 2 Dec 2013 07:34:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.8 required=5.0 tests=AWL,BAYES_40,GARBLED_BODY,RDNS_NONE autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Dec 2013 07:34:41 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1VnO1Q-0000fy-9W from Yao_Qi@mentor.com ; Sun, 01 Dec 2013 23:34:24 -0800 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Sun, 1 Dec 2013 23:34:24 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Sun, 1 Dec 2013 23:34:23 -0800 Message-ID: <529C37A2.9000207@codesourcery.com> Date: Mon, 02 Dec 2013 07:34:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Pedro Alves CC: Mark Kettenis , Subject: Re: [PATCH 2/3] skip_prolgoue (amd64) References: <1385735051-27558-1-git-send-email-yao@codesourcery.com> <1385735051-27558-3-git-send-email-yao@codesourcery.com> <201311291436.rATEaZ5Z030292@glazunov.sibelius.xs4all.nl> <201311291605.rATG5XVb030184@glazunov.sibelius.xs4all.nl> <52994E79.4000004@codesourcery.com> <5299B9D0.2020304@redhat.com> In-Reply-To: <5299B9D0.2020304@redhat.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00015.txt.bz2 On 11/30/2013 06:11 PM, Pedro Alves wrote: > It seems like we can "dangerously" hit stale cache (probably most > visible with non-stop mode) between target events: > > #1 - all threads set running, dcache is invalidated > > #2 - thread 1 stops. As we handle the event, we read code, and cache it. > > #3 - others threads continue running. some thread jits something, or > changes code that was cached. > > #4 - thread 2 stops. As we handle the event, we read code, hitting > stale cache. > Yeah, that is a valid case to me. > > I'm thinking we might need to flush the dcache before handling each > event, like we already invalidate the overlay cache (see > "overlay_cache_invalid = 1" in infrun.c) ? I don't know why overlay cache is flushed in each event. Doing some archaeology doesn't give me any clue. I doubt that the overly may change between any two events. It (flushing overlay cache) looks not necessary to me, at least, when overlay events breakpoint is enabled. GDB target cache contains both code cache and stack cache. GDB can know the JIT event by means of jit event breakpoint, but GDB can't know whether a thread's stack is modified (by other threads). So we have to flush target cache before handling *every* event :-/ I'll send a follow-up patch. -- Yao (齐尧)