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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57761C25B78 for ; Wed, 22 May 2024 17:05:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vH3iOOE++FNxAKp0qFFZpLGXfR1bxI48INQ32JRWW/c=; b=zBIIg7WkX8xYwz 98p+QkHEVIgYt3cldM31EUg8AaZ4Dg0Yq4RUpvxbDhAeTFLXgCpXln7I7E8MIJeIucqhbz6hXBLz0 wvLSAd9w3DVkSYPZx3f4VGTcwESLbTAHmBlsrKjzGlK12m49Bc2goRuALan/Wu5/trKNo8WV/7/29 KTE2JMIyfwckh4BiSR1Q7Lipcqn7le0exINbXRMrPlDZ6TeNql2zfu+VEmG2a03bJ40J+7hYkn9Hg bY5q236FduUNhjWwb8W6iNLrZKVo7ZNtv3FOD3Lo9nMz6cudU7gP0SS4usDFLDnm1kg/YV4FWeI7a 6JYpy8Np9JRmso0fpIOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9pPL-00000003btZ-3Q4x; Wed, 22 May 2024 17:05:43 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9pPH-00000003bsW-2vGz for linux-arm-kernel@lists.infradead.org; Wed, 22 May 2024 17:05:41 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id AD19562A53; Wed, 22 May 2024 17:05:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34ABEC32789; Wed, 22 May 2024 17:05:34 +0000 (UTC) Date: Wed, 22 May 2024 18:05:31 +0100 From: Catalin Marinas To: Steven Price Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev, Marc Zyngier , Will Deacon , James Morse , Oliver Upton , Suzuki K Poulose , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Gouly , Alexandru Elisei , Christoffer Dall , Fuad Tabba , linux-coco@lists.linux.dev, Ganapatrao Kulkarni Subject: Re: [PATCH v2 12/14] arm64: realm: Support nonsecure ITS emulation shared Message-ID: References: <20240412084213.1733764-1-steven.price@arm.com> <20240412084213.1733764-13-steven.price@arm.com> <74011ac1-34e0-4ee3-a00d-f78ad334fce2@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <74011ac1-34e0-4ee3-a00d-f78ad334fce2@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240522_100540_369868_F99F34E2 X-CRM114-Status: GOOD ( 14.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, May 22, 2024 at 04:52:45PM +0100, Steven Price wrote: > On 15/05/2024 12:01, Catalin Marinas wrote: > > On Fri, Apr 12, 2024 at 09:42:11AM +0100, Steven Price wrote: > >> @@ -3432,7 +3468,16 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id, > >> nr_ites = max(2, nvecs); > >> sz = nr_ites * (FIELD_GET(GITS_TYPER_ITT_ENTRY_SIZE, its->typer) + 1); > >> sz = max(sz, ITS_ITT_ALIGN) + ITS_ITT_ALIGN - 1; > >> - itt = kzalloc_node(sz, GFP_KERNEL, its->numa_node); > >> + itt_order = get_order(sz); > >> + page = its_alloc_shared_pages_node(its->numa_node, > >> + GFP_KERNEL | __GFP_ZERO, > >> + itt_order); > > > > How much do we waste by going for a full page always if this is going to > > be used on the host? > > sz is a minimum of ITS_ITT_ALIGN*2-1 - which is 511 bytes. So > potentially PAGE_SIZE-512 bytes could be wasted here (minus kmalloc > overhead). That I figured out as well but how many times is this path called with a size smaller than a page? -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel