Re: How do I flush/invalidate the CPU instruction cache?
From: Neil Horman (nhorman_at_redhat.com)
Date: 09/15/03
- Next message: Capstar: "Re: interruptible_sleep_on quistion"
- Previous message: Capstar: "Re: interruptible_sleep_on quistion"
- In reply to: jeff: "Re: How do I flush/invalidate the CPU instruction cache?"
- Next in thread: jeff: "Re: How do I flush/invalidate the CPU instruction cache?"
- Reply: jeff: "Re: How do I flush/invalidate the CPU instruction cache?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 15 Sep 2003 07:24:44 -0400
jeff wrote:
> Neil Horman wrote:
>
>> turbo wrote:
>>
>>> I have a dual processor, x86 computer running redhat 9 linux.
>>> I am working with a friend, on a compiler/interpreter environment
>>> that can dynamically generate machine code to be executed.
>>> In order to make the newly generated code work in the system,
>>> it is necessary to flush the instruction cache.
>>>
>>> On Microsoft windows, you just call
>>>
>>> FlushInstructionCache(GetCurrentProcess(), NULL, 0);
>>>
>>> I have searched, and I can't find a way to do it.
>>> I was able to find some old docs to do it on mips based linux.
>>>
>>> Any ideas?
>>>
>>> Thanks,
>>> Jeff
>>>
>>
>> There are some routines defined in the linux kernel for cache
>> flushing, but under X86 they are defined to compile to nothing. I'm
>> sure you've heard this before, but unless the CPU has some sort of
>> problem, user space applications really should not need to flush the
>> cache. This is not to say it can't be done, but if you want to, it
>> means you will have to implement a flush routine in kernel space (this
>> will of course be arch specific), export it in some way to user space
>> and call it from there. The need to flush the cache also clearly
>> means you can say goodbye to easy portability. Perhaps you can expand
>> on why you need to flush the cache, and some people can propose some
>> more portable workaround/other solutions for your problem?
>>
>> HTH
>> Neil
>
>
> As I said, this is for a interactive language that is mostly compiled
> and has the ability to dynamically compile to machine code,
> new program source that is integrated into the existing program, and
> continue executing.
>
> Imaine an interactive basic interpreter, that already is executing a big
> program, and you type in a new procedure, and say to the language
> "compile and run".
>
> This happens to be for a large, mature language called ICL (a strongly
> typed garbage collected language designed for building large complex
> systems), invented at Caltech as part of a doctoral thesis in the late
> 1970's or so, that has around 1 millions lines of code written for it.
> It was developed for the dec-20, ported to the vax, then the dec alpha,
> and currently runs under windows. I am porting it to x86 Gnu/Linux. It
> was used as the backend of the first e-commerce application, mosis.org,
> where I happened to work from 1985-1995.
>
> Jeff Deifik
>
And what specific problem are you running into that you believe will be
solved by flushing the cache?
Neil
-- /*************************************************** *Neil Horman *Software Engineer *Red Hat, Inc. *nhorman@redhat.com ***************************************************/
- Next message: Capstar: "Re: interruptible_sleep_on quistion"
- Previous message: Capstar: "Re: interruptible_sleep_on quistion"
- In reply to: jeff: "Re: How do I flush/invalidate the CPU instruction cache?"
- Next in thread: jeff: "Re: How do I flush/invalidate the CPU instruction cache?"
- Reply: jeff: "Re: How do I flush/invalidate the CPU instruction cache?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|