Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp994211pxj; Tue, 18 May 2021 19:16:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwENr5PTpxl0ozdf9f7T7Na9ZMaG+o6YVUnqoWk4xOaw2PHt92JJY4ZNGEOKHgcRvB1b0hE X-Received: by 2002:a17:906:a3c9:: with SMTP id ca9mr9413707ejb.553.1621390589097; Tue, 18 May 2021 19:16:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621390589; cv=none; d=google.com; s=arc-20160816; b=nfKD0DpSN6Y3TrumPPlYkJoDQfSNzP0Jz711SmQZlJnkLuKuRvTSMBaDnhxBvq9R9J w9CmPGGxl0mQ+Ssy0AaYenlei2giE5ozycTvbwbToNPCjuigfM0owmgiEBDiHLMCxovs 3xpKuTZoHUTDky1CKaxryMj2Y2ygewRaquHGor+EWI333G4PaBo/xY6WJieyQHDWnrWy hLf2MUfNcMljOUs0o4gHB0QuwZthgeCJ8ndCAmUs8bAsXon6ty5IF+MP87rf3WEvJZe9 0yr9I00vEk5DVKsOFez7meFZkDsnfjLDl/IMLaB7tVELPg0WWwBq78uTBLrQ5pZ6RaDU k5IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=yXa/Lm0suCl/5c57+vWfzuJ0nIP5bhlu8lJSFWkdrv8=; b=oGaEei8lGjdyw/2l062e4MCIUR3McjW/6dKwkYvNvSCt428iXbv05/OPsMAy6rbNhP KxjkQMz3LfXv5OMPwBNct330mMb8seqQ8v1m5P3fCEKFzjxVE1UgLB9qwrp+cVB83xn3 e04NYduEDB/ZF2qGrcXxkhkPntONWs4I1gr2ceuinqlt1cRt8uxPIshbUJuu49qkgMq3 52XKpqJqgg608l98JZI/I/dWFBp6cGOiu/hhBshxrmwSC6Jd99UwKMYp1TbOFaOQvGgP qk+vGv8xTI4diWGUF7LqpwIlUe6uyX+G/eLzj24tLjoYsJfXe+xDxzzesULPU6lRv8zR R1AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WSduR54C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du20si287248ejc.324.2021.05.18.19.15.45; Tue, 18 May 2021 19:16:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WSduR54C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234925AbhEQTml (ORCPT + 99 others); Mon, 17 May 2021 15:42:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234820AbhEQTml (ORCPT ); Mon, 17 May 2021 15:42:41 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 552CFC061573; Mon, 17 May 2021 12:41:24 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id s22so10716425ejv.12; Mon, 17 May 2021 12:41:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yXa/Lm0suCl/5c57+vWfzuJ0nIP5bhlu8lJSFWkdrv8=; b=WSduR54CQpT0eAZStLjK9HbqVDBbUEgAkAjcMlUQCnXWK9SG3yY3qCeDbctPh0+XkC rNBCqo5BT/Zk63QGr7nIM3iPsiWMsvqy112Yf/cwtEJwmDY0ipOlxYC1xDX4xfvPNDBZ Vdz12P2rUSZiixxROKQZ8OHYprGu32tcE1nwZ6qwiRUo7+wNzZkBRLcjoz18STfK+wZB a21zgdq3fEJdrMCBlsdUVdOTc7I+uvwAk+KwXbKtQy4MtRcTHIYN2aKPn8vKDQTh6f/T Iuv1ZFYMl6tzXEUt0LS51E3qkpNEBj4BsL11Rway1HWQ/t9UueOsz84zOowmBXTW7AHB ACkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yXa/Lm0suCl/5c57+vWfzuJ0nIP5bhlu8lJSFWkdrv8=; b=O2neYKxQyMmPJ/S0L9C8Q0t9PTY4KndnpUE60p9EU4HIZ7T2NQtZZqoLDWR2rhm1NH FQzyv6IWK/Y7iCD1xmugEWR0yCemoHtwMVeAJfYUEvl8Cfgor3SMO8mk74H7md1F6b5g wXQhLLT3s4GjWXHERXjN4CrcWvTLZNbkCKjskls/l9eicU69sqGvstvO6GT66ekjiflA cPvveBCD9CanTJtP5rp+1pZeJdehzPYli8SWd/yXSRhezWNX33qmgD3+0T6ZWkBGSplp XE8wm9ZooOIJfBslXzJwDV18nq3ic/X9Ddg0UbnNAtrjZaIwk/oqBOgMiZ707iR4zJsT CoFA== X-Gm-Message-State: AOAM532NzhhbuFO9McbO5IFU2+nTDjHoC4cZ8bDl67h5DBgP/+u+Mayc Vgf4y5lw4QcrY+q88mw+Bl0GnGg+Afm0ZdUjTxE= X-Received: by 2002:a17:906:11c8:: with SMTP id o8mr1548021eja.499.1621280483076; Mon, 17 May 2021 12:41:23 -0700 (PDT) MIME-Version: 1.0 References: <20210413212416.3273-1-shy828301@gmail.com> <20210413212416.3273-4-shy828301@gmail.com> <20210517152721.GW3672@suse.de> In-Reply-To: <20210517152721.GW3672@suse.de> From: Yang Shi Date: Mon, 17 May 2021 12:41:11 -0700 Message-ID: Subject: Re: [v2 PATCH 3/7] mm: thp: refactor NUMA fault handling To: Mel Gorman Cc: "Kirill A. Shutemov" , Zi Yan , Michal Hocko , Huang Ying , Hugh Dickins , Gerald Schaefer , hca@linux.ibm.com, gor@linux.ibm.com, borntraeger@de.ibm.com, Andrew Morton , Linux MM , linux-s390@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 17, 2021 at 8:27 AM Mel Gorman wrote: > > On Tue, Apr 13, 2021 at 02:24:12PM -0700, Yang Shi wrote: > > When the THP NUMA fault support was added THP migration was not supported yet. > > So the ad hoc THP migration was implemented in NUMA fault handling. Since v4.14 > > THP migration has been supported so it doesn't make too much sense to still keep > > another THP migration implementation rather than using the generic migration > > code. > > > > This patch reworked the NUMA fault handling to use generic migration implementation > > to migrate misplaced page. There is no functional change. > > > > After the refactor the flow of NUMA fault handling looks just like its > > PTE counterpart: > > Acquire ptl > > Prepare for migration (elevate page refcount) > > Release ptl > > Isolate page from lru and elevate page refcount > > Migrate the misplaced THP > > > > If migration is failed just restore the old normal PMD. > > > > In the old code anon_vma lock was needed to serialize THP migration > > against THP split, but since then the THP code has been reworked a lot, > > it seems anon_vma lock is not required anymore to avoid the race. > > > > The page refcount elevation when holding ptl should prevent from THP > > split. > > > > Use migrate_misplaced_page() for both base page and THP NUMA hinting > > fault and remove all the dead and duplicate code. > > > > Signed-off-by: Yang Shi > > I did not spot any big problems and FWIW, the series overall passed a > series of tests that exercise NUMA balancing migrations so... > > Acked-by: Mel Gorman Thanks a lot for testing and reviewing the series. > > -- > Mel Gorman > SUSE Labs