Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp552325pxb; Wed, 18 Aug 2021 08:24:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylm82i0ZjBY3m0D4SrGjWTHIrO2GYiNdAoXSyM4PpPLWlHAwFpcXfwwFsgW0QMarNRRtRq X-Received: by 2002:a5d:8514:: with SMTP id q20mr7523168ion.103.1629300283821; Wed, 18 Aug 2021 08:24:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629300283; cv=none; d=google.com; s=arc-20160816; b=rB5smYc7163KTWowyB0JT/1iHFEnFkH2Rt6WqgI2q7hBcUg4ZEPpM/Alc5oQLFBTeY Ze5wWH3gKyEogZONh3iA1TuWJCM/J++OCtSsF1gR1hPZdmPDtwv7O7AdQSy6C5KXoVq6 0HxYdH42LS1ZLAdZqsrLQp9oiDAY9hyndfJx64us3QkSlH36c2IeY3cSlPmKjGrFgi8I /ioBXOCF6/1SfOczwbyxt5HjkKGLIFMMr0epQXE21rPiE5gxAOOe8HLe4gq5c8wzvkRY mPo2HySddTeIXfUvq8X4hYCO8HyFceMoNSfd2FtdZy+qidNjVyOYJYRVf268iMH8ZBmo lWHA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Sh1SraHVKaCYA/y70zjirB3iehLFCX2xZsdhvuOQh88=; b=go/cS2QPpAjUU+amcR10PUaaAob+XFd5P56KrzNSddx92yZwGkOUYY0W/qpa7clYaN lXOkCSU1JTuIhLGYSIxVTiX3Y8Vp00HDDZr3C3sPBSHCldwiocdG7k3QBvrq4t4NDfOM Gb4/LSO1oY0oyMWvCAMHJt31MIAi4xnws38jg660Zc2b6/THimPY7bQWl15uj4GIIb79 COnCe8oR0MKCuqlFzwbtDEakuzbWFUCiXmoroS2sg6s7WFt7mPdYtSu0fIZWmEiNvAka b8pJFXtUdNVK1Gb2ooqaIHewm/ZE66yJeG4E9zDap/hxU0ydXoC6KMwKt+gAupvyRXKp /ypA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=XkMCbtl+; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay7si1517285jab.98.2021.08.18.08.24.32; Wed, 18 Aug 2021 08:24:43 -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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=XkMCbtl+; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237871AbhHRPYB (ORCPT + 99 others); Wed, 18 Aug 2021 11:24:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239494AbhHRPXz (ORCPT ); Wed, 18 Aug 2021 11:23:55 -0400 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3211C0613CF for ; Wed, 18 Aug 2021 08:23:20 -0700 (PDT) Received: by mail-qk1-x72e.google.com with SMTP id t66so3488761qkb.0 for ; Wed, 18 Aug 2021 08:23:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Sh1SraHVKaCYA/y70zjirB3iehLFCX2xZsdhvuOQh88=; b=XkMCbtl+eZtb55uTMetMU9KUOhB+qRnNM3uZXlAmeZpddXY/wZoe7XofhB7B4YBokQ hhEjjVEdsH6mx04H5ujrwzMJ6HIj6pulZY6nEFceFaV0Br4kFhSfbqsltefjakyHov3F Pk2kGoGug/UenLupgEIV4BQuovuILRp8Tb5UNkgnx0b4hEMTetWtjgIHk4GSYZLmTvHR O8NW9kh6mj+qkJDHIGGK97Z+pYsHIZRLXcrzNpKtTwCYYSMTGBn1jeYWevdsk9E4duGS s1bjLw3cdagRos9fVdXF2EEyOhGFEGshTbqGvTxK//NRnHhUytk+U1EywV252QHDpdbK Pt2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Sh1SraHVKaCYA/y70zjirB3iehLFCX2xZsdhvuOQh88=; b=cYshuDG0uIqOGk7asqCdj83UDv5OyATZkPskNSDGYzUm4JgS2ht8AvsWLgTuF07G34 SR4al2mC7aY17v5EAj3kmw22ZDus9B6Cr39gacShj0BoTWKwEqOAMzvftUw3S/XPeUn5 JLLlikE6hOTwYoc1xh+nd8uiaPzbmC1JeNaHEIDXqghHbXrlusMT8b514ZkraijGkv3l rf5oXdSQV0daohoHVHIY7l3FxrHVlEckJRsmyCQsubSNiR+HbaPWjZxqUwUYqnBJ0ioe sIBlbUzNuEG8xVm1hHEzhVgY/gS4g8rQg4x2AUCsKT8CWOi4SdlNSB/m0k7YRkzixW7X wjtA== X-Gm-Message-State: AOAM530TFXpDCLn0m2r3hjkqJV9ftS87rZkw5MOPlVRuQ44EQs4ODpBs 5ZQiXtqXT/BzElIc0RE1sPInoqT8lsgN0A== X-Received: by 2002:a37:b4d:: with SMTP id 74mr8195759qkl.92.1629300199808; Wed, 18 Aug 2021 08:23:19 -0700 (PDT) Received: from localhost (cpe-98-15-154-102.hvc.res.rr.com. [98.15.154.102]) by smtp.gmail.com with ESMTPSA id v27sm42407qkj.129.2021.08.18.08.23.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 08:23:19 -0700 (PDT) From: Johannes Weiner To: Andrew Morton Cc: Rik van Riel , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: [PATCH] mm: vmscan: fix missing psi annotation for node_reclaim() Date: Wed, 18 Aug 2021 11:24:57 -0400 Message-Id: <20210818152457.35846-1-hannes@cmpxchg.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In a debugging session the other day, Rik noticed that node_reclaim() was missing memstall annotations. This means we'll miss pressure and lost productivity resulting from reclaim on an overloaded local NUMA node when vm.zone_reclaim_mode is enabled. There haven't been any reports, but that's likely because vm.zone_reclaim_mode hasn't been a commonly used feature recently, and the intersection between such setups and psi users is probably nil. Although, secondary memory such as CXL-connected DIMMS, persistent memory etc. and the page demotion patches that handle them (https://lore.kernel.org/lkml/20210401183216.443C4443@viggo.jf.intel.com/) could soon make this a more common codepath again. Reported-by: Rik van Riel Signed-off-by: Johannes Weiner --- mm/vmscan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/vmscan.c b/mm/vmscan.c index 701106e1829c..8ec4412c6116 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4424,11 +4424,13 @@ static int __node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned in .may_swap = 1, .reclaim_idx = gfp_zone(gfp_mask), }; + unsigned long pflags; trace_mm_vmscan_node_reclaim_begin(pgdat->node_id, order, sc.gfp_mask); cond_resched(); + psi_memstall_enter(&pflags); fs_reclaim_acquire(sc.gfp_mask); /* * We need to be able to allocate from the reserves for RECLAIM_UNMAP @@ -4453,6 +4455,7 @@ static int __node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned in current->flags &= ~PF_SWAPWRITE; memalloc_noreclaim_restore(noreclaim_flag); fs_reclaim_release(sc.gfp_mask); + psi_memstall_leave(&pflags); trace_mm_vmscan_node_reclaim_end(sc.nr_reclaimed); -- 2.32.0