Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1721224imn; Sun, 31 Jul 2022 19:38:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Nl97GNhV8042ciM3ACBkPIy3a4xdZgRjF7HQrlnUzD4VGP/RgJDayIbRkUNZ9PzeVf1ix X-Received: by 2002:a17:90a:1485:b0:1ec:788e:a053 with SMTP id k5-20020a17090a148500b001ec788ea053mr16369165pja.16.1659321536331; Sun, 31 Jul 2022 19:38:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659321536; cv=none; d=google.com; s=arc-20160816; b=VCm3CWahGIJ5guhl44Vh3qCtp2X4GDYNqY8V68dgnqu9gXxPRAYK6H5N+msx3v/8Ba KFQzHyxPAai8tsJONyeen8zLIJUlpimRWDHPdGqnRHIUoyJuoNpBhQivJniFoK2EeolD xCnyCs4i5cb5rl3Z+h8Xo4s5h5krR+IIWuomDi5/K/hpdccUPTerrGUHu3qZYpVwnnzz /Y3CH/CJp9zAcRbhK3Ent08xYVNkyfLmrm1RuAewOKz0DAup4UgdYcA5tvLCzK6SmE1L 2EaO1T/FWxLlRAEPL8xBhRtKNyvZV6B4ac3vETHS4oIdRnxUX1r6p/EBbZRi2ldEG39a KnhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=/f3/wAc/Lh5OKIv9YiPTMenQt/5WuXTmiolPCixw+jY=; b=ATCwtiyv7kDBBcnB8TRi4aHVhkXdDgNtpFqBx4j1U7NWzutiYyMF5liU1oysb7I43v nQ+NmFL84ADlglO07UIN4pn8wykfxZd0JkgRB/iKBhVx7zn/UU/L9mvfpYzTRX1Jhq9T MAnu7e2D8Tj7MlhmQiU6zzaJJ0+sGsER6fvyYyyjlLPrtc96leqWdGiiclgUxKIpFGO5 lJJIYyA/XxFeNqU+QXR6RHljI4d5JrNHoX4HIovgmdEAP/AgGVm/Eyy+lRNHIHVOTDC6 XQASbHWTX1HlWMeNYq9KqBrHkAG5W2h4SlhiVIXk+yMOl0omXTSW5nqFWaLOYT8OacJI Os4A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n12-20020a170902e54c00b0016bcc2046f4si13290235plf.207.2022.07.31.19.38.41; Sun, 31 Jul 2022 19:38:56 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239051AbiHACdj (ORCPT + 99 others); Sun, 31 Jul 2022 22:33:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238055AbiHACdi (ORCPT ); Sun, 31 Jul 2022 22:33:38 -0400 Received: from out30-56.freemail.mail.aliyun.com (out30-56.freemail.mail.aliyun.com [115.124.30.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1D7C11821 for ; Sun, 31 Jul 2022 19:33:36 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R371e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VL-EnUW_1659321212; Received: from 30.97.48.40(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VL-EnUW_1659321212) by smtp.aliyun-inc.com; Mon, 01 Aug 2022 10:33:33 +0800 Message-ID: <294083c1-2049-350c-52a8-5a39a7a7d229@linux.alibaba.com> Date: Mon, 1 Aug 2022 10:33:41 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] mm: migrate: Do not retry 10 times for the subpages of fail-to-migrate THP To: "Huang, Ying" Cc: akpm@linux-foundation.org, ziy@nvidia.com, shy828301@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1658405108-100658-1-git-send-email-baolin.wang@linux.alibaba.com> <875yjhoj7g.fsf@yhuang6-desk2.ccr.corp.intel.com> From: Baolin Wang In-Reply-To: <875yjhoj7g.fsf@yhuang6-desk2.ccr.corp.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL 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 7/28/2022 2:16 PM, Huang, Ying wrote: > Hi, Baolin, > > Baolin Wang writes: > >> If THP is failed to migrate due to -ENOSYS or -ENOMEM case, the THP will >> be split, and the subpages of fail-to-migrate THP will be tried to migrate >> again, so we should not account the retry counter in the second loop, since >> we already accounted 'nr_thp_failed' in the first loop. >> >> Moreover we also do not need retry 10 times for -EAGAIN case for the subpages >> of fail-to-migrate THP in the second loop, since we already regarded the >> THP as migration failure, and save some migration time (for the worst case, >> will try 512 * 10 times) according to previous discussion [1]. >> >> [1] https://lore.kernel.org/linux-mm/87r13a7n04.fsf@yhuang6-desk2.ccr.corp.intel.com/ >> >> Signed-off-by: Baolin Wang > > I have tested this patch, and it works as expected. > > Tested-by: "Huang, Ying" Thanks. > >> --- >> Note, this patch is based on the patch set [1] from Huang Ying. >> [1] https://lore.kernel.org/linux-mm/20220711084948.274787-1-ying.huang@intel.com/ > > Please this patch is based on my patchset that hasn't been merged. I > can add it as the last patch of my migrate_pages failure path fixing > patchset if you don't object. Sure, please fold it into your series. Thanks for helping.