From patchwork Wed May 26 17:46:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Brennan X-Patchwork-Id: 12282479 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,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, 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 8C792C47082 for ; Wed, 26 May 2021 17:46:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 15B5461378 for ; Wed, 26 May 2021 17:46:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15B5461378 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 98E056B006C; Wed, 26 May 2021 13:46:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 940016B006E; Wed, 26 May 2021 13:46:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 743376B0070; Wed, 26 May 2021 13:46:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0236.hostedemail.com [216.40.44.236]) by kanga.kvack.org (Postfix) with ESMTP id 3DF596B006C for ; Wed, 26 May 2021 13:46:42 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id D426E181AF5C4 for ; Wed, 26 May 2021 17:46:41 +0000 (UTC) X-FDA: 78184112202.35.7A95F83 Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) by imf13.hostedemail.com (Postfix) with ESMTP id 19551E000108 for ; Wed, 26 May 2021 17:46:33 +0000 (UTC) Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 14QHdW01192796; Wed, 26 May 2021 17:46:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=ypxbACqBKO4kjDdcmnuVpe1wdi1Hk4qEKyGkYCtZ0Dk=; b=QpOUm1vfJ9Ma7iBY6WTlIF78JPnCyKZu1RhhXF2jnGxcG9W2gpFiVre9rmkO9EydQqbR BjHPhyhePvio+/qEFSKpbDDkMtLS9aSf9xLr4maq7RPsfGj5JkzYnne05oVofUAncdiH vsBwdtgWWmxcq1h7rtPl09u3xtFWf2lzHOSeeUVuANZ/z8kHzv2j8SeeOvCr+YPuLibr FqlNKAjVIIcWZfbqp3A/iWkgQ9BD5kIrPL8FOjJi0VUhF7ULPhFHb20VN0OESPV3MedB 45SEnUNZ3Q15O3qYqI3/mF0gawIp9Dn1wNywu1PBWYq9rRUjGztZ8bnFb2ZBvs46lP1B Yw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2130.oracle.com with ESMTP id 38pqfchynp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 May 2021 17:46:35 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 14QHjRms193973; Wed, 26 May 2021 17:46:34 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2176.outbound.protection.outlook.com [104.47.59.176]) by userp3030.oracle.com with ESMTP id 38pq2vh9fq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 May 2021 17:46:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pp1TenB3dCVuhjOxvz6rkzufmMQ9TdU96+Sq8SRqxWsAsegZIdMEjbRujvyCE3DrUlDr6ylH17WpRZaS0XgFlCcqX+0NZ4xfInhYJZ5U77rKMalICWbpIlgZX4/kpQN6XUVNLMLKC0lfoYASB2KaAiz1XX1cPpP6KIxVbMHLQI3DAjEvAcx885K1a1XfCDXTsOHCVFo8SpwA0lL4Ue+n6f39dvX2PQwfeuONGHbFNdZuliOETD3iy/qr4J5TWtaBdUhA27iXFQHLmPwcxW4nFTpAA/hk6p+jzGYrf/1gUgqKr20HNGtcSM92+K5WEkBNKePBHzhTZ9bWCRd+k4595A== 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-SenderADCheck; bh=ypxbACqBKO4kjDdcmnuVpe1wdi1Hk4qEKyGkYCtZ0Dk=; b=ESstPH4ZlowIK7ofLXVUzc3ZR26V1oVnMEoYW3vTWn0zOkAATXEvvL3j8SODE6vDAwQBrEvbnQgx1sfIYQhvdzm5dDC8uLabKQE7IdoquTgPq3t/PkeU1iOrn10k16UwhmpwcOF7M2K+1B6MOweKrNjcGFznIsW7uVZMoDQgbbFkVigNWragP+TWxAWVpecuJ+p5TKN37Puf4mxCXUmSg8jnphlRhtoEmLKQIcZrwQy/+QnXIa0z6vzPOLt7dMR0aaTM8cZMXcs5MwEmJ1DAlxCeXEwW7aTlr07JHAk9ZV/iesaYu2rnG8iVfdfOMW8NrVab/9bLGBrCG0L0DDMzkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ypxbACqBKO4kjDdcmnuVpe1wdi1Hk4qEKyGkYCtZ0Dk=; b=Uuk0kT5EQoFxdPYevxVLsBVx4pklAd1XtNZcyqEUhcJpjG6Gi6+RC7CW2KNZat+ykC/xu4CgRLwEBW4cB+m5+NIFJz5BSuunq/MWtxXwLHYeBhUjaShfBpU50LxqfeXGcVVqhoPn/KtSAW7fhXT71wUxQ85MTGbYxHBfhnkG6yM= Received: from BYAPR10MB2823.namprd10.prod.outlook.com (2603:10b6:a03:87::15) by BY5PR10MB3969.namprd10.prod.outlook.com (2603:10b6:a03:1f8::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.26; Wed, 26 May 2021 17:46:32 +0000 Received: from BYAPR10MB2823.namprd10.prod.outlook.com ([fe80::5cc8:7154:975d:b2a2]) by BYAPR10MB2823.namprd10.prod.outlook.com ([fe80::5cc8:7154:975d:b2a2%3]) with mapi id 15.20.4150.027; Wed, 26 May 2021 17:46:32 +0000 From: Stephen Brennan To: stable@vger.kernel.org Cc: Stephen Brennan , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Lameter , Mel Gorman , Andy Whitcroft , Aruna Ramakrishna , Khalid Aziz Subject: [PATCH STABLE 4.4-5.3] mm, vmstat: drop zone->lock in /proc/pagetypeinfo Date: Wed, 26 May 2021 10:46:13 -0700 Message-Id: <20210526174613.339990-1-stephen.s.brennan@oracle.com> X-Mailer: git-send-email 2.27.0 X-Originating-IP: [2606:b400:8301:1041::11] X-ClientProxiedBy: SN4PR0501CA0055.namprd05.prod.outlook.com (2603:10b6:803:41::32) To BYAPR10MB2823.namprd10.prod.outlook.com (2603:10b6:a03:87::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost (2606:b400:8301:1041::11) by SN4PR0501CA0055.namprd05.prod.outlook.com (2603:10b6:803:41::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.12 via Frontend Transport; Wed, 26 May 2021 17:46:32 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 131cba72-5e53-4738-a2a2-08d9206e32e4 X-MS-TrafficTypeDiagnostic: BY5PR10MB3969: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2958; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zXl5wZisIecc/k/OJRsXLRt+6yAPp6hUb/FQYPnweF3YL3HO5RqC66GtdzuXbqLeUCBa+YhVH9b24Z43ACUUyGLLbJ53AqKzCN9xT3ugvn11Fba5hQIIPL1Pl17fzzpMV+XhqzAjl6ikCkWzQbRzYP5Bp8Vj7SQy4riUPYIraYMl5HWBDzr5LEnYrzpuRYVzEo2WZsZwUfkwO3gd2FCH3VjyQcBQ9rdAJgi5gXXHgN9xg8gMrwwYQpk48QNpo7nRBx+AUT39oDjfy6OuFODgRNiDKJ4BIfwGS2UgV/2qafFadUeg9d5Q2P3BFyovfBP2RoLxuZx1LslcOcT6JRYtZ4zr4WOnW8VVgUHsV47yhNtOhp/dvfhCDoowF+wCVeDJUSmGDJjxNqGKn7UXjZ0esG1DTl+uY7Uz8Fo1YtjN1nvgpcMmDhV98KJ2AxmNN7kwIMLPcz/6KiRlmDQme0DmoPcX5MAM+YMIo+lOp0zAXK7MWUFcxGMswOXC4qTFJmC1a6sYO/d9KHq4WLqHjlxnXpNkFF1dVSfqqCBsaAm7/aQIIstP2hHGbsxYrCA0oN5a5qYWB55/bW4Nr5nDVz1GwBqzX+154g/GZ6CFqICMNlpe7JC7enM7L3ktDFdFfdlNzuXchcAGlSCsW0hhHZ7HcNgvpHCf6/PfhZHYoJkpvaepl1nVU8kDEyQjEvHSP2TnEOCyPlsl5/phQYtQM8KcoHkIHqhQZSaWOnzi//w7bSALShJJBjyUh118yKzK47PrZ7DxQSnlDEn8SBrnWUFNIH0ODxLuKTI3o0DqsGv5RF2XES/HAmdI4lrdGE3+mSkNGkSydZHjqZpmh8x+NT7SBvKa/ngfiVP9boGsxPkLoTDXTTLKqCK6imt5haaOaqU46FpaGnWLn1z4zjJ/y4SVnA/VggArtwBAhIX1LGtIK70ObH56q9jBKoLZzJm/4wi7IqGQmCxz7kyOT7pNu61YYQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:5;SRV:;IPV:NLI;SFV:SPM;H:BYAPR10MB2823.namprd10.prod.outlook.com;PTR:;CAT:OSPM;SFS:(136003)(396003)(366004)(346002)(39860400002)(376002)(478600001)(107886003)(83380400001)(6666004)(6916009)(6496006)(4326008)(6486002)(66476007)(66946007)(2906002)(86362001)(66556008)(52116002)(8936002)(103116003)(316002)(1076003)(5660300002)(8676002)(16526019)(36756003)(38100700002)(186003)(54906003)(2616005)(23200700001);DIR:OUT;SFP:1501; X-MS-Exchange-AntiSpam-MessageData: lzjsn0vDaf8wxrgQjHDuSot/fgLvxdwfHiWhuyPQH58+fTO9wEfud1q8A9aOJwAcPHr5Gvg6MlM5Vjphw6jXK9UeHPrkSznkU+xWIaW/9COR9dEAn75lBOFrCeSuSQ5t58LLYDzaoF9nx6bEISdLVyZML9OFgbZwCxRnUhBqh8SaS4vniTdeFkUkOQ/6xc0OLi2tyLHN74Q/C9AltK26rXSpvx1TgOIe1hHgNCExqh9zPI6Raj/PCtzyLs4OiUSfoxJm+AbN3WrsD+odcfu+P3o4JgrBUCT+MBv6vxn/Ly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atorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 131cba72-5e53-4738-a2a2-08d9206e32e4 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2823.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2021 17:46:32.3700 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RnQZXBVnPRxINOYl+hi0L3jCQ8QH4P3PKxp4b+/id5uEa7cvzmT3BSbVJ8TS6X6kF5/NNUNfexmx/u6lC0n9HCw/siC7ZseQOJnbvLUatCM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB3969 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9996 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 spamscore=0 adultscore=0 bulkscore=0 mlxlogscore=988 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105260120 X-Proofpoint-ORIG-GUID: dyHUTvtvtIpBdw4G2rnqN-cen8vKO2-O X-Proofpoint-GUID: dyHUTvtvtIpBdw4G2rnqN-cen8vKO2-O X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9996 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 lowpriorityscore=0 impostorscore=0 adultscore=0 phishscore=0 priorityscore=1501 clxscore=1011 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105260119 Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2020-01-29 header.b=QpOUm1vf; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Uuk0kT5E; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf13.hostedemail.com: domain of stephen.s.brennan@oracle.com has no SPF policy when checking 141.146.126.79) smtp.mailfrom=stephen.s.brennan@oracle.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 19551E000108 X-Stat-Signature: 45hfurwmxaye8tn6jsonwadrrfwzwz49 X-HE-Tag: 1622051193-716383 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: Commit 93b3a674485f6a4b8ffff85d1682d5e8b7c51560 upstream Commit 93b3a674485f ("mm,vmstat: reduce zone->lock holding time by /proc/pagetypeinfo") upstream caps the number of iterations over each free_list at 100,000, and also drops the zone->lock in between each migrate type. Capping the iteration count alters the file contents in some cases, which means this approach may not be suitable for stable backports. However, dropping zone->lock in between migrate types (and, as a result, page orders) will not change the /proc/pagetypeinfo file contents. It can significantly reduce the length of time spent with IRQs disabled, which can prevent missed interrupts or soft lockups which we have observed on systems with particularly large memory. Thus, this commit is a modified version of the upstream one which only drops the lock in between migrate types. Fixes: 467c996c1e19 ("Print out statistics in relation to fragmentation avoidance to /proc/pagetypeinfo") Signed-off-by: Stephen Brennan Reviewed-by: Aruna Ramakrishna Reviewed-by: Khalid Aziz --- mm/vmstat.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/vmstat.c b/mm/vmstat.c index 13b74c4314a7e..663069cf7724a 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1316,6 +1316,9 @@ static void pagetypeinfo_showfree_print(struct seq_file *m, list_for_each(curr, &area->free_list[mtype]) freecount++; seq_printf(m, "%6lu ", freecount); + spin_unlock_irq(&zone->lock); + cond_resched(); + spin_lock_irq(&zone->lock); } seq_putc(m, '\n'); }