From patchwork Fri Jun 24 02:53:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, Ying" X-Patchwork-Id: 12893407 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 34EFAC43334 for ; Fri, 24 Jun 2022 02:53:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3A59A8E01C2; Thu, 23 Jun 2022 22:53:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 305AE8E01BF; Thu, 23 Jun 2022 22:53:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1CFDC8E01C2; Thu, 23 Jun 2022 22:53:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 00E4C8E01BF for ; Thu, 23 Jun 2022 22:53:40 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id CB8E460582 for ; Fri, 24 Jun 2022 02:53:40 +0000 (UTC) X-FDA: 79611609000.22.408E200 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by imf21.hostedemail.com (Postfix) with ESMTP id 142871C0019 for ; Fri, 24 Jun 2022 02:53:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656039220; x=1687575220; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dyatKl+uw3fFNQdVpp0JrZk8BbuYdjsdo/ZbC0KvS1w=; b=J5k7PGe1St4QVzRSaLddEsEl0BkJhzcCJSPH4kMcDw5oydC4oyxZwX12 7QzG3PpWF7ts/htx+3l308bg08isf9n0RNUJYARJ8FCHCIr/MSLPKKdni vIY6RZj2ka4cNAv3GCsVQqNMLvbAf2jFlEb8zXliEbirHl4ttPlfmS3Qz AJD7SCK9krORsNRoPr9tx4HMW9QOSTPVQSpNMR8/qeYUeh2LaxNLX9BY9 slMVc2Nzq1FzqN1IUqXtqRj7b01ZoFDe+RPfzA5Iv66InlHVgdeETNzIY ZyGkQLxkC9Pa046+4Em3Hn/yI+c9fSCRrZn9TB7NnjQ8IDUC+6am19W94 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10387"; a="279672731" X-IronPort-AV: E=Sophos;i="5.92,217,1650956400"; d="scan'208";a="279672731" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2022 19:53:39 -0700 X-IronPort-AV: E=Sophos;i="5.92,217,1650956400"; d="scan'208";a="593018090" Received: from yxia2-mobl1.ccr.corp.intel.com (HELO yhuang6-mobl1.ccr.corp.intel.com) ([10.254.214.143]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2022 19:53:37 -0700 From: Huang Ying To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Huang Ying , Baolin Wang , Zi Yan , Yang Shi Subject: [PATCH 4/7] migrate_pages(): fix failure counting for THP subpages retrying Date: Fri, 24 Jun 2022 10:53:06 +0800 Message-Id: <20220624025309.1033400-5-ying.huang@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220624025309.1033400-1-ying.huang@intel.com> References: <20220624025309.1033400-1-ying.huang@intel.com> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656039220; a=rsa-sha256; cv=none; b=fmbUbiLzMzH2hZq+CWJNOjUvciNAY28qqXLYvmpV2EnmnN5KGxAyoQ04+1JGHGbgV1Z9PK +dcA8k8kVGQBxsvApXtdqfFwed2ibFKz2fHNU+aKfwhRJHlIAzGj1J0Ph4Ucl+U1CRUwgc ttTie/oVlEr1YOu9a3b/TVfnh0LzsAE= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=J5k7PGe1; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf21.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 192.55.52.120) smtp.mailfrom=ying.huang@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656039220; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=75uwcPONczZNaQCmnG1AhPpbl35dMc+qJFYG6J0RjEA=; b=AhmNoa2UjvFQwslRNDTTw6sIMpY4Hzit57/ebhvZYhw3bLuBTbPp6ViTFF9oB7qsFjZHQU hG8NlukZl2nqYJMva4gnA1ya1xa2E8v1qcMHlvoGkab+oCNk4j/9UHiQqNOl3vYIiu4Ge9 yHpveA/5xgXvnxOMo8e3HU9f75giVek= X-Stat-Signature: o98yb7dos8cf9qh4yfmofrs48okuj949 X-Rspamd-Queue-Id: 142871C0019 Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=J5k7PGe1; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf21.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 192.55.52.120) smtp.mailfrom=ying.huang@intel.com X-Rspamd-Server: rspam10 X-Rspam-User: X-HE-Tag: 1656039219-104100 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: If THP is failed to be migrated for -ENOSYS and -ENOMEM, the THP will be split into thp_split_pages, and after other pages are migrated, pages in thp_split_pages will be migrated with no_subpage_counting == true, because its failure have been counted already. If some pages in thp_split_pages are retried during migration, we should not count their failure if no_subpage_counting == true too. This is done this patch to fix the failure counting for THP subpages retrying. 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 Reviewed-by: Baolin Wang --- mm/migrate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index 542533e4e3cf..61dab3025a1d 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1477,7 +1477,8 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, } } } - nr_failed += retry; + if (!no_subpage_counting) + nr_failed += retry; nr_thp_failed += thp_retry; /* * Try to migrate subpages of fail-to-migrate THPs, no nr_failed