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

how pte to struct task_struct ptr via rmap?



Hi.  I read somewhere that seemed authoritative (unfortunately I
forget where) that you could use the rmap stuff to get both the
mm_struct pointer and the task_struct pointer associated with a PTE
given that PTE.

I see in mm/rmap.c:try_to_unmap_one that you can use ptep_to_mm to get
the mm.  I think it's pretty neat: the mm pointer is hidden in the
mapping field of the page struct describing the page where the pte
lives.

How can you get the task_struct, though?  There's nothing in
include/asm-generic/rmap.h:pgtable_add_rmap that stores the task
struct pointer anywhere, and I don't see a way to get the task struct
given an mm or the vmas hanging off it.

-- 
--Ed L Cashin            |   PGP public key:
  ecashin@xxxxxxx        |   http://noserose.net/e/pgp/


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/