Re: [PATCH v3 1/1] swiotlb: Track and report io_tlb_used high water mark in debugfs

From: Christoph Hellwig
Date: Fri Apr 07 2023 - 01:50:27 EST


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?