persuez
persuez

Reputation: 1

Why does it take so long for cpu to write memory after it has obtained the physical address?

https://github.com/torvalds/linux/commit/6ce64428d62026a10cb5d80138ff2f90cc21d367:

cpu0                cpu1            cpu2
----                ----            ----
                            [ Writable PTE
                              cached in TLB ]
userfaultfd_writeprotect()
[ write-*unprotect* ]
mwriteprotect_range()
mmap_read_lock()
change_protection()

change_protection_range()
...
change_pte_range()
[ *clear* “write”-bit ]
[ defer TLB flushes ]
                [ page-fault ]
                ...
                wp_page_copy()
                 cow_user_page()
                  [ copy page ]
                            [ write to old
                              page ]
                ...
                 set_pte_at_notify()

I think cpu2 spends too long just only a store instrution.Can store instrution be interrupted?

I have looked up a lot of things that need to be done on the hardware to access the memory after getting the physical address, such as checking the cache, but will these take that long?

Upvotes: 0

Views: 41

Answers (0)

Related Questions