Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1568503ybk; Thu, 21 May 2020 09:52:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiFOMSU0+CtB8cTuJZBa5L/c6MFGYmnErv298fwk2p9OLBNoRU645HocvFsZyD5cpfMe2w X-Received: by 2002:a17:906:b299:: with SMTP id q25mr4656642ejz.448.1590079973786; Thu, 21 May 2020 09:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079973; cv=none; d=google.com; s=arc-20160816; b=VOnRzVAO/nnerRr94aFyezfUpuAzlLTKW8eZmmw6q6yS3ntz02IaAJ01KojSibZjL+ VAiAgjj1BLWIOhY6M5rZwYwj1yCB+wCSms10B/1KfgGoC7cI3zxZVJ62rGNLbDE7x7x4 t0xLv4MdSt9G30PLwCH+aV518A5pqLNTrxJ5Kbt3Ma3bF1fNXRuvmVTZ3CoryWnty8sN GCRdJndurIz3jVAIvsvxCuTsOk0Qt6giEtXX7Sphxx2YaZLUpSeb4SDMbZXvoKWn1m8d 1CGLd8Ucx2+90Clr6PDMKIRMBewPK0Pjwjppb0R6Ycu5KI5zrR1vyUtRxRGS+YXv9PRr Y5cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=oMowLHCsRL7HON8J2BMlENEfpTDx6kTiH+UQ4c5lO3w=; b=yF8VJBCOfBQ04Sgk7zOmJWiDRVlflo6llXinJnMy4bWGrGA4OGT/AGPAxDRyrkbzTv IvEfV860iwsmu+KoDT+9oJhGgiszKP+Ok7ulmWqQ9qubSjOEvjDyewSMJ+nwDsxD3bNa VgDMt5zQS/RYNdUx3NaGj3tM+EgI0xOEQxc8wI0U02KvWGijuDZ+eIhngo65a/vAHm9u 7WjG4FDJeenw/ioWtG714A1SJJLp1H6B76WbikZHG8J1CUUO0EqTt7QqIzZW7/4qAdEA ZyiDDIqNrM1G/9G8ju45R4zfE9aJvZRqq25Xlar/w66vqT4pALl9szsVHZFPByAbXdEm GIIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds22si4631951ejc.227.2020.05.21.09.52.27; Thu, 21 May 2020 09:52:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729910AbgEUQsV (ORCPT + 99 others); Thu, 21 May 2020 12:48:21 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:53398 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726938AbgEUQsU (ORCPT ); Thu, 21 May 2020 12:48:20 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04427;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0TzDN7ee_1590079693; Received: from US-143344MP.local(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0TzDN7ee_1590079693) by smtp.aliyun-inc.com(127.0.0.1); Fri, 22 May 2020 00:48:15 +0800 Subject: Re: [RFC linux-next PATCH] mm: khugepaged: remove error message when checking external pins To: Qian Cai Cc: kirill.shutemov@linux.intel.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1589317383-9595-1-git-send-email-yang.shi@linux.alibaba.com> <20200521145644.GA6367@ovpn-112-192.phx2.redhat.com> From: Yang Shi Message-ID: <67808455-39ed-9fae-014b-c022304a2a32@linux.alibaba.com> Date: Thu, 21 May 2020 09:48:07 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20200521145644.GA6367@ovpn-112-192.phx2.redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.