Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp863132pxf; Wed, 7 Apr 2021 13:34:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeU1qJpfsVYlD9WW3PwdirHHmeiZR1CgZALPGIDm/WA5RUYDk3U+i8tEJP3D8r/NLjmDUv X-Received: by 2002:a05:6402:1801:: with SMTP id g1mr1770480edy.206.1617827692907; Wed, 07 Apr 2021 13:34:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617827692; cv=none; d=google.com; s=arc-20160816; b=fs3CYcQTP6hVuPJNAHP+cAMrwBKWUPf8RROTztgpP0IrxXEvz816poMJqsf7NjmnQP pashNQNIyXRb357wJ/OtmNj2DMiHPeFhBPK/m9kaXxDb1ON2UwyHIQ7+zFfmnT5FjH3q Hec/PRJ5ZGFfydrJL6J7nf5r0dnON8kh9UhCBFVhrJQDWi1OyZqpQL1OpTrcYtVI5RmN g2VIGvSDGGZHsANkUPq+F5UzngIDhPMWpxU3pF3R9GzOjH9EXsgaMTI1CCxCCUkXcLbV XltsMMRP+Ms66Lzlr5ihFAEM7X2d1ctBYUl1ln0Cubsc9Ow+iR0OnDmVW6Om6Bop4fXy hxoQ== 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=HmBRJ+fn3/wu2pyixJWRxg5BPgdGr/LkCnsSkZGXpV4=; b=YkCNl3spoOCy1ONxCcab57vx0Tlw4uTsuwytOUVgHS0+Y6zn586r/H4MJhEM9GM4zJ H4IY+MnkuqOebnC9w7NXjAAUAdto1fhe5+TuuY7mwMifsLxNZrMsVzmj+Viy3lldQjM3 A4i97XisBHjs8lT4BDtmek7qGmpkRT7frJNvGmnlckvqEmkZbIpc2qkUwOZjREaswCDQ BAkXvL6eq1Nce4rS2CNkj4QmZtKUpVYEE+MBSzcSES/oH+RshKbeb+yBNd2Phz80PDTo cwK6bUHXEzt1WoZajq1c3aqYfzBSJPElXZ80ave4lPnBxLW1ngWYaIm2900gCw96yrng T8sg== 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 m7si21036598edq.562.2021.04.07.13.34.29; Wed, 07 Apr 2021 13:34:52 -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 S235595AbhDGI1q (ORCPT + 99 others); Wed, 7 Apr 2021 04:27:46 -0400 Received: from mx2.suse.de ([195.135.220.15]:48544 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234075AbhDGI1l (ORCPT ); Wed, 7 Apr 2021 04:27: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 DFD5DB040; Wed, 7 Apr 2021 08:27:30 +0000 (UTC) Date: Wed, 7 Apr 2021 09:27:28 +0100 From: Mel Gorman To: Huang Ying Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Peter Xu , Johannes Weiner , Vlastimil Babka , Matthew Wilcox , Will Deacon , Michel Lespinasse , Arjun Roy , "Kirill A. Shutemov" Subject: Re: [PATCH -V2] NUMA balancing: reduce TLB flush via delaying mapping on hint page fault Message-ID: <20210407082728.GA15768@suse.de> References: <20210402082717.3525316-1-ying.huang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20210402082717.3525316-1-ying.huang@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 02, 2021 at 04:27:17PM +0800, Huang Ying wrote: > With NUMA balancing, in hint page fault handler, the faulting page > will be migrated to the accessing node if necessary. During the > migration, TLB will be shot down on all CPUs that the process has run > on recently. Because in the hint page fault handler, the PTE will be > made accessible before the migration is tried. The overhead of TLB > shooting down can be high, so it's better to be avoided if possible. > In fact, if we delay mapping the page until migration, that can be > avoided. This is what this patch doing. > > > Thanks, I think this is ok for Andrew to pick up to see if anything bisects to this commit but it's a low risk. Reviewed-by: Mel Gorman More notes; This is not a universal win given that not all workloads exhibit the pattern where accesses occur in parallel threads between when a page is marked accessible and when it is migrated. The impact of the patch appears to be neutral for those workloads. For workloads that do exhibit the pattern, there is a small gain with a reduction in interrupts as advertised unlike v1 of the patch. Further tests are running to confirm the reduction is in TLB shootdown interrupts but I'm reasonably confident that will be the case. Gains are typically small and the load described in the changelog appears to be a best case scenario but a 1-5% gain in some other workloads is still an improvement. There is still the possibility that some workloads will unnecessarily stall as a result of the patch for slightly longer periods of time but that is a relatively low risk and will be difficult to detect. If I'm wrong, a bisection will find it. Andrew? -- Mel Gorman SUSE Labs