linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Chen Wandun <chenwandun@huawei.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
	<akpm@linux-foundation.org>
Subject: Re: [PATCH 2/2] mm: fix contiguous memmap assumptions about alloc/free pages
Date: Tue, 29 Mar 2022 21:27:17 +0800	[thread overview]
Message-ID: <65501e99-0839-5f08-8a69-95e3c77c64ac@huawei.com> (raw)
In-Reply-To: <YkMEyH9QB8MyzW37@casper.infradead.org>



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

>
> .



      reply	other threads:[~2022-03-29 13:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29 13:09 [PATCH 0/2] fix several contiguous memmap assumptions Chen Wandun
2022-03-29 13:09 ` [PATCH 1/2] mm: fix contiguous memmap assumptions about split page Chen Wandun
2022-03-29 13:09 ` [PATCH 2/2] mm: fix contiguous memmap assumptions about alloc/free pages Chen Wandun
2022-03-29 13:08   ` Matthew Wilcox
2022-03-29 13:27     ` Chen Wandun [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65501e99-0839-5f08-8a69-95e3c77c64ac@huawei.com \
    --to=chenwandun@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox