Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp396209iob; Tue, 3 May 2022 21:37:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfOH+6N2nQDdqBdSlzW1XBn7F3LFlVsBONILqkSFs0oInSvYpvTAEhxfrISX0dzbbAM6kj X-Received: by 2002:a17:906:a219:b0:6e4:86a3:44ea with SMTP id r25-20020a170906a21900b006e486a344eamr18788836ejy.385.1651639040326; Tue, 03 May 2022 21:37:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1651639040; cv=pass; d=google.com; s=arc-20160816; b=sds1MWONeMBWcVxsZzUb2i5IwpQ6VW+2RKSSdisZTaEwAocNtRLlPiSNRA44oqw+Fq syXvcLC8b2q0RVkDlIRMs+HJYJScx/UTY0FSnDgbIgto0rZMqmnmdY4gK7uQEavByowT MC7T/PTrNF+YCjxt9PjUQz9i50e92+HLo/iDpszW8p/qsz2hGsnJjVzIo/ym8niWtQmk R6V3Mf0c8z4xFeTXUHaSPcpk9LOcOHZtXpz9qiZvc7cagOY2KT6Z7ADs9fnklwdNLASK dn8WhQJxa0Xe6cpgMtgBf/QBvyZjp4g5WIoTRSqY4uJJPw8WMEAiaODL0+s6OPK+uMgg kGDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:from:dkim-signature :dkim-signature; bh=P31wKZAxGt5Hyz6T2c0DsqKf621iHzkaaJJkn8g1yTU=; b=0H7EZ0ghZ/LiGlPur0ItQ1kMHxTvFTHSEZJnFs7vHkAmFAKTGda4YOaxzdO1W+kbHE YeAPzqf9/ksCaEWGXoNGZMpYhYuHPyUef54n5L/R0wjztlZdadgYXvbjm5TFvMKRt3rB U/nchRAUWJVDd7FHxZJkBerxCBlYj5FDIna072dwECSNaPEhncFw5YTIhaREDtLi9wnn IUPDjfc2ZlWH/nrcPARdV+KLFidbJjBkN54PILy99R6/+aETCWw+fAwDf7TMhQ/fQgQc kUTH92b/HrTJCSj35E8z9rrBshbGzNdr3UDvDEPbb2yqKLplFbxq9RDWCF48YjXr0Jgr 5ebA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=qmgJrfnJ; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="p/iMcydp"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lv7-20020a170906bc8700b006df76385c34si15964097ejb.212.2022.05.03.21.36.55; Tue, 03 May 2022 21:37:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=qmgJrfnJ; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="p/iMcydp"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245277AbiEDBSy (ORCPT + 99 others); Tue, 3 May 2022 21:18:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245039AbiEDBRk (ORCPT ); Tue, 3 May 2022 21:17:40 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EDD842A2E for ; Tue, 3 May 2022 18:14:05 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 243MdDbT019339; Wed, 4 May 2022 01:13:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=P31wKZAxGt5Hyz6T2c0DsqKf621iHzkaaJJkn8g1yTU=; b=qmgJrfnJXPRKdCI2vDz8lplwvhxIpbmzeYEoTHSJgWPfzb3r3feRVagpKoqKZbZCN6QD y5PLwIB24G1OQ7NFQKzTtEcnABlxfmn3UyCjbD4k/VWV1UTcUcYqFlbCNkxadCn+eKT2 MUcgGBnwPUxmSdY9f39ynATF/p5AmHyO/tNOXbiBK8bLW2ICgb1R/FTO+5eTHFghgDQU eozCdTKjS2DYfNbwCxhSvYZVNRGfRaol2zGS0C9dFzl8Ciya/Z5fblNYLumDZLutED8c l8WECjPqaS8iDUbpp22xanGHXJtthF+eGdZ/+1JsIxJIbYT3N8B9Nr22dxzCT8LY1/WE 5w== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3frwnt74gj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 May 2022 01:13:56 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 2441BRJZ013094; Wed, 4 May 2022 01:13:55 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2105.outbound.protection.outlook.com [104.47.58.105]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3fsvbmv3ke-11 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 May 2022 01:13:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MTFi6vRyt0tkGZPjkCVgIv7VNwHgtYywoNL81oDAItRyxfQg/tMLeNs8i7CrvjM5gZV/xF/x0XBidMBhn39UUykE86VOLlslo0VFQl1HB0G30hdgizkhdW1AD2LvF8yTVnk474Yu+eUTrI8qb4oC4TZMYGZz+j2s9fpB8joLzAUxcnuAVnMq5VYG9M00DOxIPgKiy/iMQPlblcY2UY3KPXaSrMn4TcpQJDxtD68ZPrwCWYVGCM+dWE619kuRf9lEe8gbNH3nju4Apz/1REdH0MEF2WarKP+zAtRxCG+5mr8eReQD/AIJ+pFJtttA3rHZlYMYm6E0FYBEp4D15cJ9cQ== 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=P31wKZAxGt5Hyz6T2c0DsqKf621iHzkaaJJkn8g1yTU=; b=j1qh+OBhf5VacuZwCkp06iFnkxAdoRuVzaCaIwQGMlLmTjXXS7nolsU2RrkGJpBbqzVX1cJt61uLlzDjbcT8TFeZ2ASlgPE54yojS5dZGMLrWf2lsG8ZA2EmgHU2l2+Wg+e3qghkiI3M57E6VfVkdNWkTcE+mxgUP6ScVoCzimiFtL+32fQvCnPZqUs/fvCDFvLtCOQhOs57jC5id2BnH7UqbPbMlaLjnwt4glTBHO/Ct1CL/id7j+sSGKxJL8cvQFUIQwg+WPzgLzfrGt3URz1xwZ0Cj/mBSwN80PTyvrV81y9D8r897FRATwa+EwPgV2dhhfzWo2gFUx+jZwgFzg== 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=P31wKZAxGt5Hyz6T2c0DsqKf621iHzkaaJJkn8g1yTU=; b=p/iMcydpSGIBVf5i73LcueKzLtwmAlo0BTOm33R9ODWyVsOOuBSoHqgYu6U0HamxYn4cczhVZlSEudT+H4UhS4ohqBY3LMdfZv/YOm4wwUlx0QXsCdoZy+w8bqIU6x09/hvJHnWohBRR8iMTMEmxjTPbMO7a1c/EMqNyqyks/TM= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by PH7PR10MB5830.namprd10.prod.outlook.com (2603:10b6:510:127::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Wed, 4 May 2022 01:13:53 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::318c:d02:2280:c2c]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::318c:d02:2280:c2c%7]) with mapi id 15.20.5206.024; Wed, 4 May 2022 01:13:53 +0000 From: Liam Howlett To: "maple-tree@lists.infradead.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Andrew Morton Subject: [PATCH v9 25/69] mm: remove vmacache Thread-Topic: [PATCH v9 25/69] mm: remove vmacache Thread-Index: AQHYX1Q3k5d/NGnKy0a6Z2p3Vdrj/g== Date: Wed, 4 May 2022 01:13:52 +0000 Message-ID: <20220504011345.662299-10-Liam.Howlett@oracle.com> References: <20220504002554.654642-1-Liam.Howlett@oracle.com> <20220504011345.662299-1-Liam.Howlett@oracle.com> In-Reply-To: <20220504011345.662299-1-Liam.Howlett@oracle.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.35.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0ffef555-5656-4cab-9af8-08da2d6b5a99 x-ms-traffictypediagnostic: PH7PR10MB5830:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /d2nFUNmRi3xl82ir+wWfltgAUz5fBEWotbbMs0c4CbZZfotjSRLFWrstkgg0fWEjpOYYXQLxrjcWxgmueTnMzzk5TqsRC8lQrSXr9RgpDoLa7kF+gLuAgM8/gVu2k4RJSZDcYH7Ot2WQQeFYk88RRMcJpHaYOtnGCibTGa9hf+9SMoBJM8rJXVgFWeUQSwSD4BP6P5yymQOF6UCI0/agZZQbdzE2ySsjXQZx7o73EFbTSw6T23r7QlzOWwLX97oMX8h3WtOwmnjyzNyd1K+MR79Ua0zUSMZA9fBxpxVTAtFUVq5lf2+kJtIbkbUoW2N2uxTGmFqa02X8Tuy07XvwIt4brUCSeFUBzLGrKj+runSY2vYxaPoTe1170gmAFdtmjflIaSWKzXR5x6htNriedvX44k14WoE0nqIhZVaHogjorfpxiFGihfYMJ8WFmuF2xKDz38PlvJYUdyFyM8jNxvdMxRbEQYYZYJ41IGYONLjUb7qSnhS2zu3T2dsDDDUmsKw3EWin8VXNZdbinCpGbQv+78r3SXGfh+hCqWb7WwHxp/qhuk/4anQZIdZOQHwj9ixKRbL81NmhJLYgeWbAnAmLuTIM/+t7Pk0G43x5D2US5QfJ8V6nCDGQwqYboDXcvMd8DKrMvFV6DbTFG9E/3QCGo0c2YvZD8sWBrB8Uw3uQWCmQLPhTwMDvau5NGG0fVsYj8x5wZtx1t6JSafBJQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(86362001)(71200400001)(83380400001)(38100700002)(38070700005)(122000001)(316002)(110136005)(44832011)(2906002)(8676002)(5660300002)(64756008)(66476007)(36756003)(8936002)(91956017)(30864003)(66556008)(2616005)(66446008)(66946007)(76116006)(1076003)(186003)(6512007)(6486002)(508600001)(26005)(6506007)(579004);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?ZJqfmH9+uq4U8L8hi/bRmmxOb955RgTddphg7nKvD3TsXFg821+pdj4EeO?= =?iso-8859-1?Q?iwN3ci2t6l+g2q/kkT/GlGeAvgIEl4wOztdjjeraZjlA9BWmX8sI5rXe+i?= =?iso-8859-1?Q?UorLBIRYv0gr4jKbcWw9D+Qbth/62VTg8k1bvY1vmWAriyAq930ovkpJUY?= =?iso-8859-1?Q?g4UsT1/3q7J5pBYfC51uB/z1DCZLjIYEfOWNasYF1H+C+uJHmVZ//ueybx?= =?iso-8859-1?Q?qSeL/tsyYUxZO4Wwofa2b5GTgo8WzSfWBUz9NnSn5PTIW+pg5b0jPp/RfL?= =?iso-8859-1?Q?RTZuDRIHMGNKVTIvUrM0CaUfPb5RVrEH206QnnB2VsDy2c/NuVW1by/Wqt?= =?iso-8859-1?Q?tLXalfVSBMdqz6VBxC61GTRkZEQ/6/7ExvOSwwwJxGkCMOCZ6kuhsr1Nyl?= =?iso-8859-1?Q?49AoP5Sos+86HaUK02IZv4sJIh6W30fGX25DTH2TnNNdXGVqw3r+R+xmlK?= =?iso-8859-1?Q?5WnhOzxmUiW5FyORq15Wq0VxCUYAwpfrBnay4FiKi1rcdoObtDWBRoNhSV?= =?iso-8859-1?Q?YKfITXt/1je/q0k7d9QgErqX+R3SRKKRCorjux/DbK5iCcCudT9B/DPb9X?= =?iso-8859-1?Q?CCuA1daBhJj5hNZSKvh83FZIF+I0w+CW07czUN7mr/bw/doFkF3Z8G2jU9?= =?iso-8859-1?Q?uMwJ8xnbQcMNrN7EABgUmwYv+5P9szP4TEPSOBCxkQjKkgzZ75FOLMUxcD?= =?iso-8859-1?Q?PZZ6Nsh0rvfuHhL+XwNI/m+GRHUcWydTUrvnjkL0TBniwryFBIpNASUUlR?= =?iso-8859-1?Q?kNMqcP+B16dq0RdLCnhdL/jjpqELpFerMNa8+FNp7jiS1cUyhUnxt5/QLm?= =?iso-8859-1?Q?2hPS4TspOAut4allR7AcM2WmWoe8iuapHEbJD31fDPE73vvRFsERf6L/IW?= =?iso-8859-1?Q?0CyoLidgZEP7ogrvMpeZiAnla1+zPvkZCdkGGIjG6zzyLLNqS/cwWeC3pD?= =?iso-8859-1?Q?b2DCyRFAppdnE7AjzNURcWwSnjWEoTsCm4RYl0u0MXp8KGNd6IIctDPp7h?= =?iso-8859-1?Q?aGD+1HyZfj/aYkeVXD7SMiNQ9Nektan1ZT3hL6Ll6fbTSXSdEs7KQfb91t?= =?iso-8859-1?Q?cKqTZn6ls3Fot9GZI6DBDvTmDmqFvUOTwRtO2vzfEnWz6WKOL7G/zB6ttz?= =?iso-8859-1?Q?OzGS/6QmsG6SZqqwP7Wh3WB8DC0ij1mrN0sf/Z870HukNn3smF1AGRUDuI?= =?iso-8859-1?Q?mS9cFCP/YgJYDN0JoptC03kCJSPopZYhaSDodtcjqQGWvFGBWD/aCQwSLl?= =?iso-8859-1?Q?7npS9f4RUg/OOCoW1j61fd/RD6HcCTZj9BLCTBk2haijbv5Esk3SULx0GV?= =?iso-8859-1?Q?14/SKouNpQHtRmHMSSYa0e99ZBMgvLEpPZWHJC8PAt1+eY+j48efbtGX28?= =?iso-8859-1?Q?pt4m2Rbiss7O6D21UT6vFI2V47rHFpujlbIMrJ38peW/m14+lCAd0VUdGR?= =?iso-8859-1?Q?Y12pTjBntZq0fgsUp7NaSRNut4NszryKcwjuO63C+2RVc1Fy2nngMPqIQM?= =?iso-8859-1?Q?TVkcJCG/Kc+ZwMgq5wE6q9f2vZkEWSVA1oE69x5TuaQ8WcD/kx56rbuMNf?= =?iso-8859-1?Q?AwW68Av7wZz/800uRUvSE6yVVBLs72s/0880UgviJpceOo1zksWBRn+Tsj?= =?iso-8859-1?Q?IVU3UGy86GBMW+bgTfuXJOyySCPb/fz5f7FT9JUI4A8DAbqSxwHb0WSzRG?= =?iso-8859-1?Q?X/DXDu8Xm78PDoWhWlZudTypAZtsyqCqHxEV2R6BdtQ5EmSP7J8LrMPmPc?= =?iso-8859-1?Q?YGkFOwrVIntrB+Xw6+TVXLTR9CY+6qcR56jzMIpfgQBByYdxrRbUZyixY7?= =?iso-8859-1?Q?txjkpxRJfExJEByo4z6h1tDYU2GrnL4=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ffef555-5656-4cab-9af8-08da2d6b5a99 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 May 2022 01:13:52.7519 (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: y8zPEaImHuXq5mop8tMcZdi3EaJqPkaIIqVWWLGjfWiKWXewwwGlpPoQVogKsNCaRKABPTKM2IObf+gt0ET2LQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB5830 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486,18.0.858 definitions=2022-05-03_10:2022-05-02,2022-05-03 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 spamscore=0 malwarescore=0 adultscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205040006 X-Proofpoint-ORIG-GUID: o-Wzt1XFEFckJgyyi3vO-ORdpfKaUYvD X-Proofpoint-GUID: o-Wzt1XFEFckJgyyi3vO-ORdpfKaUYvD X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Liam R. Howlett" By using the maple tree and the maple tree state, the vmacache is no longer beneficial and is complicating the VMA code. Remove the vmacache to reduce the work in keeping it up to date and code complexity. Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka --- fs/exec.c | 3 - fs/proc/task_mmu.c | 1 - include/linux/mm_types.h | 1 - include/linux/mm_types_task.h | 12 ---- include/linux/sched.h | 1 - include/linux/vm_event_item.h | 4 -- include/linux/vmacache.h | 28 -------- include/linux/vmstat.h | 6 -- kernel/debug/debug_core.c | 12 ---- kernel/fork.c | 5 -- lib/Kconfig.debug | 8 --- mm/Makefile | 2 +- mm/debug.c | 4 +- mm/mmap.c | 32 +--------- mm/nommu.c | 37 ++--------- mm/vmacache.c | 117 ---------------------------------- mm/vmstat.c | 4 -- 17 files changed, 9 insertions(+), 268 deletions(-) delete mode 100644 include/linux/vmacache.h delete mode 100644 mm/vmacache.c diff --git a/fs/exec.c b/fs/exec.c index e3e55d5e0be1..14e7278a1ab8 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -1023,8 +1022,6 @@ static int exec_mmap(struct mm_struct *mm) activate_mm(active_mm, mm); if (IS_ENABLED(CONFIG_ARCH_WANT_IRQS_OFF_ACTIVATE_MM)) local_irq_enable(); - tsk->mm->vmacache_seqnum =3D 0; - vmacache_flush(tsk); task_unlock(tsk); if (old_mm) { mmap_read_unlock(old_mm); diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index a843d13e2e1a..b940b969b000 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -1,6 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 #include -#include #include #include #include diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 50c53f370bf6..b844119387a3 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -465,7 +465,6 @@ struct mm_struct { struct { struct vm_area_struct *mmap; /* list of VMAs */ struct maple_tree mm_mt; - u64 vmacache_seqnum; /* per-thread vmacache */ #ifdef CONFIG_MMU unsigned long (*get_unmapped_area) (struct file *filp, unsigned long addr, unsigned long len, diff --git a/include/linux/mm_types_task.h b/include/linux/mm_types_task.h index c1bc6731125c..0bb4b6da9993 100644 --- a/include/linux/mm_types_task.h +++ b/include/linux/mm_types_task.h @@ -24,18 +24,6 @@ IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK)) #define ALLOC_SPLIT_PTLOCKS (SPINLOCK_SIZE > BITS_PER_LONG/8) =20 -/* - * The per task VMA cache array: - */ -#define VMACACHE_BITS 2 -#define VMACACHE_SIZE (1U << VMACACHE_BITS) -#define VMACACHE_MASK (VMACACHE_SIZE - 1) - -struct vmacache { - u64 seqnum; - struct vm_area_struct *vmas[VMACACHE_SIZE]; -}; - /* * When updating this, please also update struct resident_page_types[] in * kernel/fork.c diff --git a/include/linux/sched.h b/include/linux/sched.h index a8911b1f35aa..c58392abc663 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -861,7 +861,6 @@ struct task_struct { struct mm_struct *active_mm; =20 /* Per-thread vma caching: */ - struct vmacache vmacache; =20 #ifdef SPLIT_RSS_COUNTING struct task_rss_stat rss_stat; diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index e83967e4c20e..5e80138ce624 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h @@ -122,10 +122,6 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, NR_TLB_LOCAL_FLUSH_ALL, NR_TLB_LOCAL_FLUSH_ONE, #endif /* CONFIG_DEBUG_TLBFLUSH */ -#ifdef CONFIG_DEBUG_VM_VMACACHE - VMACACHE_FIND_CALLS, - VMACACHE_FIND_HITS, -#endif #ifdef CONFIG_SWAP SWAP_RA, SWAP_RA_HIT, diff --git a/include/linux/vmacache.h b/include/linux/vmacache.h deleted file mode 100644 index 6fce268a4588..000000000000 --- a/include/linux/vmacache.h +++ /dev/null @@ -1,28 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __LINUX_VMACACHE_H -#define __LINUX_VMACACHE_H - -#include -#include - -static inline void vmacache_flush(struct task_struct *tsk) -{ - memset(tsk->vmacache.vmas, 0, sizeof(tsk->vmacache.vmas)); -} - -extern void vmacache_update(unsigned long addr, struct vm_area_struct *new= vma); -extern struct vm_area_struct *vmacache_find(struct mm_struct *mm, - unsigned long addr); - -#ifndef CONFIG_MMU -extern struct vm_area_struct *vmacache_find_exact(struct mm_struct *mm, - unsigned long start, - unsigned long end); -#endif - -static inline void vmacache_invalidate(struct mm_struct *mm) -{ - mm->vmacache_seqnum++; -} - -#endif /* __LINUX_VMACACHE_H */ diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index bfe38869498d..19cf5b6892ce 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h @@ -125,12 +125,6 @@ static inline void vm_events_fold_cpu(int cpu) #define count_vm_tlb_events(x, y) do { (void)(y); } while (0) #endif =20 -#ifdef CONFIG_DEBUG_VM_VMACACHE -#define count_vm_vmacache_event(x) count_vm_event(x) -#else -#define count_vm_vmacache_event(x) do {} while (0) -#endif - #define __count_zid_vm_events(item, zid, delta) \ __count_vm_events(item##_NORMAL - ZONE_NORMAL + zid, delta) =20 diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index da06a5553835..c4e6f5159bed 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c @@ -50,7 +50,6 @@ #include #include #include -#include #include #include =20 @@ -282,17 +281,6 @@ static void kgdb_flush_swbreak_addr(unsigned long addr= ) if (!CACHE_FLUSH_IS_SAFE) return; =20 - if (current->mm) { - int i; - - for (i =3D 0; i < VMACACHE_SIZE; i++) { - if (!current->vmacache.vmas[i]) - continue; - flush_cache_range(current->vmacache.vmas[i], - addr, addr + BREAK_INSTR_SIZE); - } - } - /* Force flush instruction cache if it was outside the mm */ flush_icache_range(addr, addr + BREAK_INSTR_SIZE); } diff --git a/kernel/fork.c b/kernel/fork.c index 60783abc21c8..4af22dd65fc6 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -1119,7 +1118,6 @@ static struct mm_struct *mm_init(struct mm_struct *mm= , struct task_struct *p, mm->mmap =3D NULL; mt_init_flags(&mm->mm_mt, MM_MT_FLAGS); mt_set_external_lock(&mm->mm_mt, &mm->mmap_lock); - mm->vmacache_seqnum =3D 0; atomic_set(&mm->mm_users, 1); atomic_set(&mm->mm_count, 1); seqcount_init(&mm->write_protect_seq); @@ -1575,9 +1573,6 @@ static int copy_mm(unsigned long clone_flags, struct = task_struct *tsk) if (!oldmm) return 0; =20 - /* initialize the new vmacache entries */ - vmacache_flush(tsk); - if (clone_flags & CLONE_VM) { mmget(oldmm); mm =3D oldmm; diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 3d9366075153..8a0567046e9e 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -837,14 +837,6 @@ config DEBUG_VM =20 If unsure, say N. =20 -config DEBUG_VM_VMACACHE - bool "Debug VMA caching" - depends on DEBUG_VM - help - Enable this to turn on VMA caching debug information. Doing so - can cause significant overhead, so only enable it in non-production - environments. - config DEBUG_VM_MAPLE_TREE bool "Debug VM maple trees" depends on DEBUG_VM diff --git a/mm/Makefile b/mm/Makefile index 6f9ffa968a1a..298c9991ab75 100644 --- a/mm/Makefile +++ b/mm/Makefile @@ -52,7 +52,7 @@ obj-y :=3D filemap.o mempool.o oom_kill.o fadvise.o \ readahead.o swap.o truncate.o vmscan.o shmem.o \ util.o mmzone.o vmstat.o backing-dev.o \ mm_init.o percpu.o slab_common.o \ - compaction.o vmacache.o \ + compaction.o \ interval_tree.o list_lru.o workingset.o \ debug.o gup.o mmap_lock.o $(mmu-y) =20 diff --git a/mm/debug.c b/mm/debug.c index bef329bf28f0..2d625ca0e326 100644 --- a/mm/debug.c +++ b/mm/debug.c @@ -155,7 +155,7 @@ EXPORT_SYMBOL(dump_vma); =20 void dump_mm(const struct mm_struct *mm) { - pr_emerg("mm %px mmap %px seqnum %llu task_size %lu\n" + pr_emerg("mm %px mmap %px task_size %lu\n" #ifdef CONFIG_MMU "get_unmapped_area %px\n" #endif @@ -183,7 +183,7 @@ void dump_mm(const struct mm_struct *mm) "tlb_flush_pending %d\n" "def_flags: %#lx(%pGv)\n", =20 - mm, mm->mmap, (long long) mm->vmacache_seqnum, mm->task_size, + mm, mm->mmap, mm->task_size, #ifdef CONFIG_MMU mm->get_unmapped_area, #endif diff --git a/mm/mmap.c b/mm/mmap.c index baf608975f99..9b4192130814 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -722,9 +721,6 @@ inline int vma_expand(struct ma_state *mas, struct vm_a= rea_struct *vma, /* Remove from mm linked list - also updates highest_vm_end */ __vma_unlink_list(mm, next); =20 - /* Kill the cache */ - vmacache_invalidate(mm); - if (file) __remove_shared_vm_struct(next, file, mapping); =20 @@ -963,8 +959,6 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned l= ong start, =20 if (remove_next) { __vma_unlink_list(mm, next); - /* Kill the cache */ - vmacache_invalidate(mm); if (file) __remove_shared_vm_struct(next, file, mapping); } else if (insert) { @@ -2237,19 +2231,10 @@ struct vm_area_struct *find_vma_intersection(struct= mm_struct *mm, unsigned long start_addr, unsigned long end_addr) { - struct vm_area_struct *vma; unsigned long index =3D start_addr; =20 mmap_assert_locked(mm); - /* Check the cache first. */ - vma =3D vmacache_find(mm, start_addr); - if (likely(vma)) - return vma; - - vma =3D mt_find(&mm->mm_mt, &index, end_addr - 1); - if (vma) - vmacache_update(start_addr, vma); - return vma; + return mt_find(&mm->mm_mt, &index, end_addr - 1); } EXPORT_SYMBOL(find_vma_intersection); =20 @@ -2263,19 +2248,10 @@ EXPORT_SYMBOL(find_vma_intersection); */ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr) { - struct vm_area_struct *vma; unsigned long index =3D addr; =20 mmap_assert_locked(mm); - /* Check the cache first. */ - vma =3D vmacache_find(mm, addr); - if (likely(vma)) - return vma; - - vma =3D mt_find(&mm->mm_mt, &index, ULONG_MAX); - if (vma) - vmacache_update(addr, vma); - return vma; + return mt_find(&mm->mm_mt, &index, ULONG_MAX); } EXPORT_SYMBOL(find_vma); =20 @@ -2663,9 +2639,6 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, stru= ct ma_state *mas, mm->highest_vm_end =3D prev ? vm_end_gap(prev) : 0; tail_vma->vm_next =3D NULL; =20 - /* Kill the cache */ - vmacache_invalidate(mm); - /* * Do not downgrade mmap_lock if we are next to VM_GROWSDOWN or * VM_GROWSUP VMA. Such VMAs can change their size under @@ -3045,7 +3018,6 @@ static int do_brk_munmap(struct ma_state *mas, struct= vm_area_struct *vma, =20 vma_mas_remove(&unmap, mas); =20 - vmacache_invalidate(vma->vm_mm); if (vma->anon_vma) { anon_vma_interval_tree_post_update_vma(vma); anon_vma_unlock_write(vma->anon_vma); diff --git a/mm/nommu.c b/mm/nommu.c index 2870edfad8ed..1c9b4e8c4d5c 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -585,23 +584,12 @@ static void add_vma_to_mm(struct mm_struct *mm, struc= t vm_area_struct *vma) */ static void delete_vma_from_mm(struct vm_area_struct *vma) { - int i; - struct address_space *mapping; - struct mm_struct *mm =3D vma->vm_mm; - struct task_struct *curr =3D current; MA_STATE(mas, &vma->vm_mm->mm_mt, 0, 0); =20 - mm->map_count--; - for (i =3D 0; i < VMACACHE_SIZE; i++) { - /* if the vma is cached, invalidate the entire cache */ - if (curr->vmacache.vmas[i] =3D=3D vma) { - vmacache_invalidate(mm); - break; - } - } - + vma->vm_mm->map_count--; /* remove the VMA from the mapping */ if (vma->vm_file) { + struct address_space *mapping; mapping =3D vma->vm_file->f_mapping; =20 i_mmap_lock_write(mapping); @@ -613,7 +601,7 @@ static void delete_vma_from_mm(struct vm_area_struct *v= ma) =20 /* remove from the MM's tree and list */ vma_mas_remove(vma, &mas); - __vma_unlink_list(mm, vma); + __vma_unlink_list(vma->vm_mm, vma); } =20 /* @@ -646,20 +634,9 @@ EXPORT_SYMBOL(find_vma_intersection); */ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr) { - struct vm_area_struct *vma; MA_STATE(mas, &mm->mm_mt, addr, addr); =20 - /* check the cache first */ - vma =3D vmacache_find(mm, addr); - if (likely(vma)) - return vma; - - vma =3D mas_walk(&mas); - - if (vma) - vmacache_update(addr, vma); - - return vma; + return mas_walk(&mas); } EXPORT_SYMBOL(find_vma); =20 @@ -693,11 +670,6 @@ static struct vm_area_struct *find_vma_exact(struct mm= _struct *mm, unsigned long end =3D addr + len; MA_STATE(mas, &mm->mm_mt, addr, addr); =20 - /* check the cache first */ - vma =3D vmacache_find_exact(mm, addr, end); - if (vma) - return vma; - vma =3D mas_walk(&mas); if (!vma) return NULL; @@ -706,7 +678,6 @@ static struct vm_area_struct *find_vma_exact(struct mm_= struct *mm, if (vma->vm_end !=3D end) return NULL; =20 - vmacache_update(addr, vma); return vma; } =20 diff --git a/mm/vmacache.c b/mm/vmacache.c deleted file mode 100644 index 01a6e6688ec1..000000000000 --- a/mm/vmacache.c +++ /dev/null @@ -1,117 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Copyright (C) 2014 Davidlohr Bueso. - */ -#include -#include -#include -#include - -/* - * Hash based on the pmd of addr if configured with MMU, which provides a = good - * hit rate for workloads with spatial locality. Otherwise, use pages. - */ -#ifdef CONFIG_MMU -#define VMACACHE_SHIFT PMD_SHIFT -#else -#define VMACACHE_SHIFT PAGE_SHIFT -#endif -#define VMACACHE_HASH(addr) ((addr >> VMACACHE_SHIFT) & VMACACHE_MASK) - -/* - * This task may be accessing a foreign mm via (for example) - * get_user_pages()->find_vma(). The vmacache is task-local and this - * task's vmacache pertains to a different mm (ie, its own). There is - * nothing we can do here. - * - * Also handle the case where a kernel thread has adopted this mm via - * kthread_use_mm(). That kernel thread's vmacache is not applicable to th= is mm. - */ -static inline bool vmacache_valid_mm(struct mm_struct *mm) -{ - return current->mm =3D=3D mm && !(current->flags & PF_KTHREAD); -} - -void vmacache_update(unsigned long addr, struct vm_area_struct *newvma) -{ - if (vmacache_valid_mm(newvma->vm_mm)) - current->vmacache.vmas[VMACACHE_HASH(addr)] =3D newvma; -} - -static bool vmacache_valid(struct mm_struct *mm) -{ - struct task_struct *curr; - - if (!vmacache_valid_mm(mm)) - return false; - - curr =3D current; - if (mm->vmacache_seqnum !=3D curr->vmacache.seqnum) { - /* - * First attempt will always be invalid, initialize - * the new cache for this task here. - */ - curr->vmacache.seqnum =3D mm->vmacache_seqnum; - vmacache_flush(curr); - return false; - } - return true; -} - -struct vm_area_struct *vmacache_find(struct mm_struct *mm, unsigned long a= ddr) -{ - int idx =3D VMACACHE_HASH(addr); - int i; - - count_vm_vmacache_event(VMACACHE_FIND_CALLS); - - if (!vmacache_valid(mm)) - return NULL; - - for (i =3D 0; i < VMACACHE_SIZE; i++) { - struct vm_area_struct *vma =3D current->vmacache.vmas[idx]; - - if (vma) { -#ifdef CONFIG_DEBUG_VM_VMACACHE - if (WARN_ON_ONCE(vma->vm_mm !=3D mm)) - break; -#endif - if (vma->vm_start <=3D addr && vma->vm_end > addr) { - count_vm_vmacache_event(VMACACHE_FIND_HITS); - return vma; - } - } - if (++idx =3D=3D VMACACHE_SIZE) - idx =3D 0; - } - - return NULL; -} - -#ifndef CONFIG_MMU -struct vm_area_struct *vmacache_find_exact(struct mm_struct *mm, - unsigned long start, - unsigned long end) -{ - int idx =3D VMACACHE_HASH(start); - int i; - - count_vm_vmacache_event(VMACACHE_FIND_CALLS); - - if (!vmacache_valid(mm)) - return NULL; - - for (i =3D 0; i < VMACACHE_SIZE; i++) { - struct vm_area_struct *vma =3D current->vmacache.vmas[idx]; - - if (vma && vma->vm_start =3D=3D start && vma->vm_end =3D=3D end) { - count_vm_vmacache_event(VMACACHE_FIND_HITS); - return vma; - } - if (++idx =3D=3D VMACACHE_SIZE) - idx =3D 0; - } - - return NULL; -} -#endif diff --git a/mm/vmstat.c b/mm/vmstat.c index b94a2e4723ff..4e76537aadcf 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1382,10 +1382,6 @@ const char * const vmstat_text[] =3D { "nr_tlb_local_flush_one", #endif /* CONFIG_DEBUG_TLBFLUSH */ =20 -#ifdef CONFIG_DEBUG_VM_VMACACHE - "vmacache_find_calls", - "vmacache_find_hits", -#endif #ifdef CONFIG_SWAP "swap_ra", "swap_ra_hit", --=20 2.35.1