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 84A5AC433EF for ; Mon, 27 Jun 2022 04:25:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 207DD6B0071; Mon, 27 Jun 2022 00:25:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1B7966B0072; Mon, 27 Jun 2022 00:25:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 080098E0001; Mon, 27 Jun 2022 00:25:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id EEBE86B0071 for ; Mon, 27 Jun 2022 00:25:56 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id BB8B820FEF for ; Mon, 27 Jun 2022 04:25:56 +0000 (UTC) X-FDA: 79622727912.22.C80F0BE Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by imf11.hostedemail.com (Postfix) with ESMTP id EFC8540019 for ; Mon, 27 Jun 2022 04:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656303954; x=1687839954; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=Nj9zrpx+N2GmInMC3MZOse65eHoBgmYvf4DV5mrcGc8=; b=TxnD/rNLoG+umIcvzzOKyFBggZjzhhcCfNtvZuEDqTP/lgSCJ8DJ3JC5 dJgIj1a7MgzhdedDg01LM/MjBudb4B/q/0XjywfwfN1nvgpyXX6jCnixC qozBLJzWfZbeh+lyV/imFLctKSMqXEXrjtZkJdFtVsq1HzzEo4cPjM4OA 0hp7LnIqcWlY+7vcsciDVGsWBKSHuMzWy/0UnkUcJxmaqQhv3fXLYLbLx 9xjaOqKonQen6JxQjWe7rysSit/rakcVGTbAI404eoGZ4BYZLxWahl+bL Y94GECpJn3ocVxAQZjEQn3IFpTo0/OkcxHjlVv4nf4OJ3pm9OGTFOta69 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10390"; a="345353445" X-IronPort-AV: E=Sophos;i="5.92,225,1650956400"; d="scan'208";a="345353445" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2022 21:24:01 -0700 X-IronPort-AV: E=Sophos;i="5.92,225,1650956400"; d="scan'208";a="836021395" 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 21:23:59 -0700 From: "Huang, Ying" To: Baolin Wang Cc: Andrew Morton , , , Zi Yan , Yang Shi Subject: Re: [PATCH 4/7] migrate_pages(): fix failure counting for THP subpages retrying References: <20220624025309.1033400-1-ying.huang@intel.com> <20220624025309.1033400-5-ying.huang@intel.com> <87zghy7ua0.fsf@yhuang6-desk2.ccr.corp.intel.com> <22f7b831-7734-2969-a477-473c4367f61e@linux.alibaba.com> Date: Mon, 27 Jun 2022 12:23:39 +0800 In-Reply-To: <22f7b831-7734-2969-a477-473c4367f61e@linux.alibaba.com> (Baolin Wang's message of "Mon, 27 Jun 2022 11:59:50 +0800") Message-ID: <87r13a7n04.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656303956; a=rsa-sha256; cv=none; b=SHa9jVN6r1afZJB/qhu7tYXSdnxO2kAcrj5X/ZkDYnoifUUw+jmkYMfLtkKl+rbR3AC429 H0oxS3+V+0Z6vcv4dtYZvioP9geMLwRvRczcHOH//bK5qNCcayFBZeM+QTgauDyYmvsBB3 ITU1yFvDLZn8FEeBF9gfqt9wrSlfsbQ= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="TxnD/rNL"; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf11.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 134.134.136.100) smtp.mailfrom=ying.huang@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656303956; 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=WsRb48xbPAvQe4uoZ3eS1nrwsJ0vKWJVMh17W49Nz5Q=; b=l2tHFiAGTfA+HGywGSGBDgnyVelRYfpzTHGqo+tdVTfEuxpKv/djn9Enpu7/8wmroEu1dI j5O/PDD7cMM5PoUSkoNeWiFrCTorARUF4E0Qn5fxriF0aT06ar/gY+OLTiyGgPm15XeGVV 4Gn/G6PFfO+WGiLNpkd9rPEvNCy38SQ= X-Stat-Signature: 5dpuxudpif87bedk49aofwxupszt71d3 X-Rspamd-Queue-Id: EFC8540019 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="TxnD/rNL"; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf11.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 134.134.136.100) smtp.mailfrom=ying.huang@intel.com X-Rspamd-Server: rspam10 X-Rspam-User: X-HE-Tag: 1656303953-738483 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 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? I just think that it's unnecessary. We have already regarded the migration as failed. And for the worst case, we will try 512 * 10 = 5120 times in total. >> 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. I tend to keep both. [4/7] is just a fix. You patch will introduce the behavior change. And your patch needn't to be folded into this series. You can send it and push it separately. Best Regards, Huang, Ying >> >>> 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