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]
Date:   Tue, 29 Mar 2022 21:27:17 +0800
From:   Chen Wandun <chenwandun@...wei.com>
To:     Matthew Wilcox <willy@...radead.org>
CC:     <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
        <akpm@...ux-foundation.org>
Subject: Re: [PATCH 2/2] mm: fix contiguous memmap assumptions about
 alloc/free pages



on 2022/3/29 21:08, Matthew Wilcox wrote:
> On Tue, Mar 29, 2022 at 09:09:28PM +0800, Chen Wandun wrote:
>> +#define page_nth(head, tail)	(page_to_pfn(tail) - page_to_pfn(head))
> Could we avoid reintroducing page_nth()?  It is a terrible name.
how about compound_index ?
>> @@ -1213,7 +1213,7 @@ static int free_tail_pages_check(struct page *head_page, struct page *page)
>>   		ret = 0;
>>   		goto out;
>>   	}
>> -	switch (page - head_page) {
>> +	switch (page_nth(head_page, page)) {
>>   	case 1:
>>   		/* the first tail page: ->mapping may be compound_mapcount() */
>>   		if (unlikely(compound_mapcount(page))) {
> This is the only place you use it.  I'd suggest free_tail_pages_check()
> should take 'i' as its second parameter instead of 'page + i', then
> there's no need to convert back to i.
OK, I will send v2, but I'm not sure whether similar function like 
page_nth is needed elsewhere

>
> .

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ