This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Rewrite data cache to use splay tree


On Tue, Jul 7, 2009 at 2:24 PM, Jacob Potter<jdpotter@google.com> wrote:
> Here's the first part of the dcache rewrite and stack caching changes
> I've been working on. This patch re-implements the cache using a splay
> tree, along with a linked list for an oldest-first replacement policy.
> It also makes the cache write-through, rather than the old
> partially-implemented writeback functionality.
>
> I couldn't find a good place to store separate cache structures for
> different inferiors; I think the answer is to just clear the cache
> when current_target is changed, which I'll do in the second patch.
>
> - Jacob
>
> 2009-07-07 ?Jacob Potter ?<jdpotter@google.com>
>
> ? ? ? ?* dcache.c (ENTRY_INVALID, ENTRY_VALID, ENTRY_DIRTY): Delete.
> ? ? ? ?(state_chars): Delete.
> ? ? ? ?(struct dcache_block): Clean up; remove state and anydirty fields.
> ? ? ? ?(struct dcache_struct): Redefine as a splay tree and linked list.
> ? ? ? ?(dcache_writeback): Remove declaration.
> ? ? ? ?(dcache_invalidate, dcache_hit): Rewrite for new cache structure.
> ? ? ? ?(dcache_write_line): Delete.
> ? ? ? ?(dcache_read_line, dcache_alloc): Rewrite for new cache structure.
> ? ? ? ?(dcache_writeback): Delete.
> ? ? ? ?(dcache_peek_byte): Clean up; remove "invalid" state check.
> ? ? ? ?(dcache_poke_byte): Rewrite for new cache structure; clarify comment.
> ? ? ? ?(dcache_splay_tree_compare): New function.
> ? ? ? ?(dcache_init, dcache_free): Rewrite for new cache structure.
> ? ? ? ?(dcache_xfer_memory): Rewrite for new write-through cache structure.
> ? ? ? ?(dcache_update, dcache_print_line): New functions.
> ? ? ? ?(dcache_info): Rewrite for new cache structure.
> ? ? ? ?(_initialize_dcache): Rewrite for new cache structure.
> ? ? ? ?* dcache.h (dcache_xfer_memory): Update definition.
> ? ? ? ?(dcache_update, dcache_stack_enabled_p): Declare.
> ? ? ? ?* target.c (memory_xfer_partial): Update calls to dcache_xfer_memory.
>

Hi.

I checked in a sligntly modified version of this patch.
The actual stack caching patch is still todo.

2009-08-20  Jacob Potter  <jdpotter@google.com>

        Replace dcache with splay tree.
        Remove partially implemented writeback support.
        * dcache.c: Include splay-tree.h.
        (LINE_SIZE_POWER): Change from 5 to 6.
        (DCACHE_SIZE): Change from 64 to 4096.
        (ENTRY_INVALID, ENTRY_VALID, ENTRY_DIRTY): Delete.
        (state_chars): Delete.
        (struct dcache_block): Clean up; remove state and anydirty fields.
        (struct dcache_struct): Redefine as a splay tree and linked list.
        (last_cache): Make static.
        (dcache_invalidate, dcache_hit): Rewrite for new cache structure.
        (dcache_read_line, dcache_alloc): Rewrite for new cache structure.
        (dcache_write_line): Delete.
        (dcache_writeback): Delete.
        (dcache_peek_byte): Clean up; remove "invalid" state check.
        (dcache_poke_byte): Rewrite for new cache structure; clarify comment.
        (dcache_splay_tree_compare): New function.
        (dcache_init, dcache_free): Rewrite for new cache structure.
        (dcache_xfer_memory): Rewrite for new write-through cache structure.
        (dcache_print_line): New function.
        (dcache_info): Rewrite for new cache structure.
        (_initialize_dcache): Update "info dcache" help text.
        * dcache.h (dcache_xfer_memory): Update declaration.
        * target.c (memory_xfer_partial): Update calls to dcache_xfer_memory.

Attachment: gdb-090820-jdpotter-dcache-rewrite-1.patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]