On 4 June 2014 14:30, Christoffer Dall <christoffer.dall@xxxxxxxxxx> wrote: > On Tue, Jun 03, 2014 at 02:52:58PM +0100, Steve Capper wrote: [ ... ] >> >> I don't quite follow this clear_p[um]d_entry logic. >> So this clear_pmd_entry will de-allocate the page containing the ptes >> (referenced from the pmd entry)? > > Yes. > >> If so, what happens if not all the ptes in the page need to be unmapped? > > Well, then pte_table_empty() will return false (because there are still > active pte's in the pte table) and we won't call the function. > > The idea is that we ref-count each page table page with the number of > active entries in that page (in addition to the initial reference from > allocating the table). So a ref-count of 1 means that there are no > active entries (xxx_table_empty() returns true), a refcount of 513 means > there are 512 active entries. > > Makes sense? Thanks Christoffer, Yes that makes perfect sense. Cheers, -- Steve _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/mailman/listinfo/kvmarm