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 072ADC43334 for ; Mon, 27 Jun 2022 01:46:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3575A6B0071; Sun, 26 Jun 2022 21:46:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 307AC8E0002; Sun, 26 Jun 2022 21:46:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A7848E0001; Sun, 26 Jun 2022 21:46:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 07B9A6B0071 for ; Sun, 26 Jun 2022 21:46:40 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id A541C345DF for ; Mon, 27 Jun 2022 01:46:39 +0000 (UTC) X-FDA: 79622326518.02.E6F682D Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by imf04.hostedemail.com (Postfix) with ESMTP id 855AD40002 for ; Mon, 27 Jun 2022 01:46:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656294398; x=1687830398; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=25q2Ot9qhgZzcqFAUdp6LMnf76NSWxWGDc2QUqsYmo8=; b=SQzfil4hgB92mAxa7gqrYgGmPYSb82pvMJkMNVbmPyZrK/GWJqWNwrGX 3lW++gIP9TfyA0mA5yYqrEo4OwnaGlxDaNC7Xzq61UGXp/s3lXIyFeRll dTOuk4m/G4lSi0Gnk5qnQgly1uxXNf3anNjjRyTidRebB7MwffzyTGxLm Ys9VDBQJeI/cq2fVjyA5FrKWFPSrFZ61ThsbrGXqCGd8NE6mXFHxqiqsH DeyHBY4CXReY4NKkNViiEUSR8naSjFXNlmA0O3mAoJ3RRDSZ8tYDKpfGL WapNWdRFQzgJn3AWIs7tHiCqa7LNTx4fQO87yjtuFTQeSbfkLthRC2U0K Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10390"; a="306804197" X-IronPort-AV: E=Sophos;i="5.92,225,1650956400"; d="scan'208";a="306804197" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2022 18:46:36 -0700 X-IronPort-AV: E=Sophos;i="5.92,225,1650956400"; d="scan'208";a="835979159" 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 18:46:35 -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> Date: Mon, 27 Jun 2022 09:46:31 +0800 In-Reply-To: (Baolin Wang's message of "Fri, 24 Jun 2022 17:45:50 +0800") Message-ID: <87zghy7ua0.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=1656294399; a=rsa-sha256; cv=none; b=yaTj4O8zwSJJFHrnL0YV6NltJWKESL88KAIx31tSEgyaXGPszi3y/pFGhvRPupIZoGVqHb qnosQh5889KcnI3RT9kWMud91LO9YWKskdjb4sRk0ROWIptzswelBaIgfzxCGwuF6+BauB N99zK71AqbYFhrDRZ5ERF4QpEgx20Mg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656294399; 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=FvCwodZSl+oT8FXCD6RpwOTofsOk8cAdmf6Pj8wSVCI=; b=Sb64HI6OESVCpetzdMMH4NIxMbklJJ7ncjoK3fWaX38S+8tRRQoQPKfum8fRdUyg48Kx28 WxlD8Yu8RQUPi0XVz2NfqIsfXettwaVj5EciXdaM1wHCmnF1aCIBoZgNaD2kaxePlPrTjB Fhvng/bnCqxRchvyS43++B0L3e3YV1c= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=SQzfil4h; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf04.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 192.55.52.88) smtp.mailfrom=ying.huang@intel.com X-Stat-Signature: kjnbk4jwyt9ne87spitksp9tkfinupj7 X-Rspamd-Queue-Id: 855AD40002 Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=SQzfil4h; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf04.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 192.55.52.88) smtp.mailfrom=ying.huang@intel.com X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1656294398-109474 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/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. TBH, I think that we should do that. But because this has some behavior change, it's better to be done in a separate patch? Do you have interest to do that on top of this patchset? > 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