From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4681F2BEC2B for ; Thu, 2 Jul 2026 15:17:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783005469; cv=none; b=lQgbs99+rNk42npLaWH4stbbMkAHdiVc92aSICArxPMswvsADLzvrz2cjNeOawkK4xRJFxI5HaxX0RUcHdEf8Fq2FaOfalA0OsDWkt9ssRyIux6lZxvh0aAhr3fzvk5BososZ4HgWkxh8fUhGC4Pty/DAUuWp37wwbhQ4I3WGlo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783005469; c=relaxed/simple; bh=NeUnGx+O63l7gAk+AjXtPQv9mruHpFxeo2utYTJf8eg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=t3HvAC5Qrke57S3W5NuTMn2xip2szLlZznI0WQStICQt0kHfOpO0/P/78/29oaeJgHh5jfoy4qVVlPZjmR6MrxPZP26pZvGNB7p0nM8SOIwm0CS7xd5gzC7kJ06IlXNMF0f+/pyxCdAkRu5uqCXgP6K7OTlthdfGl8FrdBdsZLQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=YtqVOCGs; arc=none smtp.client-ip=209.85.219.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="YtqVOCGs" Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-8ef7b7651ecso5320056d6.1 for ; Thu, 02 Jul 2026 08:17:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1783005467; x=1783610267; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=95TYvt/Y3bxZkBtWRHNbhVKIR5ubiXw34ct5QIR0VLc=; b=YtqVOCGsKvPqdY1RkAdkyJdnTY96YUkcPHTWPmcguhQcx5iAXnCKu2/HhNRQLZgm8j sMdmoPTUutVMrRrZdh3FkW7gIrPEXgSInJXJY54rIGPehQJoSsx8DZsfz7xUrRhr1vCW JSDZi/RDg0ymMwshG0w24oVTGhYODU1JATbOHIyyA/FiBceZQa5+dAxsamxarxNsmU2e vPq/FasxQHkkuaIv03tgXCgJRPO9pZkTWerRn1+9Rfdd8Pmn/OYoZZlFTV9mQjZO4joP u6ktCTAKKB58G+2BLZJi3cCbbCp8BW/kvyfrjW2BdYo69hlKXHssWuTZAPEG/+bU1xTc WA9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783005467; x=1783610267; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=95TYvt/Y3bxZkBtWRHNbhVKIR5ubiXw34ct5QIR0VLc=; b=DiuAHauhDQ3oynvip/89Lvepkns/Tjm7H7fFgY5ZTANk/OlJrkqTV1Ky81oLXaMuhf ID8IHPbBRlOIE03cRxi53ENfQKe6gpmSX2zEn2Jd09Qurm2H03fdu3vRW2Ai6a/OhNOy r9dshWJjS3xsXXsTbdm2m+jLcabMuvWkRVlW4n/YAWw59lGH+Z0okZQRFaE4XVul0eGZ j2FH27Han2xEna/xK4oeQto81NpzfL01lQybklPXJumhYuUU10KctH+XQdC4IPPvNqym jSev2R+90ebKx1wcOiGtRB+ujDixFUq6mAHrYDKzqiRwg4aoNrmqMn4CPoQPNTzsh8sa flhA== X-Forwarded-Encrypted: i=1; AHgh+Rrv8B4KCNV9QOtAZHd9okSUTtTwysUb7jO1Qpo/2xW67Ib8HvRuNjlb/MEaJ0HnwdSCkf8iEneFyKWqMw8=@vger.kernel.org X-Gm-Message-State: AOJu0YwFNepGI3WxSxJqttZy4qoWSEi45JXNlIH5X89+Zur9og8C0G6Y A2enaPBxJIf0RjIofywN1lq6xd3MkOGdm7sFUg9jlp9s1Kr43RXRMidrH7F7oFt4vDM= X-Gm-Gg: AfdE7cnDNzk57FSaCJWZc0dYqg2tfNQDP95KhrmySMemi9WPncZhT71bBmLeVVzslxU 2BKN6cXIzGaU5NzhtQrUL9jLxpdn/wj5SdKp8yTthz1zL3lolAGEWq/pecun5pmYEedDQeIsoNR FwTakJ8Ttn+VqZYzSMjN2TqXe5kOQHKQVhXSQQZuJ/I6CjlTIZOUVceVJQz4nJdKhZaBkCNcUv1 9WX5F7aoxx/urzkNWQUBTVWfBzHtn8pt0aPqLESzGg3ScTSboSlXPQSZlHmcfJJ77of/X5KxBvZ NpjPgtvwp8rKMik3flAQ4uXYi5KQZV8OBHSvx9YlLbKKP7HvGPh1CfpbXVJMEmEqMIjUCcMlUYH TXMi+tnt8l3Eg826RisoZFJNde7McvAwrikWC6bVCIc7tDrWJR546uGulDmtF+M/l9zzVAX4saq eQNRDVXov9McEr4fLZ/cUN1xADnCElGBiW4ordI/yjmA9o/NMR/T3XVV1AFR9KWhuGDxc= X-Received: by 2002:a05:6214:5b87:b0:8f1:958c:eff9 with SMTP id 6a1803df08f44-8f5be9c1f13mr4309056d6.28.1783005467087; Thu, 02 Jul 2026 08:17:47 -0700 (PDT) Received: from ziepe.ca (crbknf0213w-47-54-130-67.pppoe-dynamic.high-speed.nl.bellaliant.net. [47.54.130.67]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8f46e371d55sm28337966d6.10.2026.07.02.08.17.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2026 08:17:46 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wfJAf-00000005wiw-48V3; Thu, 02 Jul 2026 12:17:45 -0300 Date: Thu, 2 Jul 2026 12:17:45 -0300 From: Jason Gunthorpe To: "Kiryl Shutsemau (Meta)" Cc: Will Deacon , Robin Murphy , Joerg Roedel , Nicolin Chen , Kyle McMartin , Breno Leitao , Usama Arif , linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] iommu/arm-smmu-v3: Shrink command/event/PRI queues in kdump kernel Message-ID: <20260702151745.GQ7525@ziepe.ca> References: <20260702112825.781750-1-kas@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260702112825.781750-1-kas@kernel.org> On Thu, Jul 02, 2026 at 12:28:25PM +0100, Kiryl Shutsemau (Meta) wrote: > The command, event and PRI queues are sized from the maxima the hardware > advertises in IDR1, which can be several megabytes each. On systems with > many SMMUv3 instances that cost is paid per instance and adds up to tens > of megabytes of coherent DMA in the capture kernel. > > A kdump capture kernel runs from a small crashkernel reservation and only > has to drive the few devices used to save the dump, so deep queues serve > no purpose. The queues carry invalidation commands and fault records, not > DMA data, so dump throughput is unaffected; a shallower queue only bounds > how many commands may be in flight before a sync, which does not matter for > the capture kernel's small device count and modest I/O. > > Clamp every queue to a single page when is_kdump_kernel() is true. Doing > it in arm_smmu_init_one_queue() covers the command, event and PRI queues > in one place. The command queue still holds at least one batch plus a sync > (256 entries on a 4K-page kernel, well above CMDQ_BATCH_ENTRIES), so > command batching keeps working. > > Suggested-by: Kyle McMartin > Signed-off-by: Kiryl Shutsemau (Meta) > Reviewed-by: Breno Leitao > --- > v2: > - Use min() instead of min_t(); both operands are u32 so the cast was > redundant (Jason Gunthorpe, Breno Leitao). > - Add Reviewed-by from Breno. > > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) Reviewed-by: Jason Gunthorpe Jason