Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp223584ybx; Mon, 4 Nov 2019 19:09:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxuaWDGsO4PHXfCeT5vifqo6spLl2HeOmeAmBC4zFNY5MOVXBwiyWLhzvnO+fk2pDogmUia X-Received: by 2002:aa7:cd0d:: with SMTP id b13mr33958705edw.146.1572923358462; Mon, 04 Nov 2019 19:09:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572923358; cv=none; d=google.com; s=arc-20160816; b=JgsHoCSXKXbPBq7V1s/dtQwzCAWp475N2CdPo7uu8b+Taakg9OpnN4Ou1dhrEkmTX9 RQFgnB94Q9D+YwMT5tSxE/VZ84HF4D3kyAydDe36jZ6Q+dMRCKZqJm64BcA6VOf2laCI 652r1uQd5JNmeyc2ocLdp3+LEulhrip973Ar1iyiABM0l8YFzYWivj+Vc/n4pWrxNZ7U vZAodeDnwrp1pq53bQgmbnrMQ7lHn4NWN6AKNdrTAuT20O4Euu4sLaDn11Gt9BilgbWX onK4UoxdW4LKERJ6I84H+FDwmr54yuqmkBjTGEJcVN/VmMs0P1nzzbyg8oKqFEbzDXAD 5e4A== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=kOoJlvPTkuAzYTEPnpFPnKcUEg1aen8NDORhhBxTPSo=; b=OyLu0f+fEDH825/LPQr7nzZM7rQ7gRYUcVFb3GiP2tP75qyjh7F5neUrL0mUYvm18u 5RSJktsLp+YyKe5bsu9yzYvetPu+aT3ymvI7ygPfDyrwFCB2vzsh/T1BjXS8w0UIF3/J Ie7hZBoJABy+1VrGrtQ+pnzCx+pCxRh5hRjhoiutvsEguELefHQfxe+JHfPs05+IAefk h1qfziWbyihmAeO59VsXcjl7Un0DValwDLcBr2v2FGJSuguLG0rCFscRHo8IgL7W3wPu nwIPSM3Ubw7PEq5CxmBqnK47lRF0WfIoxJKF6aGILL9SHX4HcEVPeGt899xI6PTe0o41 bcKw== ARC-Authentication-Results: i=1; mx.google.com; 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 c36si9653465edf.165.2019.11.04.19.08.54; Mon, 04 Nov 2019 19:09:18 -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; 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 S1729822AbfKEDIO (ORCPT + 99 others); Mon, 4 Nov 2019 22:08:14 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:6149 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727861AbfKEDIO (ORCPT ); Mon, 4 Nov 2019 22:08:14 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id E69B818E32CC7FF4FE48; Tue, 5 Nov 2019 11:08:11 +0800 (CST) Received: from [127.0.0.1] (10.74.221.148) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.439.0; Tue, 5 Nov 2019 11:08:01 +0800 Subject: Re: [PATCH] xfs: optimise xfs_mod_icount/ifree when delta < 0 To: Christoph Hellwig References: <1572866980-13001-1-git-send-email-zhangshaokun@hisilicon.com> <20191104152517.GD10485@infradead.org> CC: , , Yang Guo , "Darrick J. Wong" From: Shaokun Zhang Message-ID: Date: Tue, 5 Nov 2019 11:08:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20191104152517.GD10485@infradead.org> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.74.221.148] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christoph, On 2019/11/4 23:25, Christoph Hellwig wrote: > 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 Thanks your reply, sorry for my not clear description. __percpu_counter_compare itself is not expensive, but __percpu_counter_sum called by __percpu_counter_compare is high load, I will list it in next thread. > check, so if it actually shows up we should remove it entirely. > I'm not sure about it, so I check the delta to do less modification. Thanks, Shaokun >