Message ID | 20211201142918.921493-42-Liam.Howlett@oracle.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 E7849C433EF for <linux-mm@archiver.kernel.org>; Wed, 1 Dec 2021 14:50:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C2AC96B00C6; Wed, 1 Dec 2021 09:40:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BDC676B00C7; Wed, 1 Dec 2021 09:40:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A31776B00C8; Wed, 1 Dec 2021 09:40:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0166.hostedemail.com [216.40.44.166]) by kanga.kvack.org (Postfix) with ESMTP id 9535C6B00C6 for <linux-mm@kvack.org>; Wed, 1 Dec 2021 09:40:05 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5FCFC289FB for <linux-mm@kvack.org>; Wed, 1 Dec 2021 14:39:55 +0000 (UTC) X-FDA: 78869484750.28.E6CF98F Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf05.hostedemail.com (Postfix) with ESMTP id 0E542508BB87 for <linux-mm@kvack.org>; Wed, 1 Dec 2021 14:39:52 +0000 (UTC) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1B1DDP4Z010062; Wed, 1 Dec 2021 14:30:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=AOeWOQP0G+SUtPMZjRHYL+pX/Z+e7nll5757Ht5Gbjo=; b=Tg2PhGt1VgdtUWmF4mi9lETAL2WJIIXpO7sSBaeemwJIH0ofZo4j4gVrdFietlB+y/7b +nIySUSNbyg9wdaoPWFoMtvZ3yGzVrKScxX2MQ3QatSbcrDXQqkarNchR4WlKaIuEIV6 N0JwbV6qRoP8X1tbhshFKf3o2lQFSIwzn2cCQ5ZMre2zNA/I4dpciFGJcXVPRUUtSqDR XU4ipO//VrV/Bhuz6SbEpYE9SWyxrD8nKAYNB/s88Kr5U/x13eBpEckfRMfTjxZosmJx /cySHQW4cL5APYTBnVs54d24Rgj0unFCfExJB0XgAZIpIu+2sJMi4XJ6t1ka48C/Wuxr sg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3cp9r50e4e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Dec 2021 14:30:45 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1B1EUNPV108922; Wed, 1 Dec 2021 14:30:44 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2104.outbound.protection.outlook.com [104.47.70.104]) by userp3020.oracle.com with ESMTP id 3cke4rv5ew-8 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Dec 2021 14:30:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TP2XmfBtIluEb49jAyo3u/NzfZaTpAXEgvm93NmjX5RssVhb2vpMWMwnQWFEplVTZi5DbOL6P3ZXu6B6IyySA6UDwPLIR28/PGARCzPLesIUfzIKdmkk68QU7UXmNlo09LoexnOifsV3CaKL0nwS68FzrA/GU63RivxwybH/YpxVbOwfRnercPtKzr3D8uRvQBwsl6norDb6tLCTyjwrT74TpwzVZZVpL//34A2YOlVjTpwXs7EHXW0OIxmsqs3mMA2CcSuSS7p588DHKrFXo9/WU8RIljNeId0PWkjupAHcB0xr47jxZCMlD/3/PmFhrWKJWAjTsba3O9s55CH3cQ== 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=AOeWOQP0G+SUtPMZjRHYL+pX/Z+e7nll5757Ht5Gbjo=; b=AAj32hWu8lnzXuqa6wRSLcvMUf8NYzTzhXP5UZqBifro61MD3K8al/003DzANWjVo3QKnHPnDs7sG4Ur1ZCQX/VsIDXMbuIODJ1rvuF/9IVATk5qfQn5hP0tqsPquVRmvr0caA3xX8BPYhVvX0LPlOGRzKbj2KeWNoe7uAf0rjJinpiJOJ3by24BJrw2AeERu5WInT+nocPlWm0KpgFLuYINewPIXqW6ydA3cdcdyCe1O4CmCTPq2MMG3oNmgghk76svIOQkmFS/lC+zkvvVNPtY1y+CZAUj3mJcspwqdrEekIYxxlmL0NyroAOrNMGyij3QupEI9jpsUBQAJSDfZw== 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=AOeWOQP0G+SUtPMZjRHYL+pX/Z+e7nll5757Ht5Gbjo=; b=EVr7FVJhg+z0MmIN+omEp7zljI+hbVRHIO1PC0Pek44+gB9eXM0vJygnwtGRzBVo+2mnBidlRpADyyaIi5jgCIgxuNQnrLEVVnkKbOMtJVzNanCPdEPxUy8g+o/7IXYVbgCMMU5dxQFVaI8rIKDUi0pQ34L4n3Eys+In7lNt8Is= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA2PR10MB4508.namprd10.prod.outlook.com (2603:10b6:806:11d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Wed, 1 Dec 2021 14:30:38 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::c4d0:8291:84d:ac66]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::c4d0:8291:84d:ac66%7]) with mapi id 15.20.4734.027; Wed, 1 Dec 2021 14:30:38 +0000 From: Liam Howlett <liam.howlett@oracle.com> To: "maple-tree@lists.infradead.org" <maple-tree@lists.infradead.org>, "linux-mm@kvack.org" <linux-mm@kvack.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@linux-foundation.org> CC: Song Liu <songliubraving@fb.com>, Davidlohr Bueso <dave@stgolabs.net>, "Paul E . McKenney" <paulmck@kernel.org>, Matthew Wilcox <willy@infradead.org>, Laurent Dufour <ldufour@linux.ibm.com>, David Rientjes <rientjes@google.com>, Axel Rasmussen <axelrasmussen@google.com>, Suren Baghdasaryan <surenb@google.com>, Vlastimil Babka <vbabka@suse.cz>, Rik van Riel <riel@surriel.com>, Peter Zijlstra <peterz@infradead.org>, Michel Lespinasse <walken.cr@gmail.com>, Jerome Glisse <jglisse@redhat.com>, Minchan Kim <minchan@google.com>, Joel Fernandes <joelaf@google.com>, Rom Lemarchand <romlem@google.com>, Liam Howlett <liam.howlett@oracle.com> Subject: [PATCH v4 41/66] fs/proc/base: Use maple tree iterators in place of linked list Thread-Topic: [PATCH v4 41/66] fs/proc/base: Use maple tree iterators in place of linked list Thread-Index: AQHX5r/xyY+1opa6LUOC0WVCKNxImw== Date: Wed, 1 Dec 2021 14:30:09 +0000 Message-ID: <20211201142918.921493-42-Liam.Howlett@oracle.com> References: <20211201142918.921493-1-Liam.Howlett@oracle.com> In-Reply-To: <20211201142918.921493-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.30.2 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3dc53e03-4bed-46a7-3b31-08d9b4d7250c x-ms-traffictypediagnostic: SA2PR10MB4508: x-microsoft-antispam-prvs: <SA2PR10MB45081979FCA74AD6A7308516FD689@SA2PR10MB4508.namprd10.prod.outlook.com> x-ms-oob-tlc-oobclassifiers: OLM:1303; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: IqG9YcArZucLRvE79piZ1zAXGrCavKbHFbYa60f3laMXHzTGyTkD8ylNMCOBq88EjniD6LY6+BHebAlO1HfS5ybx2w5DYc/goSaSEEszPXtatX25fNtD9wRZIXfZ5hi5VvACPUXmFmUOwQbekkBoqsgP6MJ4X7j1VSvyA07mMNYlmzPdIOS06HWCOZ1WBBXTVozYw5I61c+D6Eoh7RrU8xGtTIAjO9JWB6IVT4T8OaQ0R+NK9/W42D3Wqu6UfO1SFR/9IJ4QMI5mX/OXYe/jswPgyOkKbt4UR8+ckwUsztSjZGQ9xfwW6yuXvK9u0KkzsrDEO/gg+eeyVvAbea1xb4TTBIGM/Fe5kpdMg1QYN6VfBGJr/NX1md/x/uadxH4MRMBoCrjJLsM+FCZtA49vP9JubptHmDgh68g6qVUzsbm3oNxmLGcykUIBfmQLo84QprwgiG7qN4SGDf73+3Ei674VkGeAEIub3nE3yUHUzqHlCbFz3cMvJ9ec3FJehWhI55KzUNFeIklFZaBNr9ZtAIEDc7J06JonCpfiQ7dd5BX++gaJTA59Swp+uiZxbfly/1jh4LHkcTJOHFl+VC3wjtUEFFJXNpn9ST3OH0KQ3Ipr1hmnCF6YzEETC5IucZCA5td1dLzWpq+snohsGat8zK2sLsOtksTy741n8US3HUUTtRTi9xfKWaVWKjkMLEk88/Di+wuHKxaYRHR/BLCaMQ== 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:(366004)(186003)(26005)(7416002)(4744005)(1076003)(2906002)(8936002)(54906003)(83380400001)(2616005)(38100700002)(71200400001)(66946007)(86362001)(66446008)(8676002)(6506007)(38070700005)(6512007)(6666004)(122000001)(508600001)(110136005)(6486002)(64756008)(66556008)(76116006)(91956017)(107886003)(316002)(5660300002)(44832011)(36756003)(4326008)(66476007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?Y4K+kYZvlr76iuhyGhUP9gh?= =?iso-8859-1?q?A7SR713jf40yNmkr4obb2qQjzCM4D043RuIxIo6sv0IzBn4QboqjlY3XRGuR?= =?iso-8859-1?q?ZrkBKlX2jcVh2nXoNDEh85lIoG1cIX08oab1i/gz4PU7K3fQeffP7q1YybQz?= =?iso-8859-1?q?8zPPibk/G+Hwq3fRBr9lUCEJ97Ui38vA3bmDaB0EMIn8NMhrwVH7hA49L2AX?= =?iso-8859-1?q?2S7kWWrwMra65tgwEGFl6uibX/zt5kGhxzTXKlY5xyeNhvFEQzTFbnPao3iZ?= =?iso-8859-1?q?BFxUvOYnKJF5AmhmzYCLguRQPrdPV24uuAqYsbsPSD+a4ehhybwAd0f76OyJ?= =?iso-8859-1?q?XfD6zO9ipyZxnvexE5Ifef47l9To3mlX6yHk8G8qmHWL3iR68Lx1ra7Sqa8l?= =?iso-8859-1?q?BZoZ1E6iEltsh47wkGUBGoE3wmTrSruMPycF/Qej8hNid3yqF5IroJ/CvOon?= =?iso-8859-1?q?l8EyEpSILHNQuLb/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VM5OeYvG3D+q9O9Qstqat?= =?iso-8859-1?q?vQ2fVMnvg1+Z1cWF9p9977MxysFMwp2pO5P2boKHXzzHVSXh7ja1Dk71jIzq?= =?iso-8859-1?q?2l/kPJW/zD57h2KMaSnfvsV02w3mwNnvNCUYXxsA9gniZiQ+7eQDDjXJjHl8?= =?iso-8859-1?q?tA+nv0mE1QfkAhvdrWSnHi2fKihRn2wNUTWmndr1WInuw606wfJ5dVZtpE1t?= =?iso-8859-1?q?oqeVFrgUMuLrZDgZm6GobMovzXurd9knTgOMAUVGfKeGMLa8puKJrb5VCHNZ?= =?iso-8859-1?q?qnDn7/nc4B9C4LaBf0n6HRLmrsLYY4z6QlI1r98kmUD+0TmhgWS4/BP8EKlc?= =?iso-8859-1?q?=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: 3dc53e03-4bed-46a7-3b31-08d9b4d7250c X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Dec 2021 14:30:09.5406 (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: o8cQuIQNg4CuLMtoTRi8xVJ6orKXQLNcL4Bc2/0JaMHUeLbbLsPOctB38vOku70o0fYBoji3Ww/GFJL84loVAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4508 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10184 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 phishscore=0 suspectscore=0 spamscore=0 adultscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112010082 X-Proofpoint-ORIG-GUID: SjUfllOKfGfP5XDJMPA4kv8FZop_pmxK X-Proofpoint-GUID: SjUfllOKfGfP5XDJMPA4kv8FZop_pmxK X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 0E542508BB87 X-Stat-Signature: wakco6dd1u7u8nu4tz9o5jhyztpqcrau Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=Tg2PhGt1; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=EVr7FVJh; spf=none (imf05.hostedemail.com: domain of liam.howlett@oracle.com has no SPF policy when checking 205.220.177.32) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com X-HE-Tag: 1638369592-951853 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: <linux-mm.kvack.org> |
Series |
Introducing the Maple Tree
|
expand
|
On 12/1/21 15:30, Liam Howlett wrote: > From: "Liam R. Howlett" <Liam.Howlett@Oracle.com> > > Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com> Acked-by: Vlastimil Babka <vbabka@suse.cz> > --- > fs/proc/base.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/fs/proc/base.c b/fs/proc/base.c > index 13eda8de2998..ea17ee988158 100644 > --- a/fs/proc/base.c > +++ b/fs/proc/base.c > @@ -2323,6 +2323,7 @@ proc_map_files_readdir(struct file *file, struct dir_context *ctx) > GENRADIX(struct map_files_info) fa; > struct map_files_info *p; > int ret; > + MA_STATE(mas, NULL, 0, 0); > > genradix_init(&fa); > > @@ -2350,6 +2351,7 @@ proc_map_files_readdir(struct file *file, struct dir_context *ctx) > } > > nr_files = 0; > + mas.tree = &mm->mm_mt; > > /* > * We need two passes here: > @@ -2361,7 +2363,8 @@ proc_map_files_readdir(struct file *file, struct dir_context *ctx) > * routine might require mmap_lock taken in might_fault(). > */ > > - for (vma = mm->mmap, pos = 2; vma; vma = vma->vm_next) { > + pos = 2; > + mas_for_each(&mas, vma, ULONG_MAX) { > if (!vma->vm_file) > continue; > if (++pos <= ctx->pos)
diff --git a/fs/proc/base.c b/fs/proc/base.c index 13eda8de2998..ea17ee988158 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2323,6 +2323,7 @@ proc_map_files_readdir(struct file *file, struct dir_context *ctx) GENRADIX(struct map_files_info) fa; struct map_files_info *p; int ret; + MA_STATE(mas, NULL, 0, 0); genradix_init(&fa); @@ -2350,6 +2351,7 @@ proc_map_files_readdir(struct file *file, struct dir_context *ctx) } nr_files = 0; + mas.tree = &mm->mm_mt; /* * We need two passes here: @@ -2361,7 +2363,8 @@ proc_map_files_readdir(struct file *file, struct dir_context *ctx) * routine might require mmap_lock taken in might_fault(). */ - for (vma = mm->mmap, pos = 2; vma; vma = vma->vm_next) { + pos = 2; + mas_for_each(&mas, vma, ULONG_MAX) { if (!vma->vm_file) continue; if (++pos <= ctx->pos)