Hello Dave, On Thu, Jun 12, 2014 at 03:07:11PM -0700, Dave Hansen wrote: > On 06/12/2014 02:48 PM, Naoya Horiguchi wrote: > > This variable is helpful if we try to share the callback function between > > multiple slots (for example between pte_entry() and pmd_entry()) as done > > in later patches. > > smaps_pte() already does this: > > static int smaps_pte(pte_t *pte, unsigned long addr, unsigned long end, > struct mm_walk *walk) > ... > unsigned long ptent_size = end - addr; > > Other than the hugetlb handler, can't we always imply the size from > end-addr? Good point, thanks. I didn't care about this variable. Currently we call this walk via walk_page_vma() so addr and end is always between [vma->vm_start, vma->vm_end]. If a vma is not aligned to pmd-boundary, this size might have incorrect value. But using end-addr seems to cause no practical problem because in such case first or final pmd never have a thp. I'm not sure every caller (especially callers of walk_page_range()) assumes addr/end is page aligned, but walk->size approach looks safer to me. Thanks, Naoya Horiguchi -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>