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 7D712C433FE for ; Sun, 20 Nov 2022 10:44:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AB0056B0072; Sun, 20 Nov 2022 05:44:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A60036B0073; Sun, 20 Nov 2022 05:44:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 926B46B0074; Sun, 20 Nov 2022 05:44:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 804F96B0072 for ; Sun, 20 Nov 2022 05:44:25 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 463A91C6498 for ; Sun, 20 Nov 2022 10:44:25 +0000 (UTC) X-FDA: 80153486490.18.EC26CCF Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf10.hostedemail.com (Postfix) with ESMTP id DB7F2C0004 for ; Sun, 20 Nov 2022 10:44:24 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3191860BFB; Sun, 20 Nov 2022 10:44:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 673E6C433D6; Sun, 20 Nov 2022 10:44:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668941063; bh=hwn608o35Wlp83SI1gYbYqT6jafaZV4j1oqaO/ZVvuk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JcRsujEEGs4xt8Ptq0Fh22mgLN4+98ZHNvy9RokonM4MuLvLbp8iXEDnQbZzEVuWX zKoWspQZxseAcXTQy5i1FdOfr1d8S5BkMbW/6UqDgrb7Q3++2BwTMQLiv9n5PmjKHS x+d0iITw8HkY11ekwF4eJHYVJ/kB98cc9cZberJypS86y1YmEGHwvD4S8YhaV+lhid mErR+FhX/stOfsOiu5bvgu/ev56h/2CXFZKhBA/jUkxv0be234EdOesKE39EXz2/eV Oq3enNnr3K6ZZGC+G3QkvQNzNm9ZKqKstu3/yKfeXmYpfyLdlFxi8fqp2c5+ha+mLD HENg+kJasYufw== Date: Sun, 20 Nov 2022 12:44:09 +0200 From: Mike Rapoport To: Song Liu Cc: "Edgecombe, Rick P" , "peterz@infradead.org" , "bpf@vger.kernel.org" , "linux-mm@kvack.org" , "hch@lst.de" , "x86@kernel.org" , "akpm@linux-foundation.org" , "mcgrof@kernel.org" , "Lu, Aaron" Subject: Re: [PATCH bpf-next v2 0/5] execmem_alloc for BPF programs Message-ID: References: <20221107223921.3451913-1-song@kernel.org> <9e59a4e8b6f071cf380b9843cdf1e9160f798255.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668941064; a=rsa-sha256; cv=none; b=uUdplPJpHlyeyPshrVVbRTHgUoJkTlQvjLoCOuwPZB+LCDcwQ35rsv8nlRbAnrx1g2yipZ RocAGeR4mAqqUa9cwPgnLhT2kQq2t2YS5IteLDjf7OidacmZpIFJMke/toFMLK+AQh35wT auAip+5SaboOAoCsV1pL4MJm9/aZnrU= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JcRsujEE; spf=pass (imf10.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668941064; 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=+WAW7tGWyAKbe6oPi6LIJMo8h9QwrfcINXVOrCN22xY=; b=Q/Fw55zTzglr5T8WuUhFpApMyz+17T6Og4MyjirXi4RuLSAETjvGNrAaMgmOjWuRuYaHus gmEtGE5M8eUNySEDgyJsNgyBLdcZBsD7C+k1E/7AV++fjsm/j9f2YXKsd+eWKvSuL3QMhv 5qrQNwFLFqqpTg+PjdRdZZeEZlZVkts= X-Rspam-User: X-Stat-Signature: jdfpji5nfrx3pgshup3uu6c8cenctgkx X-Rspamd-Queue-Id: DB7F2C0004 Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JcRsujEE; spf=pass (imf10.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam07 X-HE-Tag: 1668941064-22628 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 Mon, Nov 14, 2022 at 12:45:16PM -0800, Song Liu wrote: > On Sun, Nov 13, 2022 at 2:43 AM Mike Rapoport wrote: > > > > > > If RO data causes problems with direct map fragmentation, we can use > > > similar logic. I think we will need another tree in vmalloc for this case. > > > Since the logic will be mostly identical, I personally don't think adding > > > another tree is a big overhead. > > > > Actually, it would be interesting to quantify memory savings/waste as the > > result of using execmem_alloc() > > From a random system in our fleet, execmem_alloc() saves: > > 139 iTLB entries (1x 2MB entry vs, 140x 4kB entries), which is more than > 100% of L1 iTLB and about 10% of L2 TLB. Using 2M pages saves page table entries. They might be cached in iTLB and might be not because on a loaded system large part of iTBL will cache userspace mappings. > It wastes 1.5MB memory, which is 0.0023% of system memory (64GB). > > I believe this is clearly a good trade-off. The actual trade-off would be for 1.5MB of memory for yet unknown, or at least unpublished, performance improvement on a loaded system. > Thanks, > Song -- Sincerely yours, Mike.