From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 1789EC4828E for ; Fri, 2 Feb 2024 19:43:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A8E3E6B0072; Fri, 2 Feb 2024 14:43:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A3D3E6B0075; Fri, 2 Feb 2024 14:43:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9058C6B007D; Fri, 2 Feb 2024 14:43:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 8280D6B0072 for ; Fri, 2 Feb 2024 14:43:12 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 561B840678 for ; Fri, 2 Feb 2024 19:43:12 +0000 (UTC) X-FDA: 81747887424.08.33C89D1 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf24.hostedemail.com (Postfix) with ESMTP id E1284180005 for ; Fri, 2 Feb 2024 19:43:09 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="EpDr/jIG"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf24.hostedemail.com: domain of broonie@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706902990; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=I8CBETRKm6ZXTVdpffhprmzaPKcRtGU5hZf5Edps4+0=; b=KcH8pBeZ9NQcTiqU2GZF+/WuCjuMMpgWZIxiygHPNP31SNHhnRxAL3LkX0kVk04Ra7NHzF DGnZVF66iLzwdG7/rr0a2L9he8qTRKoQVCSNUTlYGUGKb+N/Uaon5xeIKgvo55pojtEryj iTAZy9Dz5SVoWw0qwOQjdiuLZvt+0JA= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="EpDr/jIG"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf24.hostedemail.com: domain of broonie@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706902990; a=rsa-sha256; cv=none; b=rwrth+3RvDA1Br0XJYRgyXkQC19Vv0dy1ADlXa2yfcOFkh2v8rLfOojjVLsAXnWMIVtdka td/oXDbncIlqSPwPL70nGvfocvddkGaMN9y3YOoykoO6kySXbvcUH2AQiqbNLOj1AyVF45 E5wTGNB0acl/hUc2qwnRu5yPQe/WD4w= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 922D9CE2D92; Fri, 2 Feb 2024 19:43:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E23E1C433C7; Fri, 2 Feb 2024 19:43:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706902984; bh=ZwrgXHe3wneQypj3Dc4bf/lJKHWeRZdQb8qhTrh4M5A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EpDr/jIGnKGsGpiIqxEkGwO5QRX44YnioBJP5jAu4/eXq5DBe9xAuGNNELCpLD7kq +wJNNAqksWRpk4f46mxTI5MfKKahQM37DWqTG+rUe64NW1E0DnCTmhwdxbXLHulhrh KJfEApVOmLIAihRN1NZsj7M8S2jxmqk+XritSl7sbkFivXBSkgtkbmuiYPAXRaNnfD AUUS3aNnBHaBTjPqxDdF4e+u8vg6QyHrOozmVZUixNfIyOlIfIuItVGod/dQZKzGA2 Kni3bp/3QOsyz6fB7+ZTqfahBC8hAY+Zhtn6zsChSc47sjXTDNra5G49yaijHrVJKq nsqmjGNzMoZTQ== Date: Fri, 2 Feb 2024 19:42:58 +0000 From: Mark Brown To: Dave Martin Cc: Al Viro , Doug Anderson , Christian Brauner , Eric Biederman , Jan Kara , Kees Cook , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Oleg Nesterov , Catalin Marinas , Will Deacon , Linux ARM Subject: Re: [PATCH] regset: use vmalloc() for regset_get_alloc() Message-ID: References: <20240202012249.GU2087318@ZenIV> <20240202030438.GV2087318@ZenIV> <20240202034925.GW2087318@ZenIV> <20240202040503.GX2087318@ZenIV> <20240202164947.GC2087318@ZenIV> <20240202165524.GD2087318@ZenIV> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5nsJ0jp73mUS/QGW" Content-Disposition: inline In-Reply-To: X-Cookie: Do not write in this space. X-Rspamd-Queue-Id: E1284180005 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 1764wrybj3pggf5wo564upzuhmhws5f5 X-HE-Tag: 1706902989-570142 X-HE-Meta: U2FsdGVkX1+ELLdstFdxnLYpHDPCYIk+ma16c2F64g8iFtNDmM9Vye3nBE647uoDBRhCIRiRT+iyp9wO4FpzE7jMWfnaAMlZX8IzcmWkh3xOlOUHWNoDu8/MFJqtO4ylEiQPZCbWbeEWJlRxT2Y0oWyPcStox2MHMG7Zri6zmpVoxl35q+NDm2aMRfr9d/GHWJAiCqn/yt+gtYmMaQxjXuJMqDG8O2RCN21rHnws+LC6ancYHQ+IiJZ0/nyQIouOd0Au+HieZXF/znu/+kHLxFnvDYBptYKsKgAaTtVOsjp9Qg2v7//2Vnek+hBWuSx0oojacA5q/Fq+oNjb/6T0pldH2rAWIAr2bsgDdok2bKolQcWYl8yCCUw+nNEUNbufWM3TuTm/mjCKWCJosfXn3n1emmXb3jwkoZCWo9DVCwx/THCD3P0y+FLEFQLwyvE/etmsVCqsNKjj8w17Mzlqy/miu/BtAj2UqOlnoHx4wmLezN3Acg9dOxC8iFM8JVrivYxwR5KU9IBYIaRfofr7RZoSwg0bjr61IlzEn2VYf/4jGWD4kxCrEBMV1pzGXFI4xtWa9RooCXjOirZ0XVqLuqYW1vT/j3BbzYE44IFDS8tmctqUUdzQksOdt3AeAgtsPc6JIPBjL63h5fBdEHscPdkFAAOcTfdXICh/JLnXkcSpacT4CSNnGSKbR47Uo1w4U7NIFwruaBNelc7+JlRozUvjjooCfDIZ1KC5nr5kcjrxiGV+8/gLDeoyu10OFmHgEA8zJEnOllGt0QSRT1Tns4xdH1nv4uRQPwpxBk4Pxvnfu7hu5keHa8w4aAsv3qgqxE7M6vGj72dcmd9zmB+r2O/i2YFoYoppv0XO8iQUH5YikSSXSdw0Q7w7V5QKvQFT5srh3lQxhibdU5zAlBCu7kNE40jMSSe4OONbhVq+12UkbRGadrYuv2waR4gkW1fSlqS7Rjh05wYYKvWvWt4 yzABkpmD PqFO1SPXiNHoxK++Z18xczYlG5797W2RpZlAR+gl7MyiGWjR27A6bgQpDgjDb/bzQwb0j+Sbg5p2IonYCTRJOtvNqUKAs1gwg+S7JoHUlPk0BPYtoVZQDSy+YBShmH3fsqoM4hZB/6DMfcvUNkF95cDPl1QEjw6ak6cP+xzeZzOzsjwO2WFeuFoExoBKBLj6Vb3HqOaKwZlSqsApE9zsn3cUo6S2Jh8YOiy6zB1w4aRED3zdozABNkDGHWi5q1dkACT+A1ntV+2Y62XycBBIwVuVUhTN2saQtHeV4kby/P9sSQ2U= 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: List-Subscribe: List-Unsubscribe: --5nsJ0jp73mUS/QGW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Feb 02, 2024 at 06:07:54PM +0000, Dave Martin wrote: > So, if the only reason for trying to migrate to vmalloc() is to cope > with an insanely sized regset on arm64, I think somehow or other we can > avoid that. With SME we do routinely see the full glory of the 64K regset for ZA in emulated systems so I think we have to treat it as an issue. > Options: > a) bring back ->get_size() so that we can allocate the correct size > before generating the regset data; > b) make aarch64_regsets[] __ro_after_init and set > aarch64_regsets[REGSET_SVE].n based on the boot-time probed maximum size > (which will be sane); or Either of those seems sensible to me, a function would minimise the size of allocations based on the process configuration which would be nice and given that we're doing allocations it's probably reasonable overhead. > c) allow membufs to grow if needed (sounds fragile though, and may be > hard to justify just for one arch?). I'm having a hard time getting enthusiastic about that one for the reasons you mention. We can also just lower the maximum size we tell the ptrace core to the actual architectural maximum since AFAICT we don't expose that anywhere external, I've got a patch in CI for that. We'd still be allocating more memory than we need for practical systems but less extravagantly so. It seems more suitable for an immediate fix for people to pick up for production. It did occur to me at some point in the past that we should avoid telling the core about regsets that aren't physically supported on the current system, I didn't get round to looking at that yet. --5nsJ0jp73mUS/QGW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmW9RcEACgkQJNaLcl1U h9DOywf/cw76/6sNzpR8nrtANUPfbOuMMe64FuF7iDSV4ZCC0X9SfJ5hHe1GwfQv MzT2r2wocWZbrmhBcxb8YOJoU2uSbI2nc7UdMDMd9PL0UE8RmkEcrIWWFGMClwz4 ++aSfY2e7wiQ9a6X/IrM3jj+lDhx7BY3MGtfkvOqrE88g4yUEU6HS1rjaAzTUW84 WfgsyYRLs7m0SE90x6in8OR5Cdfts2AvqadR6EA4nwpwWOxUsIcw6o/wBpPxd05t gFfYutiSWuHMLlFzxO8VdRBbW69tZRj8xvpnKJ6R2xS1nIzxzZkCNpn88kgLpZP9 ROsCwgB8JM57McXHJCqXOyMxjxfTCA== =Rpx9 -----END PGP SIGNATURE----- --5nsJ0jp73mUS/QGW--