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 1298DC63705 for ; Wed, 7 Dec 2022 21:04:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 905048E0005; Wed, 7 Dec 2022 16:04:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B4368E0001; Wed, 7 Dec 2022 16:04:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7A37C8E0005; Wed, 7 Dec 2022 16:04:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 6F21B8E0001 for ; Wed, 7 Dec 2022 16:04:58 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 357661C627C for ; Wed, 7 Dec 2022 21:04:58 +0000 (UTC) X-FDA: 80216739876.29.A22E238 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf25.hostedemail.com (Postfix) with ESMTP id 996C0A0017 for ; Wed, 7 Dec 2022 21:04:57 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=WKBVYK2u; dkim=pass header.d=linutronix.de header.s=2020e header.b=9DhB4Xxj; spf=pass (imf25.hostedemail.com: domain of tglx@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=tglx@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670447097; 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=7s95N4stbJ58KKd5tqowhzFkeGL5TgOILKJAbS4MGIs=; b=UhGkhsmwO4ilc/l9n0p2qGKcWLu0FYd6lXTMr3sZKH4l55uf1xlIPVorLpgN3QN5Mn4PQz f/AYl/x0Rs2bAWr/9VNLdDceQesRM43g9sqD95Ni97UKI+Gq5tCE7yH4VKH6RU6pvmDfnG KRf7Kl1WXX1+1AHdNOmTTmRoxYzBiDw= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=WKBVYK2u; dkim=pass header.d=linutronix.de header.s=2020e header.b=9DhB4Xxj; spf=pass (imf25.hostedemail.com: domain of tglx@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=tglx@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670447097; a=rsa-sha256; cv=none; b=ex9wjpyEdY3Y+8qmy+HEhgQ+oapFiOz33E/OKb+ccLcsv0vKofVlM+7M060CrVF39/3LE9 9q+WFqfdkusUGuLl7Wys8+RQELNFVrKSBDLgJlDU5J6rBqFusZh8qbVwK4yVI6VKc7ENSu 4BO+ijYRtRrAX4tvxg7EZRQyuEgZamQ= From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1670447095; 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=7s95N4stbJ58KKd5tqowhzFkeGL5TgOILKJAbS4MGIs=; b=WKBVYK2uZpE08u6ttrVF4+1uLE/uC5z+kAhstXmRwmm56K/cMBVW1ykB7SoRaYYZAHUY3f 5mePSSUPl0FY3Vs5Xgmewchor/FdHlW3MKt+zFCaaNYXuT9H+DRQt188jigDOBplsLJN/z 85pQgqQE/x4J2Rv0r2J4fAYSiCZMXT8eCJ/aIJQl2zvwnJIghAaZtZ0kq2/VN+SXiSRUt7 sTIGWRxdpySJT7k7RBcOOeUc/aIOZTOmuHp8K0QHdznYzIMrPD5052v8O4yuzp5Nh0zzAv WMhtRVWmzxeZmYkM6lRudh8dETg5PSYWAjLyLZRTvSka14PB5JiwKR3+QBANzw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1670447095; 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=7s95N4stbJ58KKd5tqowhzFkeGL5TgOILKJAbS4MGIs=; b=9DhB4XxjVRVWsaizIzn9gmJ/8s+7Gz4vIjfWE34VAAX7mSMhyr7hh6z1UomTYGtfHaoaHo 5mjfjg+rJFbq6jCA== To: Christophe Leroy , Song Liu Cc: "bpf@vger.kernel.org" , "linux-mm@kvack.org" , "peterz@infradead.org" , "akpm@linux-foundation.org" , "x86@kernel.org" , "hch@lst.de" , "rick.p.edgecombe@intel.com" , "aaron.lu@intel.com" , "rppt@kernel.org" , "mcgrof@kernel.org" , Dinh Nguyen Subject: Re: [PATCH bpf-next v2 0/5] execmem_alloc for BPF programs In-Reply-To: References: <87v8mvsd8d.ffs@tglx> <87k03ar3e3.ffs@tglx> <878rjqqhxf.ffs@tglx> <87v8mndy3y.ffs@tglx> Date: Wed, 07 Dec 2022 22:04:55 +0100 Message-ID: <87h6y7dix4.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 996C0A0017 X-Rspam-User: X-Stat-Signature: kn3bcx6oa5cmcs9ft61jyqay558m1rrm X-Spamd-Result: default: False [0.47 / 9.00]; SUBJECT_HAS_UNDERSCORES(1.00)[]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[linutronix.de,none]; R_SPF_ALLOW(-0.20)[+mx]; R_DKIM_ALLOW(-0.20)[linutronix.de:s=2020,linutronix.de:s=2020e]; MIME_GOOD(-0.10)[text/plain]; BAYES_HAM(-0.03)[51.74%]; RCPT_COUNT_TWELVE(0.00)[13]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[linutronix.de:+]; ARC_SIGNED(0.00)[hostedemail.com:s=arc-20220608:i=1]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[] X-HE-Tag: 1670447097-654169 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: Christophe, On Wed, Dec 07 2022 at 16:53, Christophe Leroy wrote: > Le 07/12/2022 =C3=A0 16:36, Thomas Gleixner a =C3=A9crit=C2=A0: >> The "use free space in existing mappings" mechanism is not required to >> be PMD_SIZE based, right? Correct. I just used it for the example. >> Large page size, strict separation: >>=20 >> struct mod_alloc_type_params { >> [MOD_ALLOC_TYPE_TEXT] =3D { >> .mapto_type =3D MOD_ALLOC_TYPE_TEXT, >> .flags =3D FLAG_SHARED_PMD | FLAG_SECOND_ADDRESS_SPACE, >> .granularity =3D PMD_SIZE, >> .alignment =3D MOD_ARCH_ALIGNMENT, >> .start[0] =3D MODULES_VADDR, >> .end[0] =3D MODULES_END, >> .start[1] =3D MODULES_VADDR_2ND, >> .end[1] =3D MODULES_END_2ND, >> .pgprot =3D PAGE_KERNEL_EXEC, >> .fill =3D text_poke, >> .invalidate =3D text_poke_invalidate, >> }, > > Don't restrict implementation to PMD_SIZE only. > > On powerpc 8xx: > - PMD_SIZE is 4 Mbytes > - Large pages are 512 kbytes and 8 Mbytes. > > It even has large pages of size 16 kbytes when build for 4k normal page=20 > size. @granularity takes any size which is valid from the architecture side and can handle the @pgprot distinctions. That's why I separated functionality and configuration. Note, it's not strict compile time configuration. You can either build it completely dynamic at boot or have a static configuration structure as compile time default. That static default might be __initconst for architectures where there is no boot time detection and change required, but can be __initdata for those which need to adjust it to the needs of the detected CPU/platform before feeding it into the module allocator init function. Does that answer your question? Thanks, tglx