[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how pte to struct task_struct ptr via rmap?
Arjan van de Ven <arjanv@xxxxxxxxxx> writes:
> On Fri, 2004-03-05 at 19:25, Ed L Cashin wrote:
>> 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.
>
> there is a fundamental issue wrt task_struct: there can be *many* of
> those for any given PTE, since tasks can (and do in the case of threads)
> share the mm.
I should have mentioned that I know that multiple threads can share an
mm. The question is more general: how to get the owner(s) of the mm.
--
--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/