Message ID | 20211005012959.1110504-35-Liam.Howlett@oracle.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=pyM+=OZ=kvack.org=owner-linux-mm@kernel.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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39D4FC433FE for <linux-mm@archiver.kernel.org>; Tue, 5 Oct 2021 01:32:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D67D761504 for <linux-mm@archiver.kernel.org>; Tue, 5 Oct 2021 01:32:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D67D761504 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id E9616940018; Mon, 4 Oct 2021 21:31:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CA83B940019; Mon, 4 Oct 2021 21:31:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE49894000A; Mon, 4 Oct 2021 21:31:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0230.hostedemail.com [216.40.44.230]) by kanga.kvack.org (Postfix) with ESMTP id AD050940016 for <linux-mm@kvack.org>; Mon, 4 Oct 2021 21:31:33 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5C74D2B37F for <linux-mm@kvack.org>; Tue, 5 Oct 2021 01:31:33 +0000 (UTC) X-FDA: 78660656466.09.484A101 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf07.hostedemail.com (Postfix) with ESMTP id E8D791001C83 for <linux-mm@kvack.org>; Tue, 5 Oct 2021 01:31:32 +0000 (UTC) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19511nti024407; Tue, 5 Oct 2021 01:31:25 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=LyNbhXd8/bp3QLzv1D5hi2iSlLg2YxMzE3gibNIb20o=; b=H6wkK3sVyUv0fjqSxS1uWPxaWqe158uFdHBjQbY8BbmaqSMXzguAxQrr98DzzfRMllOP AgoyxPBxGmdtbPZXaZlYJiAMTjLx6sla/zslD3f4W84RDlQCqdg9a8htAAAQHuIGihM7 +Md+b8X4l2xiwigEATIebF4yMB+dsM6SZ38hMGcQnUq5FdvYnngZoQktPX7ml/RZGB1o Kcxca+zchFVBecI78AZd/mx0exRHw0BFUga++Ffjp3Bk0UqjuJCu34AaeSsHrX+Yr4Z+ cZEy3FraJA6JJPhVENfZT9ZGt7PdSzDLKPYmybNo3gmV8+ay3RiWOzKVnnvfaHSVVt43 6A== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3bg454bvnw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 05 Oct 2021 01:31:25 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1951Tu3m056799; Tue, 5 Oct 2021 01:31:24 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2175.outbound.protection.outlook.com [104.47.58.175]) by aserp3030.oracle.com with ESMTP id 3bev7sgru8-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 05 Oct 2021 01:31:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ludf6ToKa/W3jkMoc7bJA72g15dtjrvdWZxnvbGLE+QYdlxLqbu3YfcvA8aZ0+p25HKDOMbiJu38I8wxrLYJ9JcbQsYuLd0eAXDgRx5YszgJMP02UOp/IJAsqtqdPekeletDcfpmsxChmcE2SyRpJsWB0ntdH/9/jsqpQT6acM7xYdfQBmINyBl1WZ9m10kzMvVGxl/Wu9JVshlyflyAIStB9IJm1I5xga+HpmdiHoL43GSCA5MpMwQ6y1OmlZOUthU+yq/iOZET9P5qVBE8bV3O02nCC0vVKS1s9tPCgyBfF6w6pOwDc1Pfj2ySZQztrOWGk2GGOEcHQViUnTfA9g== 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=LyNbhXd8/bp3QLzv1D5hi2iSlLg2YxMzE3gibNIb20o=; b=X9STCAfeh0gYBn1gcKUZGx+VuacPt4qY2g+CR8cOiMG1zHKTzivp+mUj1aI/fS7A9bRJAd9LWTjQXnM32al/VXvrQT86F1u2p9svEYogZOQ+Jq2nnVYFZnLHleuOjUbqu98UyQEZBEPDvff5XGwA97bBb0EMUi1cSyToY1xv15HfvbhJ/OgHiCJdFjWbAdBwx5E9JRWDn0tR8bFgpVuS9YfBEFPCB2xSgI5slkJonSBgRO9GjAkXUc9LrK5nKQFaZqroSRxk6zSxIMovmbko8Arqg9BLeQuI8vZCIwmlsudR1mPQ0IrXowgWXdZb5P4pzmH7mM+d1uszidugKUqJBA== 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=LyNbhXd8/bp3QLzv1D5hi2iSlLg2YxMzE3gibNIb20o=; b=lHnpgQ4gJTO66eEk+172sEUVPPeLmuxeAF2+pe+RwCpnFhPZG5vkZ6vxVBlxcN0bjEi8DwG+Tehdzt21ztoMfah5+Y/XrnxfCtXhBDyODmqwB6j8SlrEEyGq7tibDMYndfTW808BqLjcdZmYxDDt0yUCfoA4yb5MoJjnHrddJDQ= Received: from BL0PR10MB3011.namprd10.prod.outlook.com (2603:10b6:208:7e::29) by BLAPR10MB5044.namprd10.prod.outlook.com (2603:10b6:208:326::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15; Tue, 5 Oct 2021 01:31:21 +0000 Received: from BL0PR10MB3011.namprd10.prod.outlook.com ([fe80::6d61:54c2:40f0:93a]) by BL0PR10MB3011.namprd10.prod.outlook.com ([fe80::6d61:54c2:40f0:93a%5]) with mapi id 15.20.4566.017; Tue, 5 Oct 2021 01:31:21 +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>, David Hildenbrand <david@redhat.com>, Douglas Gilbert <dgilbert@interlog.com> CC: Song Liu <songliubraving@fb.com>, Davidlohr Bueso <dave@stgolabs.net>, "Paul E . McKenney" <paulmck@kernel.org>, Matthew Wilcox <willy@infradead.org>, 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> Subject: [PATCH v3 34/66] fs/binfmt_elf: Use maple tree iterators for fill_files_note() Thread-Topic: [PATCH v3 34/66] fs/binfmt_elf: Use maple tree iterators for fill_files_note() Thread-Index: AQHXuYihhMmdaYHnqkWDFnRa5fSZ6g== Date: Tue, 5 Oct 2021 01:30:50 +0000 Message-ID: <20211005012959.1110504-35-Liam.Howlett@oracle.com> References: <20211005012959.1110504-1-Liam.Howlett@oracle.com> In-Reply-To: <20211005012959.1110504-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: 7e64bc8e-1286-4096-ba27-08d9879fd622 x-ms-traffictypediagnostic: BLAPR10MB5044: x-microsoft-antispam-prvs: <BLAPR10MB50445E7BBBF5BB9316E60EA0FDAF9@BLAPR10MB5044.namprd10.prod.outlook.com> x-ms-oob-tlc-oobclassifiers: OLM:3044; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: qnbMrI4l7TqAeC47XrNvuXPFWP/2gfiKLkwKsCKiYV+CPzkzHYBdlGKGLOsvXyNwaqfm7RvOc1LRRBu4yAo6e3FaZi4z82ZeoWy+/I7Pw6MsYhGXRMFJqYLmyze44nxcgDDEBC39gku1VJJhNOzaWrB8YHphm9u8EgXeBK8hxmphD93y9BFy0ACMPUDRs9i4ANxr8NXgS7QnTepki0+rUulAIHfLiEPNLjRcVMQho7w1F+C580xoTCNtDRZn7aBDb9tyjOxaVk3HTjdHwK2TIi+UVwIs06BJgi6N7OQq5v1XcMi/Vajo0K+CSF6KfHJgKuq2N66/FnYpIK+ILbixX0JLeZDzz/E4NyUtRMHrtVce7YpwSwBzXSCV+8jLGk/YGecBrADtrYSCMm0b4R33589e8Qq3/TWL+j544T6rqTWljHmrlS7SdcZgIL/bdFxQ07GuS81B/WabrUmMjHyJvCWGPR3nVzq4mI2u8mX7o7koYLtTAyoD2Y53Erx856aasa1+tl7ajf2nVr/i9mXy2XBPtCtabifo3DZqPWh5pvgNNZ5bwGJgbWm8GnecYvZujLz/KAJunB2Mkcu7atJNkTbhd56ZEDVGJfboh3ilPNNljICAJQXLBd1FKoD1eBHz2vCZUaZ4pVxZozUzbGnUewHTWnw/Z1rYbt8c3zHtv3m4qfyaSc23EIJZD2+VKQbVmoO3rHcf6abccuVe3wMSng== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR10MB3011.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(110136005)(71200400001)(8676002)(86362001)(6666004)(6506007)(6512007)(36756003)(316002)(8936002)(54906003)(2906002)(83380400001)(186003)(66446008)(122000001)(26005)(7416002)(6486002)(4326008)(508600001)(2616005)(66476007)(44832011)(38070700005)(76116006)(5660300002)(91956017)(64756008)(66556008)(66946007)(1076003)(38100700002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?au2DVrENJUZaL1RHLihtmFR?= =?iso-8859-1?q?vC0NyW1YRdaPHabl/HbIhouUlLwko+aUEji1/5r1j79Wy/imvaMyAzpnHArC?= =?iso-8859-1?q?0kromnvA5+S+bVOc2c8ggfie8vW611X/OWlhaLB69IRmDvhp+suxS4xVJm8Y?= =?iso-8859-1?q?GCow0crun9BxQ0dTRXIcODJTas0wzsywpbWQu4Ad0gae0jGStCcFMp8CAAM5?= =?iso-8859-1?q?Q0YaaS+Gad7FuWx/gpufTfwlmKnX0XI21VybQneb0ZhCaA+9gGZR+oUo7WGJ?= =?iso-8859-1?q?PxeUImQbATP9fZKOe7fU7eqYF5xbVcDzjwx4PYkSQkMKwvrfDtadT3aLeH34?= =?iso-8859-1?q?b2h3/EApOoys2ubie0GPMPFEIjeRvjg+kdYeb2rsw83qh2fFROlpVbc17ssH?= =?iso-8859-1?q?vcL1j26Ir/9mm4fFpFkxd/BdMvt2LIBZwLtJI/w4ur4gppjoIGVGn48WNLPE?= =?iso-8859-1?q?HSyASAzv6VAAdGeHVzgQyXEB+u3eYLfdifnkanba9es3SXXn0OzgCM5G3nOj?= =?iso-8859-1?q?I9EVk+7YSJzMbYzPw2JpXu0nmMU7BB0jJ7XZ2ruY+B9/DGRD1w4ToHvc/uQt?= =?iso-8859-1?q?1uWExlek4nER1RIHZJzuFbtrHJ0ykoOwN3WU6kh1g43DqyH3FJEESVGOGZEZ?= =?iso-8859-1?q?TLv9oBEYaDo9+F1L28liBQXoaNyGvQP9y+dbggT4E68iUJFG5tWDhRGJe+9f?= =?iso-8859-1?q?JJEVI6kHmO50ga306+R5W6lRTK+hWCkJoXpYbGdW0MYV+mC6t6LkzWz25L0e?= =?iso-8859-1?q?1gBPF/krniQ/vTyMpnlV+zu/NsFuyWpQXLBtPmfRsRDIwuE+un/POEPjS5u9?= =?iso-8859-1?q?b18ApN/MXLKPaqpgXjH9b8fO6Nf4ReqA9pXFwtCPttjCDz71vnPvPGUKA0C8?= =?iso-8859-1?q?i4NMHdmdP72RZnZO1nWKWm/WADStXrePFVG3cUQvv6D076MXB7yV89qorq//?= =?iso-8859-1?q?5hQJ1BIBGuzV2WqnnmVCvrWdfA8okboAMlV/R3wwbMoqT6fot12l7SQE2aZG?= =?iso-8859-1?q?Cq6DxhJPzYVeXxBORISBmsZPtK6c9VgPhQejLn8+nOEYDmGyGBHeGJqAJvGM?= =?iso-8859-1?q?L/Qzkm4ePdQUOB+m7ly+AwRE87yWsJVARP9/2ua1rFrKXDkqxwDyGStcJgi7?= =?iso-8859-1?q?4BKcUgOXqnltdQEUE97mOSXWheHz574ujOKEHgjcXrGpOI8yke7WgY/ymv0G?= =?iso-8859-1?q?XI3P35x2170UnRWWZtG35ZcvdKObdR5J8Ccp5v9foDh0bvqEbsz1nbFZMGRL?= =?iso-8859-1?q?DEJdqI507JxpSxwMJEaqavAjwe4/ybPRK4bBX+1h5zwEm4Y2AC0Dt31PEzUV?= =?iso-8859-1?q?e6ctey6qDacOOImAqwkeVM3cWdPuCGVW0R7ofY1fOJQvkfbatf0WJVZdLtKc?= =?iso-8859-1?q?x?= x-ms-exchange-transport-forked: True 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: BL0PR10MB3011.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e64bc8e-1286-4096-ba27-08d9879fd622 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2021 01:30:50.8038 (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: XNn46RkY0ab1Af0cpzKX12zNh44bRHHgEQUEoKDdsOE9OSPGL6z0O9RYYeq0UFM7+1K8wNo9aLUUc1YBurxhzQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB5044 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10127 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 suspectscore=0 malwarescore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110050007 X-Proofpoint-GUID: Krj5f1_z1nPM2ZuncAcWfj_aID8IFwRK X-Proofpoint-ORIG-GUID: Krj5f1_z1nPM2ZuncAcWfj_aID8IFwRK X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: E8D791001C83 X-Stat-Signature: yuinrb7bmckxudcee7d46t8o439ttuqr Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=H6wkK3sV; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=lHnpgQ4g; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf07.hostedemail.com: domain of liam.howlett@oracle.com has no SPF policy when checking 205.220.177.32) smtp.mailfrom=liam.howlett@oracle.com X-HE-Tag: 1633397492-610737 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
|
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 69d900a8473d..2954f5c5e87f 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -1614,6 +1614,7 @@ static int fill_files_note(struct memelfnote *note) user_long_t *data; user_long_t *start_end_ofs; char *name_base, *name_curpos; + MA_STATE(mas, &mm->mm_mt, 0, 0); /* *Estimated* file count and total data size needed */ count = mm->map_count; @@ -1638,7 +1639,8 @@ static int fill_files_note(struct memelfnote *note) name_base = name_curpos = ((char *)data) + names_ofs; remaining = size - names_ofs; count = 0; - for (vma = mm->mmap; vma != NULL; vma = vma->vm_next) { + rcu_read_lock(); + mas_for_each(&mas, vma, ULONG_MAX) { struct file *file; const char *filename; @@ -1667,6 +1669,7 @@ static int fill_files_note(struct memelfnote *note) *start_end_ofs++ = vma->vm_pgoff; count++; } + rcu_read_unlock(); /* Now we know exact count of files, can store it */ data[0] = count;