Message ID | cover.1638976228.git.christophe.leroy@csgroup.eu (mailing list archive) |
---|---|
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 24890C433F5 for <linux-mm@archiver.kernel.org>; Wed, 8 Dec 2021 17:18:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6143E6B0071; Wed, 8 Dec 2021 12:18:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C4486B0073; Wed, 8 Dec 2021 12:18:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4177B6B0074; Wed, 8 Dec 2021 12:18:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0099.hostedemail.com [216.40.44.99]) by kanga.kvack.org (Postfix) with ESMTP id 2FC496B0071 for <linux-mm@kvack.org>; Wed, 8 Dec 2021 12:18:31 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id ED55D824556B for <linux-mm@kvack.org>; Wed, 8 Dec 2021 17:18:20 +0000 (UTC) X-FDA: 78895285560.25.3908182 Received: from FRA01-PR2-obe.outbound.protection.outlook.com (mail-eopbgr120048.outbound.protection.outlook.com [40.107.12.48]) by imf04.hostedemail.com (Postfix) with ESMTP id 069D140002 for <linux-mm@kvack.org>; Wed, 8 Dec 2021 17:18:19 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TvfIuj6XLntxsQhUMOwcqc8s7Vo12YjsGFO7wxtVGUqHeSUsHdbkJCt1/fSO4XBHFYxWZUBc7A8SlzAjop1c6rJvKIr1AupAxrW3RGlSFb4ujZogLUG+pFNiGif7Ep1OnkZgz3XtoCwZN4iSMybd1auAp9Bjh8yk3xzVqBUi7UIU7BlxKBPRKga1IUuoHR+gy9qpvQ1Rot3uBEDiIt2s8cj8z5uPqsONKVBtNcvUsIquZI9ggxyQu6OMss0e8VA3231zx92BjutVAqbnYgm+Bs82qssbWqedijs5w+ou3kcdKToX0ZEBc/oUWD7rYhm5e2X0f1KVImX5NTG52a36vw== 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=7vbiVBTJEobY9e+IVs/nlsYXfKIAmFcHorRmD9PDUls=; b=XnqL+8k6Skj8XgsH1T9rDT7YMvgFQ2cboj1kyu0xfnYHEzibvCN8uJE8kGhrBrr58Pt7kxxUcMDMFDf90+G9XcoJzKzFZ+gKQulTOtgfqbjC9pQEiIILqohEdrVxnsNQQNmEeEKbMMScNOWxxHYBgViWkb4+DGdzstCQ16Longy3yzacsKF4wK5sxWcJTXqaOpDDOSlucgIaFvzLgnY2rH6MejTznQH2QtFvGJFOVi9G+L1O7jQuSFcP3xXWKaMdjuxoCH/+ZsCUco1GL2TP9gKobbD66BLFU2oRK/3lPP5/0uAS7bTugwWnp0S8Bzv9Ccab09EYyCXoGbQ70b7V8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=csgroup.eu; dmarc=pass action=none header.from=csgroup.eu; dkim=pass header.d=csgroup.eu; arc=none Received: from MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:31::15) by MR2P264MB0228.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12; Wed, 8 Dec 2021 17:18:17 +0000 Received: from MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM ([fe80::fc67:d895:7965:663f]) by MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM ([fe80::fc67:d895:7965:663f%2]) with mapi id 15.20.4755.022; Wed, 8 Dec 2021 17:18:17 +0000 From: Christophe Leroy <christophe.leroy@csgroup.eu> To: Benjamin Herrenschmidt <benh@kernel.crashing.org>, Paul Mackerras <paulus@samba.org>, Michael Ellerman <mpe@ellerman.id.au>, "alex@ghiti.fr" <alex@ghiti.fr> CC: Christophe Leroy <christophe.leroy@csgroup.eu>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>, "linux-mm@kvack.org" <linux-mm@kvack.org>, "akpm@linux-foundation.org" <akpm@linux-foundation.org> Subject: [PATCH v4 00/10] Convert powerpc to default topdown mmap layout Thread-Topic: [PATCH v4 00/10] Convert powerpc to default topdown mmap layout Thread-Index: AQHX7FeWpNWmw2j+bkaG2xB080sVTg== Date: Wed, 8 Dec 2021 17:18:17 +0000 Message-ID: <cover.1638976228.git.christophe.leroy@csgroup.eu> Accept-Language: fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f696c67b-593d-462d-b02e-08d9ba6eb986 x-ms-traffictypediagnostic: MR2P264MB0228:EE_ x-microsoft-antispam-prvs: <MR2P264MB02283C6FE4223A96CB8DD636ED6F9@MR2P264MB0228.FRAP264.PROD.OUTLOOK.COM> x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cQKnLdfVn0tNemabxQPa/lKC7jCpvkp63sHjJ/mao2UHOnpei0fXOWRKOceTHZr0b2zHR7jkLbQIQV2eEXfRgVh8QGrZEPMNBv/toKoGi3BxlTitHXdlWiWua6BwD9o72lMyvKzkS/co/3l0c2pt3iKMjMnEXlouC5YkMzNPGVYfaqhelVW7+y+DzDW0lGpa5f3dmwIXxL4k5BMHkXQiId8KJc1JmMAD4aCeP7Dl0RSWcIu2QdIA068n+5MKKedxeB14j0iK9mjWPyQ7TfzoyVDqITo8jJifC8A0K3ZNWllAkp10864NxKDGS5sIGbLkb1ZONXmA25BYgrFhQ+P2RJruc3ZUSpfCI5yxiRKw+PkXoJdgM/s9KcfitXUjRudyr+/a/o165uzgGKwRWgyJpsX/Okaw7zyle286LkmOOx66VQZof12k/P5VOlNJYsF8yrsHr9qB8mYEv3bUI+VhpcP46+EvO/GN2vF7O92htlufzQKbbp35JhapwlKrOGNfCNTi5xdKgxO8ZXIWYgYY7ie1yfWuPJeG1F4yMl6x+KjiRL/sGKuVC09VTHv8eIaYKH8AylBBkDrrOeHixp12Lom8WNZ7onAie+IhYQ4HFsOgXsHoTJ7bomBj1ogSPI4MPh8n6RW4rYv+768bRZzqe/pkssX3lZYFCOOH1/oQdV2dnD8Vcl3ieI9t1k3mQ94FkP4gfjAIdU+kN56yibjl8g== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(4636009)(366004)(2616005)(91956017)(76116006)(66946007)(122000001)(5660300002)(38100700002)(66476007)(44832011)(6512007)(64756008)(66446008)(6486002)(66556008)(8676002)(86362001)(4326008)(8936002)(54906003)(508600001)(36756003)(71200400001)(38070700005)(316002)(83380400001)(26005)(110136005)(6506007)(2906002)(186003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?A0F/Qd0nfiJCMuIy5Wtj7uZ?= =?iso-8859-1?q?9WyHpiUZ+giW00ZNlG8lDgXqr3GjK1SZIttZUnX72CsATmg56NRS357RIvGA?= =?iso-8859-1?q?tTwVbtQkYgECmjWbnKUQF5x1nwuSDbYtWZwu/verLhjDWu1i5ibBgH1Hy4xG?= =?iso-8859-1?q?PjgzGUT/HRSeLLc0Hm6ZyOMqPhF0cd4OEdC6Rs8dhX2dTBA51ilpn+q47kzX?= =?iso-8859-1?q?axaOkJAVKB/25HPBtEbHbDz0w2B+Yu5I3as3aTLAefW8f2bUK6h2FHlb/NgG?= =?iso-8859-1?q?d6oqLVubU3Ceglvge4lX/sqe5gPX1/7YjUADoa08DyKGkzFZv/mEKv6JoBvK?= =?iso-8859-1?q?r0NJQEhM16nIPcaEDRsmpBwMeNab7A8DOmL+DXQ0MYGEoLBnayjO0q5spmVx?= =?iso-8859-1?q?Vg4eVwDRo+YmaNRo0K6xdA0QNVtxsYqu0fkxKMenYVmoDF6952u/S2FUpLLM?= =?iso-8859-1?q?TASzGd/yjAj3qJvgb5CuM6IvrYsLJLSHbV9TekQnG8vqo70OcWKm3lC7AHri?= =?iso-8859-1?q?p/5JG3UvW8t77xtHFCAAwoNz2IlQnSzd/OllAlEsi+UrVt69pzfla601PY2T?= =?iso-8859-1?q?ImKsiD3rd3sgePSsWBH8QntjxszHFgzxf1dDOQ+5xKYvGtIpMA63rK2kMchk?= =?iso-8859-1?q?Vc5akellZhtGKR/JNI6aO9nd66mKoTsnLbwgajoqFoMI0ZglXVBusbW/4/3o?= =?iso-8859-1?q?SOeeUNU6XtrDdSYbDLntFsFGMo7r8leF5/pIES9qI9ZTWXs5rOWYM29PbCXX?= =?iso-8859-1?q?msmpFPpBqx8DzxJXosFXn7hGgb5tqWsvAZBumAbG9WuXPmfaK1p//k3KV8Yc?= =?iso-8859-1?q?pwTvqmIuvk+f9dysGT9saSvUBhKoJ90wubsvzUMBMkiEKH1hy2JGzDVlhY7L?= =?iso-8859-1?q?/C0JBAcRecUQE5naGL9Mn6561uUlDc5v6RNDbDSru71wfb34ElOCIJgwMgr3?= =?iso-8859-1?q?9LAl1Rm4gNZU++oOfREZm6VBH4a6KzuuGGh3d5fzpg1AvVpuJP2OARR0iMzZ?= =?iso-8859-1?q?gaG5inHKBYK733GG75ge7LS0uB3/vjwLfOICAB6+XpUxnCFQB+L/ZnP5WKp1?= =?iso-8859-1?q?AEpzyd5/bLiEaKkesuYUprJJERXvQJz1OsV7yKhesGF+eAA8AFtMawrzZMFb?= =?iso-8859-1?q?fwGqtyVi/VZE+eYINuUQ6cY54QIcB6UibOyJH8b+OOc0mqfpYt4QZTxqawJE?= =?iso-8859-1?q?aHPIN3vzXjwLxQ2i+eMn5LonLfHFQ7XJhWH7ty73EygaeM/wjgZCLjgiebWc?= =?iso-8859-1?q?OAVTq6jwjBc590f3U7pqG0QN2j77H1Zwb6HGg/AuEhHidn5cm0l42vONLoRA?= =?iso-8859-1?q?p681ZnZ7fM8YYFlV9UmcN8w7Qq4L4C1XPw0+iDiN+UmlMqt4UNzK5Vy2CFgZ?= =?iso-8859-1?q?tmSz0xfwjErsHY3fNLB+4WzhFjEwgg2aS1qO8ifR7MwjGHT/vPrd//f/ki07?= =?iso-8859-1?q?oCJPbL+/YQZyp7SpRw8TL/RQ1E+OOsnQcAn3AP6JB0kYASMHg2zxUVwDtlqZ?= =?iso-8859-1?q?X20ZgqwbjvlmXFvpvGxMQcfHoNzEPqsdxbRk/uPwaa+oQ5u/SWBG7snp+N4r?= =?iso-8859-1?q?WP2bdpjgO7HakZCwV5IoU9s0E5SUpjEyTP+nBDmnE0f8299jO8CvOS1QyXIh?= =?iso-8859-1?q?1wIvmuNzZMDO8QBG31/CfZU9Z8xlBVD3Pq6gC3jE2Auzu2gurV8erYVIjGwv?= =?iso-8859-1?q?LGVL6eLcDzOwsqsadJixVRHphRuDvolnZzWzbSt2ChEE8LXuQ0Imdyfb/vm4?= =?iso-8859-1?q?2Wuw=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: csgroup.eu X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: f696c67b-593d-462d-b02e-08d9ba6eb986 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Dec 2021 17:18:17.0540 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9914def7-b676-4fda-8815-5d49fb3b45c8 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vkGnQDKXslgBy5m0aaC0dXUkkDKF/YGs+9O7f2SHtNXYGJLoCMD42ReOh6DJdpUQwzpfTjWoUvZ3sddxrvaTgdDKFiMvUwnUjud6/821f/o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MR2P264MB0228 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 069D140002 X-Stat-Signature: wgnpturo5jipzpq8ncz7sjai7igfpxtz Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf04.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 40.107.12.48 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu X-HE-Tag: 1638983899-486843 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 |
Convert powerpc to default topdown mmap layout
|
expand
|
Excerpts from Christophe Leroy's message of December 9, 2021 3:18 am: > Unlike most architectures, powerpc can only define at runtime > if it is going to use the generic arch_get_unmapped_area() or not. > > Today, powerpc has a copy of the generic arch_get_unmapped_area() > because when selection HAVE_ARCH_UNMAPPED_AREA the generic > arch_get_unmapped_area() is not available. > > Rename it generic_get_unmapped_area() and make it independent of > HAVE_ARCH_UNMAPPED_AREA. > > Do the same for arch_get_unmapped_area_topdown() versus > HAVE_ARCH_UNMAPPED_AREA_TOPDOWN. > > Do the same for hugetlb_get_unmapped_area() versus > HAVE_ARCH_HUGETLB_UNMAPPED_AREA. > Reviewed-by: Nicholas Piggin <npiggin@gmail.com> > Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> > --- > fs/hugetlbfs/inode.c | 17 +++++++++++++---- > include/linux/hugetlb.h | 5 +++++ > include/linux/sched/mm.h | 9 +++++++++ > mm/mmap.c | 31 ++++++++++++++++++++++++------- > 4 files changed, 51 insertions(+), 11 deletions(-) >
Rebased on top of Nic's series "powerpc: Make hash MMU code build configurable" in today's powerpc/merge-test on github This series converts powerpc to default topdown mmap layout. powerpc requires its own arch_get_unmapped_area() only when slices are needed, which is only for book3s/64. First part of the series moves slices into book3s/64 specific directories and cleans up other subarchitectures. Last part converts to default topdown mmap layout. A small modification is done to core mm to allow powerpc to still provide its own arch_randomize_brk() Another modification is done to core mm to allow powerpc to use generic versions of get_unmapped_area functions for Radix while still providing its own implementation for Hash, the selection between Radix and Hash being doing at runtime. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Changes in v4: - Move arch_randomize_brk() simplification out of this series - Add a change to core mm to enable using generic implementation while providing arch specific one at the same time. - Reworked radix get_unmapped_area to use generic implementation - Rebase on top of Nic's series v6 Changes in v3: - Fixed missing <linux/elf-randomize.h> in last patch - Added a patch to move SZ_1T out of drivers/pci/controller/pci-xgene.c Changes in v2: - Moved patch 4 before patch 2 - Make generic arch_randomize_brk() __weak - Added patch 9 Christophe Leroy (10): mm: Allow arch specific arch_randomize_brk() with CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT mm, hugetlbfs: Allow an arch to always use generic versions of get_unmapped_area functions powerpc/mm: Move vma_mmu_pagesize() powerpc/mm: Make slice specific to book3s/64 powerpc/mm: Remove CONFIG_PPC_MM_SLICES powerpc/mm: Use generic_get_unmapped_area() and call it from arch_get_unmapped_area() powerpc/mm: Use generic_hugetlb_get_unmapped_area() powerpc/mm: Move get_unmapped_area functions to slice.c powerpc/mm: Convert to default topdown mmap layout powerpc/mm: Properly randomise mmap with slices arch/powerpc/Kconfig | 2 +- arch/powerpc/include/asm/book3s/64/hugetlb.h | 4 - arch/powerpc/include/asm/book3s/64/mmu-hash.h | 1 + arch/powerpc/include/asm/book3s/64/mmu.h | 6 - arch/powerpc/include/asm/book3s/64/slice.h | 24 ++ arch/powerpc/include/asm/hugetlb.h | 2 +- arch/powerpc/include/asm/paca.h | 7 - arch/powerpc/include/asm/page.h | 1 - arch/powerpc/include/asm/processor.h | 2 - arch/powerpc/include/asm/slice.h | 46 ---- arch/powerpc/kernel/paca.c | 5 - arch/powerpc/mm/Makefile | 3 +- arch/powerpc/mm/book3s64/Makefile | 2 +- arch/powerpc/mm/book3s64/hash_utils.c | 14 - arch/powerpc/mm/book3s64/radix_hugetlbpage.c | 55 ---- arch/powerpc/mm/{ => book3s64}/slice.c | 71 ++++- arch/powerpc/mm/hugetlbpage.c | 34 --- arch/powerpc/mm/mmap.c | 256 ------------------ arch/powerpc/mm/nohash/mmu_context.c | 9 - arch/powerpc/mm/nohash/tlb.c | 4 - arch/powerpc/platforms/Kconfig.cputype | 4 - fs/hugetlbfs/inode.c | 17 +- include/linux/hugetlb.h | 5 + include/linux/sched/mm.h | 9 + mm/mmap.c | 31 ++- mm/util.c | 2 +- 26 files changed, 139 insertions(+), 477 deletions(-) delete mode 100644 arch/powerpc/include/asm/slice.h rename arch/powerpc/mm/{ => book3s64}/slice.c (91%) delete mode 100644 arch/powerpc/mm/mmap.c