Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3171895rwi; Fri, 21 Oct 2022 12:32:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6IQ1lddXJhl05u4yzabCK8dW5r7ZmLygkY0dG1ZesONWXTTZs4aFM7yCh+reKfoebOn093 X-Received: by 2002:a17:90b:3ec3:b0:20d:9da6:56c1 with SMTP id rm3-20020a17090b3ec300b0020d9da656c1mr24514537pjb.156.1666380742352; Fri, 21 Oct 2022 12:32:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666380742; cv=none; d=google.com; s=arc-20160816; b=PM2iZ2uMV4JsXgBEchxIWf71flQ1W19yhHCeKa/0WCf5D52Hm5eUmdnnQt8jdtgUZL PJPNWeD/wJ2vaNbzYMELeYY77wkiEYc1+9bfoxUnw+9ZiA0JZsR9dmnQNaIL+GgevQ1S 102+3Cie06aoxiMXJeGZQIABLEZaWm9eoeHFxztUey5zbknPRH2AIoaa124Tsk9utEM5 jWDB9x3QxsRRMtdek87cJOzJadNEohY7MzDzGReTT8RvvTB4jLtsbDro1zAs6YybG7QX URAznNla0dZP+vxuVqIkQNGa3iEDiBSLwMP+tFThFIaZcqqp+aIWxxvvZwhiCD8eYEDw eV5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Lv6O+A0BFH6tu8Dz3/CqE9fvIXubdNQwcOazSbAaIcQ=; b=v7DfISqZREWxKtOzi4vvV3Q9zX7ujERZpAcVpk/Oq3F/vw93ezGgKjYHSWPngojXxI Jv1JUY5DQ4Q5Ytk3BL6VP9BIuybpUnLt43ECT/uGF/75KWEVThgWXd8Yhk1I/z0KB2Si LAAia3ye25lA4pxKbCVekoFJRVKLESI8PasoXTZO8DgKrE4Pc8RDExqup0UJ8U400BQ3 VmWUT3FzFsgT2mjmWGetFbQHfWGP+wKQowJwOn8xUla0M/CnyZkhGvdmbdWnKabeM576 wW/E6afzlaCJvstYyWZv72yiyBZnhR7mqXWoyVwC4c7LjWJHLXfzVjf/8DEP/qLCOboo hhmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=OBVBymlS; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y4-20020a17090322c400b0018336dec9desi31501905plg.79.2022.10.21.12.32.10; Fri, 21 Oct 2022 12:32:22 -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; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=OBVBymlS; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230144AbiJUSl5 (ORCPT + 99 others); Fri, 21 Oct 2022 14:41:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229631AbiJUSly (ORCPT ); Fri, 21 Oct 2022 14:41:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 779E245F63 for ; Fri, 21 Oct 2022 11:41:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 300EFB82CFA for ; Fri, 21 Oct 2022 18:41:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89C3FC433D6; Fri, 21 Oct 2022 18:41:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1666377710; bh=J25tCoTUjk8qI2my3h483nRH1yTzPJQzaDGzvBeN80c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OBVBymlS2oWG8CfVh+LJmkN3AgV9mNG0yarvnTFyigm5t2K6PlJwLlit1Mv/S+Mat R+uzyc+ok0k6dd7xLQEDxL20LaTELZzTWgQGv34DxIIbpLRQsrIUBTJkEdv7J/Y+M3 cwujOZXPCou/gDWRgK/NrgJ1+FySv/Ckqf7z+sSo= Date: Fri, 21 Oct 2022 11:41:49 -0700 From: Andrew Morton To: Baolin Wang Cc: david@redhat.com, ying.huang@intel.com, ziy@nvidia.com, shy828301@gmail.com, apopple@nvidia.com, jingshan@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] mm: migrate: Fix return value if all subpages of THPs are migrated successfully Message-Id: <20221021114149.eadf6fafdd0b2c2409a46389@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 Fri, 21 Oct 2022 18:16:23 +0800 Baolin Wang wrote: > When THP migration, if THPs are split and all subpages are migrated successfully > , the migrate_pages() will still return the number of THP that were not migrated. > That will confuse the callers of migrate_pages(), for example, which will make > the longterm pinning failed though all pages are migrated successfully. > > Thus we should return 0 to indicate all pages are migrated in this case. > This had me puzzled for a while. I think this wording is clearer? : During THP migration, if THPs are not migrated but they are split and all : subpages are migrated successfully, migrate_pages() will still return the : number of THP pages that were not migrated. This will confuse the callers : of migrate_pages(). For example, the longterm pinning will failed though : all pages are migrated successfully. : : Thus we should return 0 to indicate that all pages are migrated in this : case. This is a fairly longstanding problem? No Fixes: we can identify? Did you consider the desirability of a -stable backport?