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 14090C38A02 for ; Sun, 30 Oct 2022 08:05:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229679AbiJ3IFu (ORCPT ); Sun, 30 Oct 2022 04:05:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229636AbiJ3IFq (ORCPT ); Sun, 30 Oct 2022 04:05:46 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A577A640C; Sun, 30 Oct 2022 01:05:44 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 1527B68AA6; Sun, 30 Oct 2022 09:05:41 +0100 (CET) Date: Sun, 30 Oct 2022 09:05:40 +0100 From: Christoph Hellwig To: Alexey Kardashevskiy Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, Ashish Kalra , Pankaj Gupta , Tom Lendacky , Robin Murphy , Marek Szyprowski , Christoph Hellwig Subject: Re: [PATCH kernel] x86/swiotlb/amd: Half the size if allocation failed Message-ID: <20221030080540.GH4214@lst.de> References: <20221027052607.260234-1-aik@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221027052607.260234-1-aik@amd.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The subject looks wrong - this just touches the swiotlb code, and nothing x86 or AMD specific. The code flow now looks a little confusing. Can yu just add a little swiotlb_memblock_alloc helper that does the two variants of memblock allocation and remap, so that we can keep a simply loop around them in the caller?