Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4949142rwl; Mon, 10 Apr 2023 20:47:29 -0700 (PDT) X-Google-Smtp-Source: AKy350ZDCtw88gnT3M4Mp8kyKETZDi3353SKYrBW946YBhJSHLSh7K3aiTOPKTArBq8YZ5rQB+J3 X-Received: by 2002:aa7:c749:0:b0:504:7ee3:72c0 with SMTP id c9-20020aa7c749000000b005047ee372c0mr11874697eds.4.1681184849520; Mon, 10 Apr 2023 20:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681184849; cv=none; d=google.com; s=arc-20160816; b=SWaHtFNWXAk0CEx6WxCfw1wZ0ES6AgzlkiAKqTkXSSBEzBWSPN2rjTyrcAlGJjcPWO y9+zgCzyb7W4VYVwf5qwEXEmK5Mb+thQcWE3pukZ3fIkgZNxn3Oh0mVF6v2728umh0gY LuX/67qtsuWCf3etNRmNUzbXOy7Y9Mzi/xO9O2cTFVdS0fztRuO674SIPqydtIlcFjH0 E8ilAGzqQ/IpEuxqj6I66Yw/fbwNXEr5r6/foUMlfv+A5Ss97IfC/FKXHI6QZhx3EKy/ CzdXI6NgL/by0ogQ6DDH2HXRrNcQG4/Fv6IwneWcC8n6XTRi361XxtnkCwB/TKXFOu4F EPLQ== 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=JiEgQlKwMOEXGfJ+L2B/siFyBviCU3MQvudk7bc5kNc=; b=dYn8CAyimgOLEwm/xcVNufZDcKgg7qGM9E3BKErqtlMxou4kksbtj60BIgHBUfV9EC tZTF6SGdLQvqggZaz6bj8sdH2x1wr3v+cJGxDGTLVqRYF4j3KLVFbqwVbEs970q7TXv2 WgU3bruN5gQHkzv71eIiFh6XpnL5LkgEuDONaQz6c+pxt+ntKaxVlH0YMhsVAsRsTkI6 /QiElZgAIzOHcoBq3BooXz7YzpR5vljH798WJYA0xGTYB/dEDVbzldYAHPyCxi/OFATp VzShZuHSVhWDuqUeiji5htHtDy2XVHPh7uCzZyFI9VJTQ5xm2Nbe42oyqhFwmPSMwQKx JeJQ== 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 a15-20020a50e70f000000b005047cdbf16fsi9329843edn.353.2023.04.10.20.47.05; Mon, 10 Apr 2023 20:47:29 -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 S230061AbjDKDpI (ORCPT + 99 others); Mon, 10 Apr 2023 23:45:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230091AbjDKDoh (ORCPT ); Mon, 10 Apr 2023 23:44:37 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D50D4488 for ; Mon, 10 Apr 2023 20:42:56 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id E37E368BFE; Tue, 11 Apr 2023 05:42:53 +0200 (CEST) Date: Tue, 11 Apr 2023 05:42:53 +0200 From: Christoph Hellwig To: "Michael Kelley (LINUX)" Cc: Christoph Hellwig , "m.szyprowski@samsung.com" , "robin.murphy@arm.com" , Dexuan Cui , Tianyu Lan , "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: <20230411034253.GC15679@lst.de> References: <1680324300-124563-1-git-send-email-mikelley@microsoft.com> <20230407055016.GA6803@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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, Apr 07, 2023 at 10:01:13PM +0000, Michael Kelley (LINUX) wrote: > I coded the way I did to follow the kernel coding style guidance > that prefers converting a Kconfig symbol into a C boolean > expression, and using it in a normal C conditional instead of > using #ifdef. If CONFIG_DEBUG_FS=n, the compiler will constant > fold the conditional away so there's no runtime overhead. I > like the way that approached worked out in this case, but if you prefer > separate functions with #ifdef and stubs, I don't feel strongly either way. I don't think there is a a hard and clear rule. Actual ifdefs have the benefit of allowing to actually remove struct fields as well. But the important bit is that I do want the accounting in helpers instead of in the main swiotlb logic. And once you do that, having #ifdefed stubs for the functions make sense to me.