From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24867 invoked by alias); 19 Nov 2013 06:02:09 -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 24858 invoked by uid 89); 19 Nov 2013 06:02:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.7 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; Tue, 19 Nov 2013 06:02:06 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1VieNi-0006Q7-9g from Yao_Qi@mentor.com ; Mon, 18 Nov 2013 22:01:50 -0800 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 18 Nov 2013 22:01:50 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.2.247.3; Mon, 18 Nov 2013 22:01:47 -0800 Message-ID: <528AFE6E.9000009@codesourcery.com> Date: Tue, 19 Nov 2013 06:16: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: Subject: Re: [PATCH 05/10] Invalidate or shrink dcache when setting is changed. References: <1383458049-20893-1-git-send-email-yao@codesourcery.com> <1383458049-20893-6-git-send-email-yao@codesourcery.com> <528A38B5.6020906@redhat.com> In-Reply-To: <528A38B5.6020906@redhat.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00510.txt.bz2 On 11/18/2013 11:56 PM, Pedro Alves wrote: > On 11/03/2013 05:54 AM, Yao Qi wrote: >> Nowadays, when cache size or line size is changed by command, >> 'target_dcache' is invalidated. It is too conservative. We can >> optimize in the following ways, >> >> - Don't have to invalidate dcache immediately after cache size or >> line size is changed. We can postpone the invalidation to the moment >> using 'target_dcache'. >> - Don't have to invalidate dcache if the cache size is changed. If >> cache size is changed to the value which is still greater than >> dcache's size, nothing should be done. If change to the value >> which is less than dcache's size, just evict cache lines. >> >> This is what this patch does. > > Actually, my "My thoughts exactly." comment in the other patch was > originally directed at this patch. Do we really need this extra > complication? What's the use case that needs this? > Here are three use cases, 1) target dcache has 16 cache lines, and dcache size is 4096. User types command "set dcache size 32" or "set dcache size 4160". 2) target dcache has 16 cache lines. User types command "set dcache size 8". 3) line size of target dcache is 32. User types commands "set dcache line-size 16" // change line-size to 16. // change it back. "set dcache line-size 32" This "extra complication" looks natural or reasonable to a software cache. We are using cache, and we'd like to do as few invalidations as possible. -- Yao (齐尧)