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 6555DC433EF for ; Mon, 27 Jun 2022 03:59:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EF8198E0001; Sun, 26 Jun 2022 23:59:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EA4886B0072; Sun, 26 Jun 2022 23:59:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D93858E0001; Sun, 26 Jun 2022 23:59:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id CA3CC6B0071 for ; Sun, 26 Jun 2022 23:59:52 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A6953771 for ; Mon, 27 Jun 2022 03:59:52 +0000 (UTC) X-FDA: 79622662224.24.1897E1C Received: from out30-57.freemail.mail.aliyun.com (out30-57.freemail.mail.aliyun.com [115.124.30.57]) by imf29.hostedemail.com (Postfix) with ESMTP id A893512002A for ; Mon, 27 Jun 2022 03:59:50 +0000 (UTC) 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=ay29a033018045170;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VHRf2d0_1656302386; Received: from 30.32.122.103(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VHRf2d0_1656302386) by smtp.aliyun-inc.com; Mon, 27 Jun 2022 11:59:47 +0800 Message-ID: <22f7b831-7734-2969-a477-473c4367f61e@linux.alibaba.com> Date: Mon, 27 Jun 2022 11:59:50 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 4/7] migrate_pages(): fix failure counting for THP subpages retrying To: "Huang, Ying" Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Zi Yan , Yang Shi References: <20220624025309.1033400-1-ying.huang@intel.com> <20220624025309.1033400-5-ying.huang@intel.com> <87zghy7ua0.fsf@yhuang6-desk2.ccr.corp.intel.com> From: Baolin Wang In-Reply-To: <87zghy7ua0.fsf@yhuang6-desk2.ccr.corp.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656302392; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YbF3tUdIITCW49mAi6T/QspquedtJsjAAOi7ZuRMo+s=; b=i6Xv2/+90yhATdSDsf25IKkyoP09yrwNGTjqZC578w21TSLTThRm4JXGHQrvl4R2Z2zhZZ 4BmBQBBTVE7V2PHbjKoRTCte4zS8u6xqGvyYInJebAFN7mSLxh9x12u0qiiO7UqD/XwZOJ dmMgXse4NTWM6jJJi4FSHb29skDRi8Y= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.57 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656302392; a=rsa-sha256; cv=none; b=osWGTqWU1Xo5iWwYJ6FRvO6SlkqYbMELNYt399Bi9YAW9yycBi5pnd60qn1zDmwNRldlk/ NIwDPToilOXaszpBIrbQOrpsMuK9pBmy2UfG+Ousiib8i2b6Xn6lFkBvFsoSKnAcv1Lw4s znchfBWGnfR1r/cuFBe9aGSf/zLqWrM= Authentication-Results: imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.57 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: ja5ow691rj673kfm3rni7ptn3nm7xzgh X-Rspamd-Queue-Id: A893512002A X-HE-Tag: 1656302390-343097 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: On 6/27/2022 9:46 AM, Huang, Ying wrote: > Baolin Wang writes: > >> On 6/24/2022 10:53 AM, Huang Ying wrote: >>> 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. >> >> Good catch. Totally agree with you. It seems we can move the condition >> into -EAGAIN case like other cases did? >> >> diff --git a/mm/migrate.c b/mm/migrate.c >> index 1ece23d80bc4..491c2d07402b 100644 >> --- a/mm/migrate.c >> +++ b/mm/migrate.c >> @@ -1463,7 +1463,7 @@ int migrate_pages(struct list_head *from, >> new_page_t get_new_page, >> case -EAGAIN: >> if (is_thp) >> thp_retry++; >> - else >> + else if (!no_subpage_counting) >> retry++; >> break; > > This has another effect except fixing the failure counting. That is, > the split subpages of THP will not be retried for 10 times for -EAGAIN. Ah, yes. > TBH, I think that we should do that. But because this has some behavior OK. So you afraid that 10 times retry for each subpage of THP will waste lots of time? > change, it's better to be done in a separate patch? Do you have > interest to do that on top of this patchset? Sure. I can send a patch which can be folded into your series. Is this OK for you? By the way, if I do like I said, the patch 4 can be avoided. > >> Anyway this patch looks good to me. >> Reviewed-by: Baolin Wang > > Thanks! > > Best Regards, > Huang, Ying > >>> 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 | 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