Message ID | 20211201142918.921493-46-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 1E474C4332F for <linux-mm@archiver.kernel.org>; Wed, 1 Dec 2021 14:51:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 991736B00C9; Wed, 1 Dec 2021 09:42:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 972306B00CB; Wed, 1 Dec 2021 09:42:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7E1596B00CC; Wed, 1 Dec 2021 09:42:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0068.hostedemail.com [216.40.44.68]) by kanga.kvack.org (Postfix) with ESMTP id 706CC6B00C9 for <linux-mm@kvack.org>; Wed, 1 Dec 2021 09:42:03 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 3822318014D3C for <linux-mm@kvack.org>; Wed, 1 Dec 2021 14:41:53 +0000 (UTC) X-FDA: 78869489706.04.F9E6FF0 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf08.hostedemail.com (Postfix) with ESMTP id D782930000B3 for <linux-mm@kvack.org>; Wed, 1 Dec 2021 14:41: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 1B1DDQ7i010080; Wed, 1 Dec 2021 14:30:47 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=tqPrir6koRRFrjqf9wOjElokkuLPQHtPNMHPuSAaZlo=; b=07et5cH8UZXxy3gewtVOxwmR09q09OJ1zoVNPuSuxh0J0H4b0On8YfYcuGmxS/oXh65z r0u8+DouWthu/tgsuX0QQ7eBjIGv5r+D8jgC0SDYri0fnsE0UhCo1enKz3j1ilNkzkay /d0EM2oFMS3xfYffYh8kQeoRp3J6MS/nmBlq5/p+8f5w9LjJ80yKh9Hzjx5b/pBZ826D idaGtTN1CwHi61RJYpfXinc76P676qst9Vq36b6nEBWjsCEFIN6WO2HPl7K/PlRiTfDl PykDAGNa+89E5nQPp6YAwyiS9A3nJW2OEAr/VgQUv+7mCyfMZfLAoHzP3kGyWxGcieLG Qg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3cp9r50e4r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Dec 2021 14:30:47 +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 1B1EUNPX108922; Wed, 1 Dec 2021 14:30:46 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-10 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Dec 2021 14:30:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mKEIZCy3e1h4KGzxwlYjKY0w8IZ5JeLcVgHrnkacttZ3wsj2BBit1HGfsOks4Lh/kybFZfUYC1CxVUoo0iu+pVM9WLlOwICrpPZ1ZO8kGQcb+RVLQfSEyFPtfOLS7ah4J1k3xi8CaXS722boQT+ODIoD12Yn1hPGTMS/RvxcMhwsHq23GRXiq2vumZrHjudlEM2VPr23lO3ZXjv7yRWxDXEnwqdjySH5+zMGmU214k4zy2gtyDJGvQ5/Jgmkth/rRHRAGEEjXHuo4aNzlSPwX6YWqQLh7HT7QukWaks6j+EB4F9yw4glrXQZns2Ihu+7uBh4NPZj/EEH6wOwg7Rc/A== 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=tqPrir6koRRFrjqf9wOjElokkuLPQHtPNMHPuSAaZlo=; b=KCXzpVUCBxO0Zc/C2T/dy251SoNJGRtoqIPlVWJpQPMIQsTw84BEWO/yEUOAka2fnBGFSBufENE790Xc3vcUP5Z9rll+3iguWG2/5Z2Dp3fZcCkvjNrOddIWUd0WZDRlEfBL/i+kchMFHeBi2+KU3/mmEpmNLcpVpjEWb6a42Z5IzfA01A5c/6HFTeaQGV/FX7lhUnEUab8BD+di5ZwXCEaVkmaNd8pz87d/h26RiIWrqG2iiO5SJkSTxk9JmN6bDd+GPwPjL2fCFnpEk4w98+BBvk0zh+0acScbs+hOnc11nxq86l3oZ9nrGFEyrw53oEYSxviqsXtl6FwIGAFX6w== 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=tqPrir6koRRFrjqf9wOjElokkuLPQHtPNMHPuSAaZlo=; b=zkhEFSFhCVB20aSwcS+GHIsBtw3PZOiqPLx7s1oPSUPQeUU0uMZUN4fvSOJE2jMrIk8t9BSO6eqWrVw+4Xo96V5P+IXOZHvU9t9Dfs5GRjlsRAV4J5k7mH4dYRamM6o1iQJkMdBUTwJ+0wzuyBJyHsbHzhZoKCtClc1G0Tx3sgc= 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:39 +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 45/66] acct: Use VMA iterator instead of linked list Thread-Topic: [PATCH v4 45/66] acct: Use VMA iterator instead of linked list Thread-Index: AQHX5r/y2ghSgebcHU+uy8mqLMZ5IA== Date: Wed, 1 Dec 2021 14:30:11 +0000 Message-ID: <20211201142918.921493-46-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: 717a5444-20cc-41c3-9b58-08d9b4d7257e x-ms-traffictypediagnostic: SA2PR10MB4508: x-microsoft-antispam-prvs: <SA2PR10MB4508F7A911E32D62A1E1978CFD689@SA2PR10MB4508.namprd10.prod.outlook.com> x-ms-oob-tlc-oobclassifiers: OLM:3631; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mKhli2NG32yrI/iWKa+uj/aLJ3lM+fKcZlV0T18cfRhqsNeJlOSvJ+fUGBFcSWgsEEYPokICaH25PCn/YqKFm8ZhGi7GyBfKj0JyFJPFqOvb4985F1P9BM/1FK0iQSrqH51+o6GmRZ99tIMLNFxD1SRo9BxGtRcINFB9dS4VUdEVUNe4sZSaiaHGi0U0yeN81rHZdGjOzVwwp8ebmUTJ2ryfIb/Xy0PQwtyxbAXhwjqEZwLUHYaTxbqo7Rfk1iW/eCl6NaIXv3FCvN+QkqFhYumkwnqiGGjJRncElzSSnSo5aHBo6gWvnnCFoK4VewsOsrwns+kK7UNlahgSRKl6PFx8roJN049ZQQd6IsNs8arwPHwN9aJxLVjyyM8+mmZt6lE9twhOeHuVZxPeI50QCfqogfv3NGgo0rBB13ZA47BC3lYq5oCaSJs0SMiRoR9Ge7V4wy+l4bgx1skFRXt5zV3Hu4/dkOE0oWprUb4+Igixcm8yVy6N2wc+pfcZhC8iINiArFHP06M4i3n3WdwJs/9GwpxZpRaJvLW2PH1BALzm5GZILotFeeuYTyUcwnJq3RfNqoxbA9FohVS5dTszS8/Rlc/u3NSWXoqJXe5mftBAJURLZHRMJH6zXK6gr9xQDuybBWojGWFJ33T9CvJPj0djOjUxY14lShGpcS6lQZUiywkKRHv3oK13tpp3461tytc4ZG1wS0ePFSHtntGpNw== 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?ftY6b4PwM1k9CvfFzkGyD05?= =?iso-8859-1?q?4ynkS2bp0AQgwVcVpqUxw8cg8P1G8Z69fX//2vgtI8sWwBUjKHGsOicnWnl1?= =?iso-8859-1?q?iV71DyiEW6DoDJhUa9HoOuB1DO+RN8REKUwW95IuLDjDpR+mKq/UbQLB5huF?= =?iso-8859-1?q?mIZm3/0UkmBIqvKvRGrAzzVjxBLVDLPXUCw8AmX3zhsKWc0anAOL6UWK7Tz1?= =?iso-8859-1?q?XVqnlsji0Uvv8zefo6hHTS6cZcmezyTNz4PefWcXoz8l0ajcDdIsBY73eaGt?= =?iso-8859-1?q?xKcSg3qdY4y/VjEQn9VLKcfmSRXzQSh5qmMhJ61h5PNGbscceZfy2pg7QpP7?= =?iso-8859-1?q?kidQelRDCidJnPuWICZ+nRM1m8tiXYG9i3vXukS6q1VMW5e7eodjyXgH8iej?= =?iso-8859-1?q?TYHkJsoZbzC5WIq3FgvS1Xq0YTh3Gi6rxgc8QU6z6mkFKBx1xqkdl2JwdcjA?= =?iso-8859-1?q?D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UBb2LpD5MjFMdwu2w28zatvYjVWD3Ts4Q3?= =?iso-8859-1?q?5pCd98FKB288WaNaeZTSohF5TMbO908/eZhkDEDaU/NDqzsENa0PXo7Jj001?= =?iso-8859-1?q?hp0AsbzqYhfubYmbYvU6vIGX1phc3dNpYEZH8N0cxmOMNkgG/iOYYXIdCGPN?= =?iso-8859-1?q?0rsjplR7SosjSKc46U8r3wLDMZ9yZSuZl3wCOT5NOUe63qfHztS//hrzSgBj?= =?iso-8859-1?q?pk2mkRCa5yLpYrf6WdOWhzSFeKXqIMr8kKOD6sbKs4pMOywYukkMBunAIvmV?= =?iso-8859-1?q?FnYxFPK5T5pznwo8OcRfRvTp5W/ENFck5EwotJnaO276gdG5grMXfmycKAgU?= =?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: 717a5444-20cc-41c3-9b58-08d9b4d7257e X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Dec 2021 14:30:11.0647 (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: n4Qmzs5h5rPjXb7D2toG3Wztv3VSQwMvi7XgO9YMgNf/9WhvRsLk1RD55DKnAMrcpWVhhlv+jOjErn03cQKVbQ== 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: Gk9lT7dD10hGVEihYRnoWQxXCZxqU6a2 X-Proofpoint-GUID: Gk9lT7dD10hGVEihYRnoWQxXCZxqU6a2 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: D782930000B3 X-Stat-Signature: x34fkxyhp9qt5wbiq5bjietgjhe9uydh Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=07et5cH8; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=zkhEFSFh; spf=none (imf08.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: 1638369712-941379 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> > > The VMA iterator is faster than the linked list. > > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> > Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com> Acked-by: Vlastimil Babka <vbabka@suse.cz> > --- > kernel/acct.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/kernel/acct.c b/kernel/acct.c > index 3df53cf1dcd5..2e7bf8d41f04 100644 > --- a/kernel/acct.c > +++ b/kernel/acct.c > @@ -535,15 +535,14 @@ void acct_collect(long exitcode, int group_dead) > unsigned long vsize = 0; > > if (group_dead && current->mm) { > + struct mm_struct *mm = current->mm; > + VMA_ITERATOR(vmi, mm, 0); > struct vm_area_struct *vma; > > - mmap_read_lock(current->mm); > - vma = current->mm->mmap; > - while (vma) { > + mmap_read_lock(mm); > + for_each_vma(vmi, vma) > vsize += vma->vm_end - vma->vm_start; > - vma = vma->vm_next; > - } > - mmap_read_unlock(current->mm); > + mmap_read_unlock(mm); > } > > spin_lock_irq(¤t->sighand->siglock);
diff --git a/kernel/acct.c b/kernel/acct.c index 3df53cf1dcd5..2e7bf8d41f04 100644 --- a/kernel/acct.c +++ b/kernel/acct.c @@ -535,15 +535,14 @@ void acct_collect(long exitcode, int group_dead) unsigned long vsize = 0; if (group_dead && current->mm) { + struct mm_struct *mm = current->mm; + VMA_ITERATOR(vmi, mm, 0); struct vm_area_struct *vma; - mmap_read_lock(current->mm); - vma = current->mm->mmap; - while (vma) { + mmap_read_lock(mm); + for_each_vma(vmi, vma) vsize += vma->vm_end - vma->vm_start; - vma = vma->vm_next; - } - mmap_read_unlock(current->mm); + mmap_read_unlock(mm); } spin_lock_irq(¤t->sighand->siglock);