From patchwork Fri Oct 20 08:43:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huan Yang X-Patchwork-Id: 13430267 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 244F6CDB474 for ; Fri, 20 Oct 2023 08:44:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A48D48D01C3; Fri, 20 Oct 2023 04:44:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D0D68D0003; Fri, 20 Oct 2023 04:44:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 824F18D01C3; Fri, 20 Oct 2023 04:44:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 6C4618D0003 for ; Fri, 20 Oct 2023 04:44:47 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 38792C06CE for ; Fri, 20 Oct 2023 08:44:47 +0000 (UTC) X-FDA: 81365204214.11.8B34D0D Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2128.outbound.protection.outlook.com [40.107.255.128]) by imf05.hostedemail.com (Postfix) with ESMTP id 56586100003 for ; Fri, 20 Oct 2023 08:44:44 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=ILrDihYv; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf05.hostedemail.com: domain of link@vivo.com designates 40.107.255.128 as permitted sender) smtp.mailfrom=link@vivo.com; dmarc=pass (policy=quarantine) header.from=vivo.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697791484; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=kV0FZyonkpUObozelfwSHTvjYkN2DZEjW6NLwLMed00=; b=Sbg6rl0VUtieuA+OCJctVjUNTpKEpmCVK3D6BUj+8kYsiVZHB4bc/QS7lM6zWgLpuVIkpg inOL1cNfaZD32sYDq0h8ghMRCcw+mCY4n2gsDDNs/AwjSfymLqW2gUYo0/2/hrhXq3SWsk Gag0z7b/N/JKhPZVXq0Fn6ETtFy/tn4= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1697791484; a=rsa-sha256; cv=pass; b=dhg38KFvdP8nJrTY+R7D/tI8FxwJ9Xa+cNHkXh809ox7A4AY9tx0gfGep7dNUlhcyVkBP1 j3kaNOQiWFAPmcxrdIn7xFs4OnwKM1dlwHhzNuDzi4YRfZcPoheMTbcl8kXzd5zXIpzuGN lvFXu4t8UoDtMp3a0GnjqV9OY24SkEQ= ARC-Authentication-Results: i=2; imf05.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=ILrDihYv; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf05.hostedemail.com: domain of link@vivo.com designates 40.107.255.128 as permitted sender) smtp.mailfrom=link@vivo.com; dmarc=pass (policy=quarantine) header.from=vivo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L/CTrKqSGvW6lQwVxBqgo518If8xzHVv6ru3brRr4ATBHefQtXPBo+Ad0L0T3FsSPvmL2F7p4NUVYAW8CiaJXeO9DfslWUTX/YCL1ORoy8wxX9SJ/R5t7H+CZyG2sMEvT8calINGwSX60twfFLf3ce+uFEwUFlayfq+PKeTsDiScQNXpytzrNMYTmtlAIYFxddNR7R8iazmPEEeXM7+ZRU07FC/bBblrmcKZLDkIbsXcIxbbxb9roetO3eAJa0ANpYVRMToWMAsRYm/YxhHvABKYUv3SNWnuzNQbRZDXJ3aktXuwcNiWpxpVlHbRGkq+nKgV6JHQBi66vRUh8cuhcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kV0FZyonkpUObozelfwSHTvjYkN2DZEjW6NLwLMed00=; b=NuKL65UpG5WXf4CLRJYDqrjGVE3oHZuCUXzpEfP6j5XOi7dOalY5AgitAz9sfwuft8GgkvWv3I7yn2tekWe+0FghjwTDB+NEc13UUy/YhvVp04F2Pf4PDGO50P4/suXv87StycKz73pbUrG81N8LVPDTmW+064Ti0OBBEnWqRdERXGG6nfuVAJpTFwUnBeiME7mWKAKPjWHbUIFYbPm2/6eie5bXn9AWMSW79OhTGdN8oSo3ejof+z6WPpQD43IIMib3GO1nXevA6qlNUB1P05WtRp2+fl3kuqLQ2vuVVRYw26iQCSNqU87nt57em0B2bQo2gaAnnoGmWxLneIpQ8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kV0FZyonkpUObozelfwSHTvjYkN2DZEjW6NLwLMed00=; b=ILrDihYvV3VWkB7fpEUZAGXGYvQreSoyLkieVetinb01q4MpsI+iwYWy49noj1+Yf2OCS4NWTHd5ZJo92SD2mK9rjlTpsOu2ZnJhac2khujsXbTc1OL31FvfVgOIY1PyHIvYmSM2jR3MaSHL2wKMe6ZtQ0jUGb/kYlO113xe2jouj8elDBmg+Dwq4mOux1tfGKwJTsTNSAVPS+rsVMqUWVny6R+VmZrmq/d4LjG5+6ZUAbwB58GdR6Xy0xHHltcu7UZ1cJh6inErCev8a8LjR6BUJzsXW/mIaTACd72ZxHo+E2cFCaBEoZT77AuAKyDkx4B6iD+Q+VFx1Bl0r8Du/w== Received: from PUZPR06MB5676.apcprd06.prod.outlook.com (2603:1096:301:f8::10) by KL1PR06MB6553.apcprd06.prod.outlook.com (2603:1096:820:f1::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.24; Fri, 20 Oct 2023 08:44:28 +0000 Received: from PUZPR06MB5676.apcprd06.prod.outlook.com ([fe80::40ac:5701:4617:f503]) by PUZPR06MB5676.apcprd06.prod.outlook.com ([fe80::40ac:5701:4617:f503%4]) with mapi id 15.20.6907.025; Fri, 20 Oct 2023 08:44:28 +0000 From: Huan Yang To: Yu Zhao , Steven Rostedt , Masami Hiramatsu , Andrew Morton , Huan Yang , Suren Baghdasaryan , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org Cc: opensource.kernel@vivo.com Subject: [PATCH 0/2] check MGLRU promoted without hold page lock Date: Fri, 20 Oct 2023 16:43:49 +0800 Message-Id: <20231020084358.463846-1-link@vivo.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SG2PR04CA0198.apcprd04.prod.outlook.com (2603:1096:4:14::36) To PUZPR06MB5676.apcprd06.prod.outlook.com (2603:1096:301:f8::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PUZPR06MB5676:EE_|KL1PR06MB6553:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f7eeff4-8763-4b46-ac5c-08dbd148c55a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i/ST7Ofe3xqlhataChgMtooHHbbjdKgETjOenlC7GR0w6ODjri0Yk+vwWUYWO1DqAekXqowGcq3O+0Ar5xknO1h4eiQQIWoczTy51jmURILN5Jk0CYsmFlk2h31obxnWm3tp0qghA5qGERqMJtAiePrGyS0kQLTW5SEmiFDjdL7EeRExz1QYKbE+2zpKC0iTNpVkb2zBZ8WvnliN2PT41WcEqwCc7TSxkuT0qjba6EqTGa0qm/sKSfj0AO3muP310j1tSyDhEsO6GERAQCZCgoFp5YWk982Cpy08yYkBASxBxEQUAKSS3rplsqs3nf/UsiFRMyBLHjDJ3VBzM/mh3wpvu45GmNFK45tGJYnZkn5gmoydcIBfDhyP5zOYdcPin8NwRkyhm0UjR8AjxHOEw06PAIC918IciSy+PKAr+ZUoBVBovn/dVkkIRL9yrIN9q4aUE2BcnDdaNnJ9S1s1WUTR1RBThJ0ISTDn9oA65uJA95vcoyh45IGoeZ1Dyj41IOEHPC/IgsRNbF+FTdDaOITqU6cAcjlx0BU1SctO+IQSwxIXY9n8mzW6Rga5mgitdvxDivoKAf3G+TvOlhGTkpiW78VF4c0PUXMTQvb8NfspwAHkGy4Rb1vcrX0RKonF X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR06MB5676.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(396003)(346002)(376002)(136003)(366004)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(36756003)(38350700005)(6512007)(83380400001)(110136005)(66476007)(66556008)(38100700002)(86362001)(52116002)(2906002)(26005)(107886003)(2616005)(1076003)(6506007)(6666004)(4326008)(478600001)(6486002)(66946007)(41300700001)(316002)(8936002)(966005)(8676002)(4744005)(921008)(5660300002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: q/ESa6DFKnm0YvwGnxW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Bqo2XfoKFvE9dpdFgo3wSS0GI4Pgu6MtbUWkuUn0WkPbry2I8imz6Aqqgk6EZb1nghvmYquAhVmopwuhwMXrZV1EKkeTy7PIx9IziR7TVyoiBC7bOAdrRqM8HWBxMkzNlukoeV5kD22ajAsC+2U8m7mf+6Liv691iEcGjybACWFCtEj4HsCOPoRkE+nf7DLFeVZgYTyToTtet0N+uF3krzZUGNs5gBrUI0hQfoMHTlypUeer8QoYMwayssr5rlnyb/57zSYrjtTEQDojkY+EQ8qiwNkscHcTqzKkY+OciH/ewWRzR4NSTmprqr0ZFbe5C5vBKqGmAFaJPfGRQ1FDvN/GIqbhtUEbUfulUZ/tHlkqE1WQZNAhJonuMcF3cE/pSGPnycBfJokjRh9qzNtUhM1ZaVQjzESptGWa5jCsiSQGNhqBg6altbwzzLSU7oLGWl6fYoUS6dDg3Mh7W4e3kAz18rhKC3a6uKorM36aT X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f7eeff4-8763-4b46-ac5c-08dbd148c55a X-MS-Exchange-CrossTenant-AuthSource: PUZPR06MB5676.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2023 08:44:28.4511 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: T1sUSvzgUg+RrxhnRoC97YZwD167LJ3mQGBnomr4voYH0NDLe7qv/gS7xyxv2ei5UklfKI9lr2/Hqw868HHEMQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB6553 X-Stat-Signature: ad49tic6a3mresnsjwgkaey5nzsefybd X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 56586100003 X-Rspam-User: X-HE-Tag: 1697791484-997889 X-HE-Meta: U2Fsd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98ws+x2uhb102SnDfbYUIJ/NfQruxi7SIU3xmbFADNTZ9Re6YzzACUOAeMlXXeFrWgHugKcfwVJ803ule2skvjUr0WaYAfi3UNCrRf+AYJzaSwRqtzl564ciird6eVK1nfV4o5rPjXL5lZiPyiiTncsVI465beH/rLcAcSS1UOuzzlaeVaqT9ES8DKSUS60XvV+fC7AoGLaeGI34uvVSg566fcpOaQQ58NAzhQp3EQiySzhMql6NKKR4faRM6ctpjdRWOzOIMc4SPJNn9nFUvuoxNyMmeAn8IXQkrdSoXFwEvEIlLJslk65hbsK1Lc= X-Bogosity: Ham, tests=bogofilter, spamicity=0.406618, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This patchset add a new reclaim_stat named nr_promote to observe number folios which MGLRU promoted before shrink touch, and then show in mm_vmscan_lru_shrink_inactive. Also, fix nr_scanned in MGLRU trace into nr_taken. (patch1) Base this trace, here are many folio promoted before shrink touch, so, due to the high frequence, move this check before hold page lock is better.(patch2) Due to we will not actually touch this folio, nr_promote trace is unnecessary, remove this trace. This patchset based on link: https://lore.kernel.org/all/20231018082104.3918770-1-link@vivo.com/ Which have many mistake pointed by Yu Zhao.(thanks) Huan Yang (2): tracing: mm: multigen-lru: fix mglru trace mm: multi-gen LRU: move promoted folio out of lock include/trace/events/vmscan.h | 3 ++- mm/vmscan.c | 31 ++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 10 deletions(-)