Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4099530imu; Mon, 10 Dec 2018 13:08:01 -0800 (PST) X-Google-Smtp-Source: AFSGD/UuTauhET6+60Un1tzb1qt+vugvYQmhy7ivio3fpeu8V7vV2WRcMHi6Rve74ffyQlNE1ogj X-Received: by 2002:a17:902:724a:: with SMTP id c10mr13879336pll.51.1544476081587; Mon, 10 Dec 2018 13:08:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544476081; cv=none; d=google.com; s=arc-20160816; b=F5+Vd67F+cdvurA2QHR0WYZ8gTvFgSd3FrHNw27gOW2I9i0tBNrOmx5mqSzkrlZT5s pZulFRYwWDYKaNrfRBHsKpsyc5xHXNN1W3X+oj/TUUL5OjnIanTGK1CMD3HCOSy6IfGD IB/kvl3NlPLuQ+4UWjSNoK7WNqbmiH74AAXugIelu8oknw91Cqjjnb3cheQve5aS79eQ Y2St0AMBYxe5sx8cKfYW7jusC3nLHdszxGvU0nJehjUQpY8JMZlk68Nd8IkzqcsyCh0M XoG8jqa2MLAgKt1FVtVPFFb2N58YxvAmPG18FL7qNsee87suMBSyG2pAxkyruEQTJrTS utKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=A62hSNDQdV2JLTUo3rEJOOvX8Vj0r/iKsccJta4tOCc=; b=cXKbnGMdWrQuBHlIpMWGp9AlHk8agPaLWJwz7C7wFQJkEPvb+49PwN1r1RWUf1o/68 v7GugpYoFvR54akbG+VormAYSJgyIJVGeLZI0QJoSZVKk3CVNAZuhMs9UyhWRVybT5CL Y05kbvptZATxLC066xwCua2pshhuc+0ZJWdMfW9EhoLGC3ozw0Qk9Qwe+FDOHzCvAckg RX/Z/TWN0/fRt31oVZVCuHC5D9fVXCKVeLYChxmErDf1DfJWGj9Mznmr+wAOaN0hdHre JLeGOtU1LIDYMki6uZwttZYzGK3L/ON6yygU80UTuJGuWhBKp9viIaxBsoGf7mRHdqb0 UtwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=mi4SrYRZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g22si12381695pfj.222.2018.12.10.13.07.46; Mon, 10 Dec 2018 13:08:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=mi4SrYRZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729488AbeLJVGF (ORCPT + 99 others); Mon, 10 Dec 2018 16:06:05 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:41064 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727538AbeLJVGF (ORCPT ); Mon, 10 Dec 2018 16:06:05 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wBAL5ZDc019840; Mon, 10 Dec 2018 21:05:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=A62hSNDQdV2JLTUo3rEJOOvX8Vj0r/iKsccJta4tOCc=; b=mi4SrYRZnrw0VXa6YGlQl4Jdh6AN29aXPdEhVKg9G2c4p03zi3niWTZAq+ljvkd8bsQF LVF7m2kx3gPUhvCOSPbaK/+dhjDboxPRqCAAoXkZ4JO6uXDkhwwHOWSOQkUsC9byaSTr ua+Q28OEMNl0U3kpHq7lUarqx9wl7OYM+mWyg2g8i15/S6rpnhK93mNRhQwV4G2qh0si t4V0NNqw59ev5dZ6QH641WExJq8l+zvphVsOa5ylklrkc8SKc380/UZvgECN3YPw6j/c ih8G/miEIzlBLC5iO2AjCvArs4lnH8W+HsSh0CQXLYq9qjXD1ZlTX375kAfmDn6DJ0Fn ig== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2p86kqrbsj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Dec 2018 21:05:53 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wBAL5kG7027782 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Dec 2018 21:05:47 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wBAL5jSJ008316; Mon, 10 Dec 2018 21:05:45 GMT Received: from [10.211.47.70] (/10.211.47.70) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 10 Dec 2018 13:05:45 -0800 Subject: Re: [PATCH v2 1/2] swiotlb: add debugfs to track swiotlb buffer usage To: Tim Chen , Dongli Zhang , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Cc: konrad.wilk@oracle.com, hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com References: <1544402278-8175-1-git-send-email-dongli.zhang@oracle.com> <41becd27-8c3a-da2b-e5ed-e361ba20e4d4@linux.intel.com> From: Joe Jin Message-ID: <34883ba5-b444-3d37-4d40-9b0a651dd2eb@oracle.com> Date: Mon, 10 Dec 2018 13:05:44 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <41becd27-8c3a-da2b-e5ed-e361ba20e4d4@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9103 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812100187 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/10/18 12:00 PM, Tim Chen wrote: >> @@ -528,6 +538,9 @@ phys_addr_t swiotlb_tbl_map_single(struct device *hwdev, >> dev_warn(hwdev, "swiotlb buffer is full (sz: %zd bytes)\n", size); >> return SWIOTLB_MAP_ERROR; >> found: >> +#ifdef CONFIG_DEBUG_FS >> + io_tlb_used += nslots; >> +#endif > One nit I have about this patch is there are too many CONFIG_DEBUG_FS. > > For example here, instead of io_tlb_used, we can have a macro defined, > perhaps something like inc_iotlb_used(nslots). It can be placed in the > same section that swiotlb_create_debugfs is defined so there's a single > place where all the CONFIG_DEBUG_FS stuff is located. > > Then define inc_iotlb_used to be null when we don't have > CONFIG_DEBUG_FS. > Dongli had removed above ifdef/endif on his next patch, "[PATCH v2 2/2] swiotlb: checking whether swiotlb buffer is full with io_tlb_used" Thanks, Joe