Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Context switches & interrupts affecting cache?
@ 2007-08-03 10:59 Mohamed Bamakhrama
  2007-08-03 12:40 ` Ralf Baechle
  0 siblings, 1 reply; 3+ messages in thread
From: Mohamed Bamakhrama @ 2007-08-03 10:59 UTC (permalink / raw)
  To: linux-mips

Hi all,
I have one question regarding context switches between user and kernel
modes and interrupts. Do they invalidate the I-cache or D-cache?

Best regards,

-- 
Mohamed

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Context switches & interrupts affecting cache?
  2007-08-03 10:59 Context switches & interrupts affecting cache? Mohamed Bamakhrama
@ 2007-08-03 12:40 ` Ralf Baechle
  2007-08-03 12:51   ` Mohamed Bamakhrama
  0 siblings, 1 reply; 3+ messages in thread
From: Ralf Baechle @ 2007-08-03 12:40 UTC (permalink / raw)
  To: Mohamed Bamakhrama; +Cc: linux-mips

On Fri, Aug 03, 2007 at 12:59:41PM +0200, Mohamed Bamakhrama wrote:

> Hi all,
> I have one question regarding context switches between user and kernel
> modes and interrupts. Do they invalidate the I-cache or D-cache?

Never on MIPS.

I call an architecture that would require a cacheflush for such a
context switch totally broken and yes, they exist - but nothing from
the MIPS family.

  Ralf

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Context switches & interrupts affecting cache?
  2007-08-03 12:40 ` Ralf Baechle
@ 2007-08-03 12:51   ` Mohamed Bamakhrama
  0 siblings, 0 replies; 3+ messages in thread
From: Mohamed Bamakhrama @ 2007-08-03 12:51 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips

On 8/3/07, Ralf Baechle <ralf@linux-mips.org> wrote:
> On Fri, Aug 03, 2007 at 12:59:41PM +0200, Mohamed Bamakhrama wrote:
>
> > Hi all,
> > I have one question regarding context switches between user and kernel
> > modes and interrupts. Do they invalidate the I-cache or D-cache?
>
> Never on MIPS.
>
> I call an architecture that would require a cacheflush for such a
> context switch totally broken and yes, they exist - but nothing from
> the MIPS family.

Thanks Ralf for your reply.
The problem that I face now is that the lock works only when I lock
the I-cache lines *just* before calling the function OR when I lock
the code and execute it with all interrupts disabled (via
local_irq_save() & restore()). I always do the lock with interrupts
disabled, but the strange thing is that it works only when the lock is
*close* enough to the code and in my case "close" means just before
calling it :-(
That's why I was wondering if the kernel is doing something strange
with the I-cache such as invalidation on interrupts or other events.

Greetings,

--
Mohamed

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-03 12:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-03 10:59 Context switches & interrupts affecting cache? Mohamed Bamakhrama
2007-08-03 12:40 ` Ralf Baechle
2007-08-03 12:51   ` Mohamed Bamakhrama

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox