Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp462035pxj; Tue, 18 May 2021 07:16:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEXCzWFMA8K2L7c69+17Caxdo2Ogsas0ydgikiyaxwuzzQOpEhU2HYXlXrYgWWuWA1wyN1 X-Received: by 2002:a5d:470d:: with SMTP id y13mr7323913wrq.203.1621347418153; Tue, 18 May 2021 07:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621347418; cv=none; d=google.com; s=arc-20160816; b=XONFt4xLWXT5YhBBnsAGA2v1l8xgtGQM/qgaajHUQ9blf80kjaZerIlz/H/iEa3Diw ftO2u03tS4t19i/KYWIJ7ImG8YMtsGkgmju0bqta9gdxfOZ+s02WhjB5St8n9WTa73Tb vtu79ELVT/ovmzfKBm6+GhXBXtmU3aVXBzFE3vme5iFFNxV0lDKXoKX1sUWug0Uv5F3Q 4Ss5dkEdRlfbw14HhqS4sgxi1/ZmVFVSKati0cIT68mElVDaYcid/k4HIIORH2O1l7Y0 imumt9RFTAOytnQc3RBIrrXal+r2PkJsTCb5zjENkTo7LcpSp3rcBqu46xLrxFug3xCj +o+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ZslTaHtCJ0vNDcjOvfrYGAz187fdvsPxMNMUfxSHLrc=; b=CBNpTeZ/uaTLmO6E8wSEuw/yhvSRu2F1TXBJoTRwjTiqwwuQLHBt4WCk/h3FWU53NI Lv3R15fSq09MPCCsXLA3I9smvmX8KTjyLgIysfYMUzjjd5+UMPeGyfkiCKatiNbXaoc4 4pXFDQwM45CdHlOJcNW6/TrOj3ka0ikjAMmyHwmh4Uei1Mb7kvCXvc6uCqFK/MOm8I6h wadQPzkXGAuBjeaW8IuYm28bNZ0SMz/yzYauFhkeBb77sNECJMxCoR5rtDqvtaE6acoD QR+FpcECpfzdQFbVl8nQvtXzvBv0/LPsFUeFIVMaFenhpjRZyUJnxEZz6IbSgOzK26pE 52sQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si1086426ejc.422.2021.05.18.07.16.35; Tue, 18 May 2021 07:16:58 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344341AbhEQPoW (ORCPT + 99 others); Mon, 17 May 2021 11:44:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:41048 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244839AbhEQP2l (ORCPT ); Mon, 17 May 2021 11:28:41 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 8F64FB038; Mon, 17 May 2021 15:27:23 +0000 (UTC) Date: Mon, 17 May 2021 16:27:21 +0100 From: Mel Gorman To: Yang Shi Cc: kirill.shutemov@linux.intel.com, ziy@nvidia.com, mhocko@suse.com, ying.huang@intel.com, hughd@google.com, gerald.schaefer@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, borntraeger@de.ibm.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [v2 PATCH 3/7] mm: thp: refactor NUMA fault handling Message-ID: <20210517152721.GW3672@suse.de> References: <20210413212416.3273-1-shy828301@gmail.com> <20210413212416.3273-4-shy828301@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20210413212416.3273-4-shy828301@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- Mel Gorman SUSE Labs