linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yang Shi <yang.shi@linux.alibaba.com>
To: Qian Cai <cai@lca.pw>
Cc: kirill.shutemov@linux.intel.com, akpm@linux-foundation.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC linux-next PATCH] mm: khugepaged: remove error message when checking external pins
Date: Thu, 21 May 2020 09:48:07 -0700	[thread overview]
Message-ID: <67808455-39ed-9fae-014b-c022304a2a32@linux.alibaba.com> (raw)
In-Reply-To: <20200521145644.GA6367@ovpn-112-192.phx2.redhat.com>



On 5/21/20 7:56 AM, Qian Cai wrote:
> On Wed, May 13, 2020 at 05:03:03AM +0800, Yang Shi wrote:
> []
>>   mm/khugepaged.c | 24 +++++++++++++++++-------
>>   1 file changed, 17 insertions(+), 7 deletions(-)
>>
>> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
>> index 1fdd677..048f5d4 100644
>> --- a/mm/khugepaged.c
>> +++ b/mm/khugepaged.c
>> @@ -602,12 +602,6 @@ static bool is_refcount_suitable(struct page *page)
>>   	if (PageSwapCache(page))
>>   		expected_refcount += compound_nr(page);
>>   
>> -	if (IS_ENABLED(CONFIG_DEBUG_VM) && expected_refcount > refcount) {
>> -		pr_err("expected_refcount (%d) > refcount (%d)\n",
>> -				expected_refcount, refcount);
>> -		dump_page(page, "Unexpected refcount");
>> -	}
>> -
>>   	return page_count(page) == expected_refcount;
>>   }
> mm/khugepaged.c: In function 'is_refcount_suitable':
> mm/khugepaged.c:575:25: warning: variable 'refcount set but not used [-Wunused-but-set-variable]
>    int expected_refcount, refcount;
>                           ^~~~~~~~
>
> --- a/mm/khugepaged.c
> +++ b/mm/khugepaged.c
> @@ -572,9 +572,8 @@ static void release_pte_pages(pte_t *pte, pte_t *_pte,
>   
>   static bool is_refcount_suitable(struct page *page)
>   {
> -	int expected_refcount, refcount;
> +	int expected_refcount;
>   
> -	refcount = page_count(page);
>   	expected_refcount = total_mapcount(page);
>   	if (PageSwapCache(page))
>   		expected_refcount += compound_nr(page);

Thanks for catching this.




      parent reply	other threads:[~2020-05-21 16:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12 21:03 Yang Shi
2020-05-18 10:19 ` Kirill A. Shutemov
2020-05-19  2:04   ` Yang Shi
2020-05-19 14:17     ` Kirill A. Shutemov
     [not found] ` <20200521145644.GA6367@ovpn-112-192.phx2.redhat.com>
2020-05-21 16:48   ` Yang Shi [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=67808455-39ed-9fae-014b-c022304a2a32@linux.alibaba.com \
    --to=yang.shi@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=cai@lca.pw \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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