Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2997442lqp; Mon, 25 Mar 2024 16:12:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVoDV9CJOnB9RcvZdCaF9BcPi0nBX0+VSnxbY7ktv4K2Qzw6AJbiNJdfUMssKtNr/eyFqNN5GftBJStmbqS9VaNsgMwq5wQbQqTB/pRbw== X-Google-Smtp-Source: AGHT+IE/zL6ne5PSdPohLdEhAGxv7xV9PDiaGQFGuPZvaMtBZuifqm1ouT7eKp1GZ57Ddhu9+5sW X-Received: by 2002:a92:d447:0:b0:368:a0d1:9200 with SMTP id r7-20020a92d447000000b00368a0d19200mr358796ilm.12.1711408362451; Mon, 25 Mar 2024 16:12:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711408362; cv=pass; d=google.com; s=arc-20160816; b=FCdZw/bUHsja2F/7WvaTHepUT+S1T8ro2xsoBucX6cvvOgVD92FuYuo0NVsWE0016x AS2ptkSwbBn8RybAxZvesNIUoDLb49bPKphQ8Yhk96cP0THg1i0ApdpR83LpjMgRq4Ue p/F8qPMzk/1NqpRe4gEb0ewJ6gvp6lMuhZI+SFvjlv1iQQxFBf9tIyNeCf3/giRnIq72 S6N9xjEW3am37tA2/c7YwHi6PuDomgkjTKSAvmqnxJ7FJKR6KiVp1D1o7VXPoZbTLc5R mJkPd5rjicaPFDrzc4f5d7inXTkEZWCKXZVkcHB455HTjrCagcUf1N+IqBxdaOrgbqzG AhDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=sudVb9mARoSqseIaPEhFIL6LrZXJUwIdE56RRwfcQ0M=; fh=QQyVI2zFqGIiJmpIzHpeuYhuq9NP5HPsWAdH+bfmZ74=; b=H9rE7BSxBEjiUW+2bARYXuvaIC0fCuo+4pER2xcSqAqYuld+HLPLqRm1hLkxYy4bnz TBdNyU1QVbYsx6tZSjTlovDa+2KQGrMn32NK5YjGc+wyDFZj5sMvwwDE7t8nOQYJnjii lUSNiojejJayY9VquBWtgd0yVqPZrUmeBcb69I4R27bhUZJf8qD5KqQluDZ7q5jSU5h3 +UIsWUtRpJbNxTSOhFvK9mjPihubWnxUbh7xgr9bibqul2AejQ8fg2UAjoYD+bLoLRte BRbNiW4Nl/Rgx8mR9q9o5rqLX+AJcW8gKDV3z3tYcBzpVUySB+I5CTDZhQtydCoNEqNC QcWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=DJ1e771R; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=se1IqUQd; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b="IQTu0/aC"; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-117773-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117773-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d127-20020a633685000000b005bd27be66e1si8299631pga.719.2024.03.25.16.12.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 16:12:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117773-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=DJ1e771R; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=se1IqUQd; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b="IQTu0/aC"; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-117773-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117773-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 43C4FB27283 for ; Mon, 25 Mar 2024 19:09:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F134D10957; Mon, 25 Mar 2024 19:09:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="DJ1e771R"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="JZvRYvOM"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="se1IqUQd"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="IQTu0/aC" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 635AFDF55 for ; Mon, 25 Mar 2024 19:09:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711393791; cv=none; b=Y1xzg4wVm1BTxl9YTXbaSoqLFXfhCDyA81KYfEOLh4/90woaKMMGr1QU+/lxDeDdBPxAgXQ7+vce9dzt620ZKtnyUbWGuPcoZDMYXLxmFnEZQFjFhGLESwRg8iyeYbo7yCEHd5rOFqv/VFD97+dFx52hSIl87QHoVl2rW/gohgs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711393791; c=relaxed/simple; bh=+iF7RhZ2/9Fke2dtW7mTj5eRdoVxC9oifdiPwnIz0R8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=K9yCiPeuyvJcNpE+O14sPtRDDfXOpFadfcyxMzo9DDej07v8UoqgEu5QtJ5WHB6Mm7PkkMh175s9JQHf9uNTnVfwnjDY/a6+wIYX+LNkRhwDggTjTWJZDDC+sm5JAij7zFoKlz/rjoasD6PFbX12t8Kpz8esImEUDXCsldqTv48= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=DJ1e771R; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=JZvRYvOM; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=se1IqUQd; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=IQTu0/aC; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id AE7225CAAB; Mon, 25 Mar 2024 19:09:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1711393787; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sudVb9mARoSqseIaPEhFIL6LrZXJUwIdE56RRwfcQ0M=; b=DJ1e771R0YX/qyQzd4uRLvjJzI+31qZr836lD2OwHiXzI9IkZDd1l6xD4i6JQ6CMrV67HG p9sMADvSXyRPtiCRdrXKls8P225k4ywEUiNnXfdcOeH5GNEG+/VewJOqa3YM2XUhckV45K YrIhomwO5loGa6beQ/4tKAJ/GSYuxpE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1711393787; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sudVb9mARoSqseIaPEhFIL6LrZXJUwIdE56RRwfcQ0M=; b=JZvRYvOMgk+zrDBifX8E0Sek+qz0ryRWbeb6sa9uVo2ezQuMsFSqrkIcmwRHEIdRPOc0FI ISZB4XtfjX7orwBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1711393786; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sudVb9mARoSqseIaPEhFIL6LrZXJUwIdE56RRwfcQ0M=; b=se1IqUQdnwccpQTFK/9T4baldLLtairVp8Ff3erE/2ztNwSm6T8eBKxkOs9+c8snG3MS7T kkxpauficZIr9nohzIse4QPsNl9azjucSaLAbpPWHTmzGqyf5qSVBsqJW7T8FCOHZeaOxz VZ0ltcG+b+pVKTKmiyslKKIzFiuYu68= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1711393786; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sudVb9mARoSqseIaPEhFIL6LrZXJUwIdE56RRwfcQ0M=; b=IQTu0/aCWZrhgEzvc5rfTDuzpGibs7DjoD5A3VZgqnKO1dIJIiUIj3JR5zkMNnjTc6HJmJ PCRqwHTESGkbzmBw== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id A064513A2E; Mon, 25 Mar 2024 19:09:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 4czbJvrLAWYXZgAAn2gu4w (envelope-from ); Mon, 25 Mar 2024 19:09:46 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 3A830A0812; Mon, 25 Mar 2024 20:09:42 +0100 (CET) Date: Mon, 25 Mar 2024 20:09:42 +0100 From: Jan Kara To: Kefeng Wang Cc: Jan Kara , Dennis Zhou , linux-kernel@vger.kernel.org Subject: Re: [PATCH] fs: quota: use group allocation of per-cpu counters API Message-ID: <20240325190942.6a5eoktohdabtmmn@quack3> References: <20240325041240.53537-1-wangkefeng.wang@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240325041240.53537-1-wangkefeng.wang@huawei.com> Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -0.80 X-Spamd-Result: default: False [-0.80 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; DBL_BLOCKED_OPENRESOLVER(0.00)[huawei.com:email,suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[41.01%] X-Spam-Flag: NO On Mon 25-03-24 12:12:40, Kefeng Wang wrote: > Use group allocation of per-cpu counters api to accelerate > dquot_init() and simplify code. > > Signed-off-by: Kefeng Wang Looks good. I've merged the patch to my tree. Thanks! Honza > --- > fs/quota/dquot.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c > index dacbee455c03..808544f74e5e 100644 > --- a/fs/quota/dquot.c > +++ b/fs/quota/dquot.c > @@ -3016,11 +3016,10 @@ static int __init dquot_init(void) > if (!dquot_hash) > panic("Cannot create dquot hash table"); > > - for (i = 0; i < _DQST_DQSTAT_LAST; i++) { > - ret = percpu_counter_init(&dqstats.counter[i], 0, GFP_KERNEL); > - if (ret) > - panic("Cannot create dquot stat counters"); > - } > + ret = percpu_counter_init_many(dqstats.counter, 0, GFP_KERNEL, > + _DQST_DQSTAT_LAST); > + if (ret) > + panic("Cannot create dquot stat counters"); > > /* Find power-of-two hlist_heads which can fit into allocation */ > nr_hash = (1UL << order) * PAGE_SIZE / sizeof(struct hlist_head); > -- > 2.41.0 > -- Jan Kara SUSE Labs, CR