This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH 05/10] Invalidate or shrink dcache when setting is changed.
- From: Yao Qi <yao at codesourcery dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Tue, 19 Nov 2013 14:00:14 +0800
- Subject: Re: [PATCH 05/10] Invalidate or shrink dcache when setting is changed.
- Authentication-results: sourceware.org; auth=none
- References: <1383458049-20893-1-git-send-email-yao at codesourcery dot com> <1383458049-20893-6-git-send-email-yao at codesourcery dot com> <528A38B5 dot 6020906 at redhat dot com>
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
- 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
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