lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5120893D.6090705@freescale.com>
Date:	Sun, 17 Feb 2013 15:39:41 +0800
From:	Huang Shijie <b32955@...escale.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	<linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: introduce __linear_page_index()

于 2013年02月06日 05:27, Andrew Morton 写道:
> On Tue, 5 Feb 2013 15:03:39 +0800
> Huang Shijie<b32955@...escale.com>  wrote:
>
>> +static inline pgoff_t __linear_page_index(struct vm_area_struct *vma,
>>   					unsigned long address)
>>   {
>>   	pgoff_t pgoff;
>> +
>> +	pgoff = (address - vma->vm_start)>>  PAGE_SHIFT;
>> +	return pgoff + vma->vm_pgoff;
>> +}
>> +
>> +static inline pgoff_t linear_page_index(struct vm_area_struct *vma,
>> +					unsigned long address)
>> +{
>>   	if (unlikely(is_vm_hugetlb_page(vma)))
>>   		return linear_hugepage_index(vma, address);
>> -	pgoff = (address - vma->vm_start)>>  PAGE_SHIFT;
>> -	pgoff += vma->vm_pgoff;
>> -	return pgoff>>  (PAGE_CACHE_SHIFT - PAGE_SHIFT);
>> +	return __linear_page_index(vma, address)>>
>> +				(PAGE_CACHE_SHIFT - PAGE_SHIFT);
>>   }
> I don't think we need bother creating both linear_page_index() and
> __linear_page_index().  Realistically, we won't be supporting
Just as Hocko said, the unmap_ref_private() (in hugetlb.c) may also uses 
the __linear_page_index().
So it's better to the two helpers : linear_page_index() and 
__linear_page_index().
do you agree?

thanks
Huang Shijie

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ