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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 088FEC43334 for ; Wed, 6 Jul 2022 11:31:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232377AbiGFLbP (ORCPT ); Wed, 6 Jul 2022 07:31:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230151AbiGFLbL (ORCPT ); Wed, 6 Jul 2022 07:31:11 -0400 Received: from theia.8bytes.org (8bytes.org [81.169.241.247]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2711E2610E for ; Wed, 6 Jul 2022 04:31:11 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 626004CC; Wed, 6 Jul 2022 13:31:09 +0200 (CEST) Date: Wed, 6 Jul 2022 13:31:08 +0200 From: Joerg Roedel To: Feng Tang Cc: Will Deacon , Robin Murphy , John Garry , iommu@lists.linux-foundation.org, iommu@lists.linux.dev, Andrew Morton , Christoph Lameter , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] iommu/iova: change IOVA_MAG_SIZE to 127 to save memory Message-ID: References: <20220703114450.15184-1-feng.tang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220703114450.15184-1-feng.tang@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 03, 2022 at 07:44:50PM +0800, Feng Tang wrote: > kmalloc will round up the request size to power of 2, and current > iova_magazine's size is 1032 (1024+8) bytes, so each instance > allocated will get 2048 bytes from kmalloc, causing around 1KB > waste. > > Change IOVA_MAG_SIZE from 128 to 127 to make size of 'iova_magazine' > 1024 bytes so that no memory will be wasted. > > Signed-off-by: Feng Tang > Acked-by: Robin Murphy Applied, thanks.