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 E039CC43334 for ; Mon, 27 Jun 2022 05:56:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7CE868E0001; Mon, 27 Jun 2022 01:56:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 77E7A6B0072; Mon, 27 Jun 2022 01:56:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 647BB8E0001; Mon, 27 Jun 2022 01:56:59 -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 56B656B0071 for ; Mon, 27 Jun 2022 01:56:59 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2993C20721 for ; Mon, 27 Jun 2022 05:56:59 +0000 (UTC) X-FDA: 79622957358.21.067BBC3 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by imf27.hostedemail.com (Postfix) with ESMTP id 0267A40032 for ; Mon, 27 Jun 2022 05:56:57 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R671e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VHTLmIl_1656309413; Received: from 30.97.48.150(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VHTLmIl_1656309413) by smtp.aliyun-inc.com; Mon, 27 Jun 2022 13:56:53 +0800 Message-ID: <7b98cabf-9a8f-2dcb-a410-9a8f9611ae88@linux.alibaba.com> Date: Mon, 27 Jun 2022 13:56:57 +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> <22f7b831-7734-2969-a477-473c4367f61e@linux.alibaba.com> <87r13a7n04.fsf@yhuang6-desk2.ccr.corp.intel.com> From: Baolin Wang In-Reply-To: <87r13a7n04.fsf@yhuang6-desk2.ccr.corp.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656309418; a=rsa-sha256; cv=none; b=HldEWxRsdWloQbkTVIvIry2IP1E4exuS2T0t/p+4ja55PVX1AnFbEkloEJTGdovI21WN+6 FjWjN0R/KnEh9hbdkJdZrmkx+UQlVZJqWf0ga1FrLd3fyjVHiPHU5VoKFVq5AL9PpWyrZJ C2+pgA2rT9VwxFBUAeNnr2P96JCx/qQ= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf27.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656309418; 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=/afPKS7hfAfFBZv9dtIxwCqNQZlWFbsoS6S3XLrqdmQ=; b=SgFdpdIl4n3/CuD92wyYGJbqaX9CRAJEBYuzUEgrgSxhbtzcsEY4I5NOQuazmnuPayer/X kxYZK6oUXpWQmKL4XgYOXGR0+ABQjx7ghciykIAPNukOjzdPZN7eVKckQFPIZDLC/CBOE6 TRM9Fhrrkoo0iZ4swGK3aMjvkwBIbzo= X-Rspam-User: X-Stat-Signature: rmuuoerujhubba94u7586u14k53f4cgb X-Rspamd-Queue-Id: 0267A40032 Authentication-Results: imf27.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf27.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com X-Rspamd-Server: rspam03 X-HE-Tag: 1656309417-329219 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 12:23 PM, Huang, Ying wrote: > 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. OK. Thanks.