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 AE6D8EB64D9 for ; Sat, 17 Jun 2023 20:37:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 162BE6B0071; Sat, 17 Jun 2023 16:37:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1134E6B0072; Sat, 17 Jun 2023 16:37:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF82A8E0001; Sat, 17 Jun 2023 16:37:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id E0B366B0071 for ; Sat, 17 Jun 2023 16:37:39 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id B1F38160241 for ; Sat, 17 Jun 2023 20:37:39 +0000 (UTC) X-FDA: 80913400638.05.E253359 Received: from out-40.mta1.migadu.com (out-40.mta1.migadu.com [95.215.58.40]) by imf14.hostedemail.com (Postfix) with ESMTP id B6E6E100006 for ; Sat, 17 Jun 2023 20:37:37 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=dfNjewHV; spf=pass (imf14.hostedemail.com: domain of kent.overstreet@linux.dev designates 95.215.58.40 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687034258; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=q0VmYCbqCGEwwRm9p2gHyBMkJehgKoo9YX+I+uEXlwI=; b=oRv7Xn7tcDINreG2brjO2biYFuGmN66aRvRU2gRjEeVhRvKkqxyLkwnwJKE++Y83mRra6Y Y/vSM+CMHpBSx4nlf6fMPyHrF7Lbh/Ag0XdlVUm5zG+A8IIea3S/phplYk5WrECWJT3yeZ 3BV/JjcY3rwFBbtRNqohiVIVpNOSPFU= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=dfNjewHV; spf=pass (imf14.hostedemail.com: domain of kent.overstreet@linux.dev designates 95.215.58.40 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687034258; a=rsa-sha256; cv=none; b=HLlOyJZqAaE4peOIy3TsLv1e+sYbD/IoFYAC88Ydgwm/gtPJslQBgqgek2YcFKlOC9sCKd FjUdh24JqFZSG7jhKFDF0Y1NN+21XFSmBdiGycQ/78E8CfKIzeUIJNxQ8IxwZ9O+3EuQ/n KuR8wlfM22VINi3Z8GVWq0kp4SKsYqY= Date: Sat, 17 Jun 2023 16:37:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1687034256; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q0VmYCbqCGEwwRm9p2gHyBMkJehgKoo9YX+I+uEXlwI=; b=dfNjewHVuYudVnc8TKpcch6UyyxsC62EekInr+KCF+/d5W19oLEbYgWNkxwMPmu6LU+6YJ DDxDUAUrcbSRUp/oMghsBWa2J9HukZTCZ/JGCQrtkNxjPDHNM3pSHNKVBsHXTHpr3HEdfU c38+ELnaz0YDpRbuK0hGGk55HYtUVFk= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Song Liu Cc: Mike Rapoport , linux-kernel@vger.kernel.org, Andrew Morton , Catalin Marinas , Christophe Leroy , "David S. Miller" , Dinh Nguyen , Heiko Carstens , Helge Deller , Huacai Chen , Luis Chamberlain , Mark Rutland , Michael Ellerman , Nadav Amit , "Naveen N. Rao" , Palmer Dabbelt , Puranjay Mohan , Rick Edgecombe , Russell King , Steven Rostedt , Thomas Bogendoerfer , Thomas Gleixner , Will Deacon , bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, netdev@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v2 07/12] arm64, execmem: extend execmem_params for generated code definitions Message-ID: References: <20230616085038.4121892-1-rppt@kernel.org> <20230616085038.4121892-8-rppt@kernel.org> <20230617065759.GT52412@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: B6E6E100006 X-Rspam-User: X-Stat-Signature: stoxxe3e4arqcno9nr51dhfoonnnu6bq X-Rspamd-Server: rspam01 X-HE-Tag: 1687034257-755834 X-HE-Meta: U2FsdGVkX18Cu2J/1+9X7+3kZuhfzuTACDmIrDwKtBBRJ+xtpb3rYN6Qv4/lfx7wnLmNnvUtpkJ4ZUaIFOpicPNIzNGvbiF/t+t0evt0iM/eP7CJ6ot5fH1mtgeERmGXedkprdDJgmx/jBtmVAZgiL7eN1GRU7yUZn7woVV56E2PVV8Xw76p0TSQ35IDpSgNyWNO4KY/3a6P2zpMBIGCzCAWfAFJCFrvunJtS3ivDw6p/NCPMtJirGToXhD0K7/u7C76/jHl+E8l2gSYwK7Twh8mJkDBRNZjBvIrzi+t9cOMf6l+5YjAsAknqkdwPBUA8pVAAYKCNzEnOlrxo0V4257eUPUQBeOpZ/+ERdUbqkK0G6qaxtvsw8Gs5KyfvzzgzcS1zx30PDodjB+2T3QRn2VQDzhxUcU9GAgYTn5V8Y8s9jkSCZcVYoCLpyeBPUzL9PuHh95GDO3Xoj6+YVWQz7zbqgkYM4YQSdy4EPZ1IJMr2aK534cqJWHCvVWHpHxSVL1om0rNWTi31vdVuOoa3+r6FKeihHrsxtwOOXPFYWAdSJSUcHy4vuGVX/mBCTAXyhBNT9eR6dE0XzrymC6phGTvKT3cI18xZNKyFAIgLeFWGTFMSZpR2BvTiT1JEwv5SUk+zNwSE9zYlcM3eclaRIYEHDklodF6yj+pQNaIedJaah+JzVgnXMSFESelzozYltGzqcYCH2xEuchMcMcKpABaMGbsInqZky5syFDYpnjKwDCFVDwHrrEcTmR71j4ZnNn+O9gsX/jZwAxDexIMYVyAzgNjWcinUoH7z0Glm6FuBSHk7Q4xfayJLW8hc17aiX80VZumAn4xIWNOC4kF6hSFZ5zBuB+GCOkx3LXl5KLxcEw5C7/Pv1YtCePdoStYZNBrVgbHwGpuiEi3F2oNUZYise/RNaegcQekMxWgmNFtdtoiCkb47ny3fV9Q942EsJRc4j+bkmz2KVnTCil pkAo8g5A aN4JoHuZyoatOPsqYSQicgVe6sMeOp2HMrl3OwseO/IjKxcyjx3TMxd1bJy2lmg7KGPr5nxyvezaoxJy4Ipojr3QoUU9rVkzpX9LsyRnQ7JM8OfIQUAg/ehfabF+NBJ2eHUV21EYotK8vr9A74o8CO5ILNieEtEHKeAGE3PjbTuMdS2A= 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: On Sat, Jun 17, 2023 at 09:38:17AM -0700, Song Liu wrote: > On Sat, Jun 17, 2023 at 8:37 AM Kent Overstreet > wrote: > > > > On Sat, Jun 17, 2023 at 09:57:59AM +0300, Mike Rapoport wrote: > > > > This is growing fast. :) We have 3 now: text, data, jit. And it will be > > > > 5 when we split data into rw data, ro data, ro after init data. I wonder > > > > whether we should still do some type enum here. But we can revisit > > > > this topic later. > > > > > > I don't think we'd need 5. Four at most :) > > > > > > I don't know yet what would be the best way to differentiate RW and RO > > > data, but ro_after_init surely won't need a new type. It either will be > > > allocated as RW and then the caller will have to set it RO after > > > initialization is done, or it will be allocated as RO and the caller will > > > have to do something like text_poke to update it. > > > > Perhaps ro_after_init could use the same allocation interface and share > > pages with ro pages - if we just added a refcount for "this page > > currently needs to be rw, module is still loading?" > > If we don't relax rules with read only, we will have to separate rw, ro, > and ro_after_init. But we can still have page sharing: > > Two modules can put rw data on the same page. > With text poke (ro data poke to be accurate), two modules can put > ro data on the same page. > > > text_poke() approach wouldn't be workable, you'd have to audit and fix > > all module init code in the entire kernel. > > Agreed. For this reason, each module has to have its own page(s) for > ro_after_init data. Relaxing page permissions to allow for page sharing could also be a config option. For archs with 64k pages it seems worthwhile.