mm/ksm.c is doing an unneeded _notify in write_protect_page.
PATCH 1/1 mm/ksm.c is doing an unneeded _notify in write_protect_page.
ksm.c's write_protect_page implements a lockless means of verifying a page does not have any users of the page which are not accounted for via other kernel tracking means. It does this by removing the writable pte with TLB flushes, checking the page_count against the total known users, and then using set_pte_at_notify to make it a read-only entry.
An unneeded mmu_notifier callout is made in the case where the known users does not match the page_count. In that event, we are inserting the identical pte and there is no need for the set_pte_at_notify, but rather the simpler set_pte_at suffices.
To: Andrew Morton <[email protected]>
---
mm/ksm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/ksm.c +1 -1
@@ -751,7 +751,7 @@ static int write_protect_page(struct vm_* page */ if (page_mapcount (page) +1 + swapped !=page_count (page)) { -set_pte_at_notify (mm, addr, ptep, entry); +set_pte_at (mm, addr, ptep, entry); goto out_unlock; } entry =pte_wrprotect (entry);
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 12 lines · Robin Holt
ksm.c's
write_protect_pageimplements a lockless means of verifying a page does not have any users of the page which are not accounted for via other kernel tracking means. It does this by removing the writable pte with TLB flushes, checking thepage_countagainst the total known users, and then usingset_pte_at_notifyto make it a read-only entry.An unneeded
mmu_notifiercallout is made in the case where the known users does not match thepage_count. In that event, we are inserting the identical pte and there is no need for theset_pte_at_notify, but rather the simplerset_pte_atsuffices.
Quoted 5 lines
To: Andrew Morton <[email protected]>
Signed-off-by Robin Holt <[email protected]>Acked-by Izik Eidus <[email protected]>Acked-by Andrea Arcangeli <[email protected]>Cc Hugh Dickins <[email protected]>
Quoted 13 lines
Cc Chris Wright <[email protected]>---
mm/ksm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Index:
ksm_remove_notify/mm/ksm.c
===================================================================
mm/ksm.c static int write_protect_page(struct vm_ · line 757
Quoted 8 lines
mm/ksm.c +1
-1@@ -751,7 +751,7 @@ static int write_protect_page(struct vm_* page */ if (page_mapcount (page) +1 + swapped !=page_count (page)) { -set_pte_at_notify (mm, addr, ptep, entry); +set_pte_at (mm, addr, ptep, entry); goto out_unlock; } entry =pte_wrprotect (entry);
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>