Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4075669ybx; Mon, 4 Nov 2019 07:28:50 -0800 (PST) X-Google-Smtp-Source: APXvYqwydcU1HopJYsdD4NqkyAvXkCS2BJhRD9f6ssB+srpouVKC7TswgKP8JSciB+/uWoj9UGnn X-Received: by 2002:a17:906:d971:: with SMTP id rp17mr23555749ejb.230.1572881330854; Mon, 04 Nov 2019 07:28:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572881330; cv=none; d=google.com; s=arc-20160816; b=aJWUmHBWfrQh/xm5jOu1oHn+opHOWChc8FH+RwO7+ushDxnwRSKQ3CXwRleHURhFim wGR/c08/r9NB5TzObtCl4CjV7R76x9kqlpzI9YRffX7m8LBxuOvC/nSP9EoH7wdNQZy3 PZAf0SAblIEJLRCfVd2f7+kpYJ2F0eEbhoMM1U9EpDWjFLh7NA+pZkpWQeXemdF7yHPL xF/L/k2mS3E8pmTvBUx4/geiA+x1VIIOUq32UDYNgIe1nH3obrOblvHXB9q4+yIRHFrd cap4CguEpOyLAkO6htxoomxeukcx0SSkV6fO55dQ1MZ5d50F7w3HLnPTAfdnkTNKunLm ucFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6RJcO60dMsiGxsPGdyjVOQPZBFgaMzgTygSbxJ4e+CU=; b=1DqYWX85PlL1GAMIT0yz9yBRqE4AFI15b3tbdOniqCcefRvKGOE063l2HnVE6Gi4xd QaMUVFsJL0sHgQK/yUJDfCim3hUMoQsBsqvquXmF7QshYbEh1U+aaD3YaO+O9LUoqHvk 4TYF5C5RkUDzRtvwAYZTaVHAj7yVG8tWCdRdcyeXYwGO2c1CZ+pWA+4fBLPFEj7rZTnS 3VUTdP+SRKx1aTcFQ/ne3rCh8z0cmylvebcz2nf5j9TOF/Wg5fQxwZyQ7Snq17KsV2BV ryLOnlq5g5t2bFwyxnCAU9iJ7rivNIQlf6WYvZBUJHBBx09QPCeJwrB/Xff5aF2iDZ3O PvxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=YFUIsu2r; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ci3si2403732ejb.37.2019.11.04.07.28.27; Mon, 04 Nov 2019 07:28:50 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=YFUIsu2r; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729277AbfKDPZS (ORCPT + 99 others); Mon, 4 Nov 2019 10:25:18 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:43140 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728188AbfKDPZR (ORCPT ); Mon, 4 Nov 2019 10:25:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6RJcO60dMsiGxsPGdyjVOQPZBFgaMzgTygSbxJ4e+CU=; b=YFUIsu2rIwYhtf0YQrTNvlcjJ SO0I4oSS3QynWHt7Sazsyq1IOUCgun/k4vJiIXjPKOSrykbptDYDNBUa3tIVDiH6tXElNKPd+xpYX cHagNUwalzMj4LTnTbdW7KsQxPxrALcRMaxYc5q2M4omVPBnfOKzp/YFOPYixHVoPYHBJ6xDphfgk WEqggglMx1L0p5wZd+tQ6FxibmvYjxRBQLicMrJj44MXc6GAKXU58cXXt1BNM//WiPHcWS3hgc3k5 c091YmFnkMl+tpSJcZWD2lAqemywdW1aTCLGq+ywBcILCaW/lysqqxUz6E4dx1ipzHrWgoq5g5QkG I/vaNzUAg==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1iReEH-0001io-FZ; Mon, 04 Nov 2019 15:25:17 +0000 Date: Mon, 4 Nov 2019 07:25:17 -0800 From: Christoph Hellwig To: Shaokun Zhang Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Guo , "Darrick J. Wong" Subject: Re: [PATCH] xfs: optimise xfs_mod_icount/ifree when delta < 0 Message-ID: <20191104152517.GD10485@infradead.org> References: <1572866980-13001-1-git-send-email-zhangshaokun@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1572866980-13001-1-git-send-email-zhangshaokun@hisilicon.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 04, 2019 at 07:29:40PM +0800, Shaokun Zhang wrote: > From: Yang Guo > > percpu_counter_compare will be called by xfs_mod_icount/ifree to check > whether the counter less than 0 and it is a expensive function. > let's check it only when delta < 0, it will be good for xfs's performance. How much overhead do you see? In the end the compare is just a debug check, so if it actually shows up we should remove it entirely.