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] [thread-next>] [day] [month] [year] [list]
Message-ID: <c79c1066-15a8-34d5-df36-7bd1de9d311d@huawei.com>
Date:   Fri, 31 Mar 2023 17:38:36 +0800
From:   "zhangpeng (AS)" <zhangpeng362@...wei.com>
To:     Matthew Wilcox <willy@...radead.org>
CC:     <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
        <akpm@...ux-foundation.org>, <mike.kravetz@...cle.com>,
        <vishal.moola@...il.com>, <muchun.song@...ux.dev>,
        <sidhartha.kumar@...cle.com>, <wangkefeng.wang@...wei.com>,
        <sunnanyong@...wei.com>
Subject: Re: [PATCH v4 5/6] mm: convert copy_user_huge_page() to
 copy_user_folio()

On 2023/3/31 2:15, Matthew Wilcox wrote:

> On Thu, Mar 30, 2023 at 09:40:44PM +0800, Peng Zhang wrote:
>> +void copy_user_folio(struct folio *dst, struct folio *src,
>> +		      unsigned long addr_hint,
>> +		      struct vm_area_struct *vma,
>> +		      unsigned int pages_per_huge_page);
> Do we really want to pass in pages_per_huge_page here?  We can get
> that from folio_nr_pages(dst).

Agreed. It's not necessary to pass in pages_per_huge_page. I'll remove
it in a v5.

>> +++ b/mm/hugetlb.c
>> @@ -5097,8 +5097,8 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
>>   					ret = PTR_ERR(new_folio);
>>   					break;
>>   				}
>> -				copy_user_huge_page(&new_folio->page, ptepage, addr, dst_vma,
>> -						    npages);
>> +				copy_user_folio(new_folio, page_folio(ptepage), addr, dst_vma,
>> +						npages);
>>   				put_page(ptepage);
> This function should be converted to s/ptepage/pte_folio/, but that's
> not for this patch series.

Appreciate your suggestion. I'll convert this function in a future patch
set.

>> -	copy_user_huge_page(&new_folio->page, old_page, address, vma,
>> -			    pages_per_huge_page(h));
>> +	copy_user_folio(new_folio, page_folio(old_page), address, vma,
>> +			pages_per_huge_page(h));
> Likewise for s/old_page/old_folio/

Will also convert this.

Best Regards,
Peng

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ