From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CC56C43334 for ; Mon, 27 Jun 2022 06:21:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 368026B0071; Mon, 27 Jun 2022 02:21:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 317A36B0072; Mon, 27 Jun 2022 02:21:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1DF6D8E0001; Mon, 27 Jun 2022 02:21:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 1047A6B0071 for ; Mon, 27 Jun 2022 02:21:43 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id CC4B12100B for ; Mon, 27 Jun 2022 06:21:42 +0000 (UTC) X-FDA: 79623019644.08.8CFA3E1 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by imf26.hostedemail.com (Postfix) with ESMTP id A2E20140024 for ; Mon, 27 Jun 2022 06:21:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656310900; x=1687846900; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=izwFnX+6z545+eh0FSlT5xUFypO7lEFeLqpSq1YYwzY=; b=D662c6fP0F4HjnXSlmXvl6yZ9J4TvdCASsGK4aWy2lxBfcVIVnx7oeDF mD688GIV14+reUrvmUSzrYiBktGhBzlFeyBP/Bmu7edBtf8LIA0TdRxcZ IJcpCwGXJhWnzJbOxsyZAc8O+vgJVMGSaZAJeVrZZp4IKG/ndOLHRv548 JJ3VpYw6rDmOucvHxM1SdzRvlSwH83B4wQ2axm4aISe2K6/pr4t2gK8yw 4ZAdoID/bMAO24Qe8K69dQakbQLrQ8c30Ij1B02HyLb1WdZoaZHj2Ka+H wDbxhjrzPJUwf4Ob51DE52jdmnp+TsOfA5gl0xPmo+ThqFORtTTbFbdb8 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10390"; a="281409897" X-IronPort-AV: E=Sophos;i="5.92,225,1650956400"; d="scan'208";a="281409897" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2022 23:21:36 -0700 X-IronPort-AV: E=Sophos;i="5.92,225,1650956400"; d="scan'208";a="836058465" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.239.13.94]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2022 23:21:35 -0700 From: "Huang, Ying" To: Baolin Wang Cc: , , , , Subject: Re: [PATCH 7/7] migrate_pages(): fix failure counting for retry References: <20220624025309.1033400-1-ying.huang@intel.com> <20220627022515.1067946-1-ying.huang@intel.com> <5b40e07d-7ed3-7eba-ea71-52e5a06c1ec8@linux.alibaba.com> Date: Mon, 27 Jun 2022 14:21:31 +0800 In-Reply-To: <5b40e07d-7ed3-7eba-ea71-52e5a06c1ec8@linux.alibaba.com> (Baolin Wang's message of "Mon, 27 Jun 2022 12:29:28 +0800") Message-ID: <87mtdy7hjo.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=D662c6fP; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf26.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 192.55.52.115) smtp.mailfrom=ying.huang@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656310901; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ahrtsqwBBn0w5Ra+M1S8hhF/W6vv+Sa1lJmBaLp8GRM=; b=QyEswVcb/4e8i+QxFDAJnRjzLUiQ8ANnZZK+3pn34TbiB2t5kf0a8KbJLju6o5ADzmqTgz DM/XwtcrE/6xAQyYZ7aQ7RxMnPNZcy3E5IMwm4CcLDIrJOsQ45cfIx8ygVhwB4ECZAo1vG o8S76FNPmaw0kYNQU+578hy12G55dBs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656310901; a=rsa-sha256; cv=none; b=C+jEWgI3To4I1X1sRJ5Fd3S46ayfpFwJNtteEGKIpjh3GIp5Yy1cAGRZx3Po0ftNFXYRXk 4EMQ+pJXxSQrBRGX6w54jLGJqRBI6exBlRfYtgBu/CG4SzhybqIjAQSVwavumWaFpr72R9 Gsbn/SztWteTjK5jERd3wGhzL9wo/uU= X-Stat-Signature: criabptgjof6weobckmgtujnpiytr83b X-Rspamd-Queue-Id: A2E20140024 X-Rspam-User: Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=D662c6fP; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf26.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 192.55.52.115) smtp.mailfrom=ying.huang@intel.com X-Rspamd-Server: rspam12 X-HE-Tag: 1656310900-684571 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Baolin Wang writes: > On 6/27/2022 10:25 AM, Huang Ying wrote: >> After 10 retries, we will give up and the remaining pages will be >> counted as failure in nr_failed and nr_thp_failed. We should count >> the failure in nr_failed_pages too. This is done in this patch. >> Signed-off-by: "Huang, Ying" >> Fixes: 5984fabb6e82 ("mm: move_pages: report the number of non-attempted pages") >> Cc: Baolin Wang >> Cc: Zi Yan >> Cc: Yang Shi >> --- >> mm/migrate.c | 5 +++++ >> 1 file changed, 5 insertions(+) >> diff --git a/mm/migrate.c b/mm/migrate.c >> index 70a0e1f34c03..e42bd409d3aa 100644 >> --- a/mm/migrate.c >> +++ b/mm/migrate.c >> @@ -1344,6 +1344,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, >> int thp_retry = 1; >> int nr_failed = 0; >> int nr_failed_pages = 0; >> + int nr_retry_pages = 0; >> int nr_succeeded = 0; >> int nr_thp_succeeded = 0; >> int nr_thp_failed = 0; >> @@ -1364,6 +1365,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, >> for (pass = 0; pass < 10 && (retry || thp_retry); pass++) { >> retry = 0; >> thp_retry = 0; >> + nr_retry_pages = 0; >> list_for_each_entry_safe(page, page2, from, lru) { >> /* >> @@ -1449,12 +1451,14 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, >> nr_thp_failed += thp_retry; >> if (!no_subpage_counting) >> nr_failed += retry; >> + nr_failed_pages += nr_retry_pages; > > Can you move this a little forward to update 'nr_failed_pages' in one > place, which seems more readable? > nr_failed_pages += nr_subpages + nr_retry_pages; Sure. Will do this in the next version! > Otherwise, > Reviewed-by: Baolin Wang Thanks! Best Regards, Huang, Ying > >> goto out; >> case -EAGAIN: >> if (is_thp) >> thp_retry++; >> else >> retry++; >> + nr_retry_pages += nr_subpages; >> break; >> case MIGRATEPAGE_SUCCESS: >> nr_succeeded += nr_subpages; >> @@ -1481,6 +1485,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, >> if (!no_subpage_counting) >> nr_failed += retry; >> nr_thp_failed += thp_retry; >> + nr_failed_pages += nr_retry_pages; >> /* >> * Try to migrate subpages of fail-to-migrate THPs, no nr_failed >> * counting in this round, since all subpages of a THP is counted