Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp431605rwl; Thu, 6 Apr 2023 22:53:11 -0700 (PDT) X-Google-Smtp-Source: AKy350ZDcZF1Kv4lmxOVAS3PAjE942HxqN0tr8/Ul700IpSqtGgtmXkRAYEoeJHTEhnaiDUX8ywa X-Received: by 2002:a17:906:1b04:b0:947:735b:fcbe with SMTP id o4-20020a1709061b0400b00947735bfcbemr1428692ejg.19.1680846791531; Thu, 06 Apr 2023 22:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680846791; cv=none; d=google.com; s=arc-20160816; b=P62KAM61sC15DqFOp5KiELCPUVhKgDKHMqep/gBXPx54cRQ+AsbU1gTg2mSOkTQWwZ 9xAkFXXc5f2OzfeN6xXF/9NpszZBTfN/2WHdWU3+nK7Nwtu6iVntCNvT5Z21aEePpsVX 7NWUuA5ynqMYGBkHikBTW5AHmAYNmNjR4bGsXQphnMtAm0ZZxSHgp53bMNt0O7dounar 8q1j5imeaIHAwiTn3ImcBiSLtvtxnzGoUELXvVElYEEcuTVmt3pxIo+z6lrt6dlVF1YI AwoIyeUCg3TlTvbyUBiKV7iwk1DCnI2QQHjaEfcam4IFeq9dueni5IqceAY5SQEk/5ag UNcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=8OoFsp+gAkr+DVBqrRw+nozPZ1eqvEi0J+2a111/wCQ=; b=OEXDx5Y+2sfqTmfhn1gHCj4XegLIaohysLvufpWdVVbSr4qfPxRjYqgmf4qTbny4H/ sbqmcED66qDaef0nSahQc4N+KZPXw5dcPdQkoCmQJA6d241Uw8Fkel/t6W/9ySTTEdpy 4BFQEeo/N4k6AgIHlotOa16XVqESQfx4L+nzBz7Efl2XdvfzwpUfM2T7/Niy5f1IyKgE vLmhTS0IRclbeTQqyYw8pKg1DaaAKtzkud+pS2ylB6TRYASBeLufHUkoaHQ4sEZ4DGRU 6/NnBT08tHEbjDAbRY5HqwUTh1l9kbZqiULVPbQrLkgkyLv0HPd0KPA4knZJ0F4VpiSn EEHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk20-20020a170906cb1400b0093defbd628bsi2549654ejb.1042.2023.04.06.22.52.45; Thu, 06 Apr 2023 22:53:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231295AbjDGFuX (ORCPT + 99 others); Fri, 7 Apr 2023 01:50:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230292AbjDGFuW (ORCPT ); Fri, 7 Apr 2023 01:50:22 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E6879768 for ; Thu, 6 Apr 2023 22:50:20 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 88ECE67373; Fri, 7 Apr 2023 07:50:16 +0200 (CEST) Date: Fri, 7 Apr 2023 07:50:16 +0200 From: Christoph Hellwig To: Michael Kelley Cc: hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, decui@microsoft.com, tiala@microsoft.com, iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/1] swiotlb: Track and report io_tlb_used high water mark in debugfs Message-ID: <20230407055016.GA6803@lst.de> References: <1680324300-124563-1-git-send-email-mikelley@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1680324300-124563-1-git-send-email-mikelley@microsoft.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 31, 2023 at 09:45:00PM -0700, Michael Kelley wrote: > Changes in v3: > * Do high water mark accounting only when CONFIG_DEBUG_FS=y. As > as a result, add back the mem_used() function for the "swiotlb > buffer is full" error message. [Christoph -- I didn't hear back > whether this approach addresses your concern about one additional > atomic operation when slots are allocated and again when freed. I've > gone ahead with this new version, and we can obviously have further > discussion.] Still not too happy, but at least debugfs is an interfact we could remove at any time. But can you please factor the used_hiwater accounting into two separate helpers that are udner CONFIG_DEBUG_FS and otherwise stubbed out, instead of adding the logic directly into swiotlb_do_find_slots and swiotlb_release_slots?