Re: update_mmu_cache(): fault or not fault ?

David S. Miller
2005-09-26T07:41:23Z

> The problem is that want to only ever do that kind of hw TLB pre-fill
> when update_mmu_cache() is called as the result an actual fault.
> However, for some reasons that I'm not 100% sure about (*)
> update_mmu_cache() is called from other places, typically in mm/fremap.c
> which aren't directly results of faults.
>
> So I suggest adding an argument to it "int is_fault", that would
> basically be '1' on all the call sites in mm/memory.c and '0' in all the
> call sites in mm/fremap.c.

You can track this in your port specific code. That's what I do on
sparc64 to deal with this case. I record the TLB miss type (D or I
tlb), and also whether a write occurred, in a bitmask. Then I check
this in update_mmu_cache() to decide whether to prefill.

I store it in current_thread_info() and clear it at the end of fault
processing.

Just grep for "FAULT_CODE_*" in the sparc64 code to see how this
works.

Although, I'm ambivalent as to whether prefilling helps at all.