Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp4540100rwb; Wed, 17 Aug 2022 01:34:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR66yd9L9IjP0pPiU6doQ7ZJvUYpIrn78ubY2u/buWH4U/oKbhfiF8gjEI7Okw301Bz7bOWY X-Received: by 2002:a05:6402:4504:b0:43b:4ec7:2ec1 with SMTP id ez4-20020a056402450400b0043b4ec72ec1mr21977888edb.7.1660725282719; Wed, 17 Aug 2022 01:34:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660725282; cv=none; d=google.com; s=arc-20160816; b=l+L6xJah1FYM6sDrNoqeUmv8/ewmoLVCvK+IrwcksuLQw/uXTzM4dgqdWJrBeeS90k TC920FDtxdELMZ2MudpM2wkfeGl/jsr1ZrU1IU4nU3A3lO0fBTGwp+xctLEzU3A6oR2R paAMrsji3Lfw+gKAxjoJx5P9pbBfCSFJ252AUOm4FznteKmzOYcAaZwssKMrWdS0qiH8 f7uhOKwcKniIbQM1vKzxFjbQMa8kKyvoj2lSdrfbdL3WFCRumk/rOJ5mcW3MolByBBwQ H3lY806z+5Zyc9dVS6pO+zjf8w+JgvncFpd4n5t5INPxoSJuMrFSxDOZHpn3QyE06KNX EjVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=af0MvMD5wRuTieQ2n5wEH/zhtSaeiOWYrnvmG1YndxA=; b=OwtOx6P50wJr8gbNXHOQDem8QY9r4Im4/Nu/1/YYQ6aMYqt/wtjtive18QgFk6n3kN VqVM5ej60MQKD3ZxQWXa1C8ZpIaSTTeDETUjXwfmgI2/Rjd4aQT54lHxlFkrhsLDi1V7 +ngKKzUlAgyFiLBfDg52g5dRsAzaRQHORxUJkaEd2jVL5M0o0d1X76v7OmMFL9c+dQdG c+2Zh3zTGP1L7NY174HzXXODs1cK6vBisM306GgKLgjVQ1P+UpAQHxS85bdauzlAKbc0 F/BNUSv9IeQbNe25Yy49NTo0AspDCLnfhbKHPGFARfxqId7tum6VUKExXf6Ttbhi3PLX Jt4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gl9Dlfyr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w22-20020a170907271600b0072b3cde0ce8si11061107ejk.471.2022.08.17.01.34.16; Wed, 17 Aug 2022 01:34:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gl9Dlfyr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234631AbiHQIPF (ORCPT + 99 others); Wed, 17 Aug 2022 04:15:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234709AbiHQIOj (ORCPT ); Wed, 17 Aug 2022 04:14:39 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54ACF543CB for ; Wed, 17 Aug 2022 01:14:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660724071; x=1692260071; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yhmojqv78CNeejAgfGN/fV62nXwRC1Wfl6ID7EB6l2s=; b=gl9DlfyrauDE25KEHLHtO2JpIBQIKRWO6xnABB0epK46bTuosluMr2dG 4Au/lJ29XGGLGO6PBagd3d1uTa2Emnz8g/gR//+sLQkt85ow9VuT0+Gvp bxGX4Zd10p8+eN32t8poVS/vmq/Thmfew0B+30MMX78dvNdHY36i+glLS HvI+tFYga/22hmLwus5SrCLvHEY4ss43OinYNErpItiZGGVWYt/yuFG1a tCf9jafLoViiGkjuOr7/A6F7/5n7pcpPuZffmnZMrww/mhPR/2y7KfwQA Vn1cH8lhho7UPpl0Ni9om7YQbSs7xOzkPEHWD4BO8EcBIwVOYaAXOmlHH w==; X-IronPort-AV: E=McAfee;i="6400,9594,10441"; a="293228818" X-IronPort-AV: E=Sophos;i="5.93,242,1654585200"; d="scan'208";a="293228818" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2022 01:14:30 -0700 X-IronPort-AV: E=Sophos;i="5.93,242,1654585200"; d="scan'208";a="583668113" Received: from yhuang6-mobl1.sh.intel.com ([10.238.6.172]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2022 01:14:28 -0700 From: Huang Ying To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Huang Ying , Baolin Wang , Oscar Salvador , Zi Yan , Yang Shi Subject: [PATCH -V3 4/8] migrate_pages(): fix failure counting for THP subpages retrying Date: Wed, 17 Aug 2022 16:14:04 +0800 Message-Id: <20220817081408.513338-5-ying.huang@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220817081408.513338-1-ying.huang@intel.com> References: <20220817081408.513338-1-ying.huang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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") Reviewed-by: Baolin Wang Reviewed-by: Oscar Salvador Cc: Zi Yan Cc: Yang Shi --- mm/migrate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index ae55f08e72ce..0018b5191799 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1545,7 +1545,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 -- 2.30.2