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 6B1E9C38A2D for ; Fri, 21 Oct 2022 18:41:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C90048E0002; Fri, 21 Oct 2022 14:41:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C407F8E0001; Fri, 21 Oct 2022 14:41:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B2FDB8E0002; Fri, 21 Oct 2022 14:41:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2C99E8E0001 for ; Fri, 21 Oct 2022 14:41:56 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id ADC4614052F for ; Fri, 21 Oct 2022 18:41:55 +0000 (UTC) X-FDA: 80045825790.29.EE8CCFA Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf16.hostedemail.com (Postfix) with ESMTP id 318C9180036 for ; Fri, 21 Oct 2022 18:41:53 +0000 (UTC) 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 0FC63B82A7B; 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666377714; 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:dkim-signature; bh=Lv6O+A0BFH6tu8Dz3/CqE9fvIXubdNQwcOazSbAaIcQ=; b=L+wVvony19IzA2yJkMaBp9yfdOSVEIe796rq5JosG7lJhIdh1MvWWXIcN8Ul9C9XdKSSNz D5VxMnjgFiYIpJ/KRKUc4nfOP9T6T9HEyclemnjf5keubK1FCpqKnjkpWiXT14iB54vJEh f3U7uqH+Ha4vDctfDQOBVpkCs7rfacU= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=OBVBymlS; spf=pass (imf16.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666377714; a=rsa-sha256; cv=none; b=qzjxk5/HxUFIWpugUbRdwOQHmnnN7g++KUs88NHQupyefAwQzeKuD/sP687I2pOLn88yEz f7/BF/9BzjO827Qk9y4BxRnZgDeO6oaVjeXp+H1+1J73Q7g3TSgQSpj4OnQ2CPyj4LNFQ/ fXwQ03AuZrp8ADufd9BTeHk80GCCc20= X-Stat-Signature: bdsxp3d67z544ty8u7qmpueo5176up1t X-Rspam-User: Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=OBVBymlS; spf=pass (imf16.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 318C9180036 X-HE-Tag: 1666377713-114731 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 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?