From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932069AbdI1NlU (ORCPT ); Thu, 28 Sep 2017 09:41:20 -0400 Received: from 8bytes.org ([81.169.241.247]:54724 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753053AbdI1NlT (ORCPT ); Thu, 28 Sep 2017 09:41:19 -0400 Date: Thu, 28 Sep 2017 15:41:16 +0200 From: Joerg Roedel To: Robin Murphy Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] iommu/iova: Try harder to allocate from rcache magazine Message-ID: <20170928134115.GS8398@8bytes.org> References: <8127fabc219811d8169189e9d7177d42bc74bcbf.1505827369.git.robin.murphy@arm.com> <8e319924684be401103a5831acee6895d7c5b6d6.1506594488.git.robin.murphy@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8e319924684be401103a5831acee6895d7c5b6d6.1506594488.git.robin.murphy@arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 28, 2017 at 11:31:23AM +0100, Robin Murphy wrote: > When devices with different DMA masks are using the same domain, or for > PCI devices where we usually try a speculative 32-bit allocation first, > there is a fair possibility that the top PFN of the rcache stack at any > given time may be unsuitable for the lower limit, prompting a fallback > to allocating anew from the rbtree. Consequently, we may end up > artifically increasing pressure on the 32-bit IOVA space as unused IOVAs > accumulate lower down in the rcache stacks, while callers with 32-bit > masks also impose unnecessary rbtree overhead. > > In such cases, let's try a bit harder to satisfy the allocation locally > first - scanning the whole stack should still be relatively inexpensive. > > Signed-off-by: Robin Murphy > --- > > v2: There's no need for a 'proper' stack rotation > > drivers/iommu/iova.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) Thanks, applied the series.