From: Yunfeng Ye <yeyunfeng@huawei.com>
To: David Rientjes <rientjes@google.com>
Cc: <akpm@linux-foundation.org>, <jgg@ziepe.ca>, <mhocko@suse.com>,
<jglisse@redhat.com>, <minchan@kernel.org>,
<peterz@infradead.org>, <jack@suse.cz>, <rppt@linux.ibm.com>,
<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
"hushiyuan@huawei.com" <hushiyuan@huawei.com>,
"linfeilong@huawei.com" <linfeilong@huawei.com>
Subject: Re: [PATCH] mm/madvise: replace with page_size() in madvise_inject_error()
Date: Thu, 7 Nov 2019 10:05:59 +0800 [thread overview]
Message-ID: <7296c9ca-f8a7-f31b-d090-cc6bf5ee1df4@huawei.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1911061327550.155572@chino.kir.corp.google.com>
On 2019/11/7 5:28, David Rientjes wrote:
> On Wed, 6 Nov 2019, Yunfeng Ye wrote:
>
>> The function page_size() is supported after the commit a50b854e073c
>> ("mm: introduce page_size()").
>>
>> Replace with page_size() in madvise_inject_error() for readability.
>>
>> Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
>> ---
>> mm/madvise.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/mm/madvise.c b/mm/madvise.c
>> index 2be9f3fdb05e..38c4e7fcf850 100644
>> --- a/mm/madvise.c
>> +++ b/mm/madvise.c
>> @@ -856,13 +856,13 @@ static int madvise_inject_error(int behavior,
>> {
>> struct page *page;
>> struct zone *zone;
>> - unsigned int order;
>> + unsigned int size;
>
> Should be unsinged long.
>
ok, thanks. Andrew has already help me modify the patch and add to -mm tree.
>>
>> if (!capable(CAP_SYS_ADMIN))
>> return -EPERM;
>>
>>
>> - for (; start < end; start += PAGE_SIZE << order) {
>> + for (; start < end; start += size) {
>> unsigned long pfn;
>> int ret;
>>
>> @@ -874,9 +874,9 @@ static int madvise_inject_error(int behavior,
>> /*
>> * When soft offlining hugepages, after migrating the page
>> * we dissolve it, therefore in the second loop "page" will
>> - * no longer be a compound page, and order will be 0.
>> + * no longer be a compound page.
>> */
>> - order = compound_order(compound_head(page));
>> + size = page_size(compound_head(page));
>>
>> if (PageHWPoison(page)) {
>> put_page(page);
>
> .
>
next prev parent reply other threads:[~2019-11-07 2:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-06 7:06 Yunfeng Ye
2019-11-06 21:28 ` David Rientjes
2019-11-07 2:05 ` Yunfeng Ye [this message]
2019-11-07 20:48 ` David Rientjes
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=7296c9ca-f8a7-f31b-d090-cc6bf5ee1df4@huawei.com \
--to=yeyunfeng@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=hushiyuan@huawei.com \
--cc=jack@suse.cz \
--cc=jgg@ziepe.ca \
--cc=jglisse@redhat.com \
--cc=linfeilong@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=minchan@kernel.org \
--cc=peterz@infradead.org \
--cc=rientjes@google.com \
--cc=rppt@linux.ibm.com \
/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