Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3293831imw; Mon, 11 Jul 2022 06:03:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vj1AsveDFt1309NfQoNqd+RMQ/GCbjSrIrnCu4FGUX+satb6Ki8iajD+EQnvE4pzFpDCGk X-Received: by 2002:aa7:8890:0:b0:525:85db:c0d1 with SMTP id z16-20020aa78890000000b0052585dbc0d1mr18407575pfe.69.1657544584738; Mon, 11 Jul 2022 06:03:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657544584; cv=none; d=google.com; s=arc-20160816; b=dDhpRI4LcPWg7fKSImtdxoxJj9K1S4OY1cOc3yZYCyCWkkbLgYzkDkr166OKSGTqka zbs5sbNTljBTqfMT9iM7Airg9Yc/KGjYLnQ1Zv/QWrD/IqQDJs1TEtfb1Hg0FziZINqH w3ukwJX5WQ3g3nzLcavCJwjBtRwMvHADO8WZlybzV8IEg+CBL5nEu2wMnKb3iFyNw+Tg ZHbTxnyTHdhzaz9rX/gePwLFpXmnEMdgd0i14wfTcVFSFStSoR6ilibdQKs3nIDLVhV4 jejFOUXE+Suxb1tSYqCCIyueg9aB2Otj24bzvrmHDC56pqfF/SMU96j6pxtNWLqxRP/l gPIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=HZGUfp59m5FnFaPjISxEgR9lIENaS4sI+9rM07QEzwM=; b=0aMPF5usAZHGuV6wcPSRfSahE9VarGMpisJ60ArdiH5VZlsi/GYyJtzuXpOatMSZpa RszW55G+FoTIkqOBhc5ZdasQlZE2zyS9fMfLdX6LmA0RF2qxMrts74EFXmbGWX3/p6w1 5/FPQV0GsiKV82QMT8QPnsKwBpAb9WX5dSz0jZzHItw2Dsmky27XQJh+G1MryCC4Cg/N caOnl1QpeDren0vYU4XGfTDmUSAnEqXf7SMwV6DQERJMTC+JhZLTJBZrYTtlkTN3vuGl MT+/Ehr5rzmIs3zL81s4CpOWF6gRl5mRnG8N7UJcjoRy3W2BPgOkcfVjW9GaXIeNBeYH CFjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=1900n3aF; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i25-20020a631319000000b00412b0b46a1csi10610161pgl.172.2022.07.11.06.02.52; Mon, 11 Jul 2022 06:03:04 -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=@suse.de header.s=susede2_rsa header.b=1900n3aF; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231303AbiGKMwk (ORCPT + 99 others); Mon, 11 Jul 2022 08:52:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbiGKMwj (ORCPT ); Mon, 11 Jul 2022 08:52:39 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4808D2E9D9 for ; Mon, 11 Jul 2022 05:52:38 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id EC66D20335; Mon, 11 Jul 2022 12:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1657543956; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HZGUfp59m5FnFaPjISxEgR9lIENaS4sI+9rM07QEzwM=; b=1900n3aF21S73ivEqU/B7C/4jM3WexKmndsusOAWqd954YyOpQvo5A/fEp4xz8BmVSCyrR rclshqRnubBNYJWj7bhtyGtHF+1OUDeAk6spnlhZ07DpoCfcL3qW2Zgf7/K8cDw6hCeTb/ izEJOFrYbDd2zKzozCWVpqHeWEDITQk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1657543956; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HZGUfp59m5FnFaPjISxEgR9lIENaS4sI+9rM07QEzwM=; b=i0+dNOHMmCItX9a6uglvKKFUDL7Ef/OyfYN4VgV0avrHT67MFkRb1Sc5A85FxqKCmcsTrV wneDTlikUo/6g0AQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C175213322; Mon, 11 Jul 2022 12:52:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id TnsxLhQdzGLrHQAAMHmgww (envelope-from ); Mon, 11 Jul 2022 12:52:36 +0000 Date: Mon, 11 Jul 2022 14:52:34 +0200 From: Oscar Salvador To: Huang Ying Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Baolin Wang , Zi Yan , Yang Shi Subject: Re: [PATCH -V2 7/7] migrate_pages(): fix failure counting for retry Message-ID: References: <20220711084948.274787-1-ying.huang@intel.com> <20220711084948.274787-8-ying.huang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220711084948.274787-8-ying.huang@intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Mon, Jul 11, 2022 at 04:49:48PM +0800, 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") > Reviewed-by: Baolin Wang > Cc: Zi Yan > Cc: Yang Shi Reviewed-by: Oscar Salvador > --- > mm/migrate.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/mm/migrate.c b/mm/migrate.c > index 557708ce13a1..cee6fc5a2d31 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -1345,6 +1345,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; > @@ -1365,6 +1366,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) { > /* > @@ -1439,7 +1441,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, > nr_failed++; > } > > - nr_failed_pages += nr_subpages; > + nr_failed_pages += nr_subpages + nr_retry_pages; > /* > * There might be some subpages of fail-to-migrate THPs > * left in thp_split_pages list. Move them back to migration > @@ -1455,6 +1457,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, > thp_retry++; > else > retry++; > + nr_retry_pages += nr_subpages; > break; > case MIGRATEPAGE_SUCCESS: > nr_succeeded += nr_subpages; > @@ -1481,6 +1484,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 > -- > 2.30.2 > > -- Oscar Salvador SUSE Labs