uproc->tg_leader was used to validate looked up uproc belongs to the
process. It was used to check if the uproc belonged to the process for
which we are currently trying to register/unregister uprobes.
Since we want to share the uproc with process that share the same mm, I
agree that its better off we remove the tg_leader.
Okay, I will add the forward declaration in the include file and update
the function prototypes accordingly.
Yeah, since tracehook_notify_resume() is in fast path, its worth adding
a new TIF flag.
All callers of write_opcodes should have taken uproc->mutex.
If there are other users of write_opcode, we will have to add a way to
synchronize this.
That's a bug, I will fix it. remove_bkpt() clearly says it needs to be
called with uproc->mutex held.
Okay.
I dont think so.
If uprobes runs on hosts, it would be calling replace_page() on text
pages. KSM for now works on anonymous pages. Even the replaced page we
add still belongs to the text VMA.
If uprobes runs on guest, KSM should be taking care of cases where
similar pages are inserted/deleted
I still need to verify this. I shall get back to you on this.
However are there applications that mprotect(PROT_WRITE) text pages?
I dont think we handle this case now. I think even munmap of the region
where there are probes inserted also can have the same problem.
Are there ways to handle this.
I think taking a write lock on mmap_sem instead of the read lock could
handle this problem.
I am copying Mel Gorman and Andrea Arcangeli so that they can provide
their inputs on VM and KSM related issues.
--
Thanks and Regards
Srikar
--