RE: 1004K MT paging issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

I have found a MIPS-specific race window in __do_fault() between these two calls:
set_pte_at(mm, address, page_table, entry);

/* no need to invalidate: a not-present page won't be cached */
update_mmu_cache(vma, address, page_table);
 
When the block device uses PIO-mode to populate the page in the page-cache, then the main memory still contains stale data when set_pte_at() makes the mapping live. Another VPE hitting the same page will execute garbage code.

Please see the ARM port for hints how to fix this by flushing the data cache already in set_pte_at.

BR,
 Lars


> -----Original Message-----
> From: Mikael Starvik
> Sent: den 26 maj 2014 22:57
> To: linux-mips@xxxxxxxxxxxxxx
> Cc: Lars Persson; Martin Santesson
> Subject: 1004K MT paging issue
> 
> Hi!
> 
> We have a 1004K core with two VPEs with two TCs per VPE. We have a
> problem that is hard to debug and would like to know if anyone has seen
> or solved such an issue.
> 
> A multithreaded application is running.
> Twoapplication threads are running in one TC each on the same VPE.
> A piece of code has been paged out.
> Application thread 1 tries to execute the code and thus gets a page
> fault.
> While the page fault is being handled the second application thread
> enters the same code.
> For some reason it looks like application thread 2 is allowed to
> execute even if the page fault handling has not been finished yet.
> Thread 2 executes the wrong code and typically gets a reserved
> instruction exception.
> 
> Any thougts?
> 
> BR
> /Mikael


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux