From patchwork Wed Aug 18 15:24:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Weiner X-Patchwork-Id: 12444755 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B39E2C4338F for ; Wed, 18 Aug 2021 15:23:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2A47261076 for ; Wed, 18 Aug 2021 15:23:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2A47261076 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 99FF78D0001; Wed, 18 Aug 2021 11:23:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 94FCB6B0072; Wed, 18 Aug 2021 11:23:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 817868D0001; Wed, 18 Aug 2021 11:23:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0008.hostedemail.com [216.40.44.8]) by kanga.kvack.org (Postfix) with ESMTP id 65A236B006C for ; Wed, 18 Aug 2021 11:23:21 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 12D5B1801B60A for ; Wed, 18 Aug 2021 15:23:21 +0000 (UTC) X-FDA: 78488570202.06.297C92C Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) by imf23.hostedemail.com (Postfix) with ESMTP id 9B7DD9002538 for ; Wed, 18 Aug 2021 15:23:20 +0000 (UTC) Received: by mail-qk1-f180.google.com with SMTP id n11so3445607qkk.1 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=ojRsP1aSKtPMAep6vM1ETmsXZgKoRgAK9jZC5R69O3gCDyNypy2tOkClvxccGGRmQ4 gqNNVoHOS2hEEDZvh6QtSnusnC4nVMA1o1TPXDUMrYVzCLFGSXtK11DaH4+A2za9CPaa fjb1CAKHZP/BYwgw6LPTjUs2fjLai11Bu1XJUjxS7G56csoOHd04JH4S4lQfBovtX5KF rFL2qa9Aay1NeSK5ufuLmPjYseinSaLehRsGTcKYZPtRXOVH0UreLz9R3zR7dlD9u6O2 0qcZrfm3rJkMM4JepwTdKz+ZRBSRguOcy10lejGTSu/txf3jQt74QbH/h4y6h6uShmXz C6fg== X-Gm-Message-State: AOAM530/4qqHKV2D4zJLB49iYwsw7Lv2kf7/Ly8y0XMyb6el63C7rUXp 5GbR6oof9S/obhbDRM51wOJ+eg== X-Google-Smtp-Source: ABdhPJxVogDZb0BxpUKcYfpDQa7/1wYIvo2KElxVcSRIGrKNLK7arzO2wONNyCE3QM/KXusnIvwWEw== 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 X-Rspamd-Queue-Id: 9B7DD9002538 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=XkMCbtl+; spf=pass (imf23.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.222.180 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org X-Rspamd-Server: rspam01 X-Stat-Signature: tot4e16ismmxsgnzxiforodzhbfznrbg X-HE-Tag: 1629300200-790451 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: 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 Reviewed-by: Shakeel Butt --- 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);