Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1169195ybj; Thu, 7 May 2020 16:48:01 -0700 (PDT) X-Google-Smtp-Source: APiQypKX04lT7WWeayV/zUw/MfTpGPM+uwYtG5GkSJJlfKleUQSD7txo9d3PSctYJ1FMSNC/LWKB X-Received: by 2002:a17:906:2558:: with SMTP id j24mr14900733ejb.72.1588895281392; Thu, 07 May 2020 16:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588895281; cv=none; d=google.com; s=arc-20160816; b=P+8TvCd9vxcegakuERVwDSIhMfOJi/tmoqJ8Y6DJOz6ukZ2EoHTbh3macPFewq75z1 bRmMWkTj+GhZXafgx8v97OOR980NPXZVfB1YWBpdBHiLmaFKda9vptDHVNYWQKBT73y9 CpWH99f0BIp36/+bT99FpjWr+OR8pMAxY+h1xGCRXaLdmyDUCmIrp8wOYXUV+UEHDXoM T81p7Ns36UWsEYH6khjzaiEW2NRKCsTeA8qxbWZZE8MF6A6e4G6VZCAUAbHH5lexVfOn jBe55Wiz+T9KgHbcphywn4zvh7tkFOUat31MxpxouBDS0aWvUxEciPZHuTCFYxn9E8QE uZNA== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=hs2OD+4p3dtIw17axZt6/s0lURQiI/b7k3z0t4omGDk=; b=rij0WB/5+9NAlKsWFzhcFE9EA+Frrfjv3/scZhzuhmezdUChzBJsSwy5AAzNu7teGg j3AbqMYuuqo5Xja7aL996OwSAMerye55utn8az9IGWMQXMVl4ooVPCgNY8QPdwTso6iZ AWDNped4I7LoDQi7vOXAmRUbmH5NO/qVq0GYq0r/fVLDBBCu7PruNdlsEXKJKYSh3chK Zw9JqXk1ub57JR+mfQlfvizeyOvFdOqpffWHSpuZu0l8OdjT+ypfjYSYpoLJJ7sNyCNj JFHJy6OGV0k2v+se+4iAf9HBGjLIisxTEugIqrSvy178b8xcEObiYH1DsyOyXgxDhkFf +xlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i+7a50XW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y24si3988891edo.538.2020.05.07.16.47.38; Thu, 07 May 2020 16:48:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i+7a50XW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726660AbgEGXqP (ORCPT + 99 others); Thu, 7 May 2020 19:46:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:49848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726476AbgEGXqP (ORCPT ); Thu, 7 May 2020 19:46:15 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7EDA6208E4; Thu, 7 May 2020 23:46:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588895174; bh=v7cjrS6d93OQFBJhTl5Ioe67MhGi9wE72gyBF2JkO/o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=i+7a50XW0+kgIesPy+uhKFEt/MwSiX4KDSnPrT1IbL1Ji3cwSSFIM1KxGMSR5/IhI e+6g8kvlz/fGJxFniZpvI89OEsEFakhTSTJ6GH174nvOYiJP4FVoJoW8RklFOVdijC cn4P1n0OhzztdqwqzfxOZvxxGcskT7pZHCHQVybc= Date: Thu, 7 May 2020 16:46:14 -0700 From: Andrew Morton To: Tan Hu Cc: linux-kernel@vger.kernel.org, xue.zhihong@zte.com.cn, wang.yi59@zte.com.cn, wang.liang82@zte.com.cn, Jan Kara Subject: Re: [PATCH] lib/flex_proportions.c: aging counts when fraction smaller than max_frac/FPROP_FRAC_BASE Message-Id: <20200507164614.4a816d2aa1b341be937b128a@linux-foundation.org> In-Reply-To: <1588746088-38605-1-git-send-email-tan.hu@zte.com.cn> References: <1588746088-38605-1-git-send-email-tan.hu@zte.com.cn> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 May 2020 14:21:28 +0800 Tan Hu wrote: > If the given type has fraction smaller than max_frac/FPROP_FRAC_BASE, > __fprop_inc_percpu_max should follow the design formula and aging > fraction too. > > Signed-off-by: Tan Hu > --- > lib/flex_proportions.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/lib/flex_proportions.c b/lib/flex_proportions.c > index 7852bfff5..451543937 100644 > --- a/lib/flex_proportions.c > +++ b/lib/flex_proportions.c > @@ -266,8 +266,7 @@ void __fprop_inc_percpu_max(struct fprop_global *p, > if (numerator > > (((u64)denominator) * max_frac) >> FPROP_FRAC_SHIFT) > return; > - } else > - fprop_reflect_period_percpu(p, pl); > - percpu_counter_add_batch(&pl->events, 1, PROP_BATCH); > - percpu_counter_add(&p->events, 1); > + } > + > + __fprop_inc_percpu(p, pl); > } (Cc Jan)