Message ID | 20230315084938.2544737-5-david@fromorbit.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2210971wrd; Wed, 15 Mar 2023 01:50:34 -0700 (PDT) X-Google-Smtp-Source: AK7set869eenbbq2tSibve01t65aRLrxvG51prJEfjQnCKdrbyCjTSAVDt7iT4EVAPiLXJKYkbrS X-Received: by 2002:a05:6a20:244d:b0:bf:58d1:ce86 with SMTP id t13-20020a056a20244d00b000bf58d1ce86mr16299470pzc.5.1678870233836; Wed, 15 Mar 2023 01:50:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678870233; cv=none; d=google.com; s=arc-20160816; b=T26ba+I7McVzoM52UJNpETBaJZG7PrGVP0fufMJbg+MztVmFcnBfjCtc0GR2iLOfQ5 qRCpZiC/5k6N5caO1plRqT/SgSiyQbOWyRxqcazlXOpEBBR+VyGyINMJDoclR1gQ9nWF 2U/CQVYDmLZbkqIeniQQlav57tCQex86ZCoE8djt5pqwK9SFAKe0WKogzrWz+43puTff qqPjUPtnR/17X+UhFbU9E87VmXbxH2fATKVIQoZCezSz7CxLnNx/4xIPUVCaeJzlSWF/ 5biiZGIGrjTt7AnSANofbJ3zot8jetKkELEaihkFGwKA+F4gLSPhqhani4D2lQHhyzM2 WtZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DnnMb4Et7WhpEe76RPSGsI6qWidW0Ymzw0QUU6G4yao=; b=WxFIC3/zvjO7Zs25DkNC/cNDNUUWhYX1stOSj8tNZgto/tFQ+0PPZxbftFSgatHGJi FHcVgvtHSN7/N8VZLgenVR1BfpaGHrM7uTaHvZGIDPb3EjuFNzCGvLHgbQAOMCz8Q1If jHg1IlmOEwwVhJ97F98KdZ7oin+cTlpw2fkWttd2cqcydAR1V/u/Q63B98Nk3VVbM15+ nA4Lah9CfEaEy4YpzjgDSznfRo/JMrJiAJZCaFKr+OdJU+RC9pDKB+UcnmPhn+42ug9r aSJ6cw5AYSL3JA+rCwM5FXIKcmpPX1z6atJQwYreqm0Bc8tgUcRnYed5gbIW0gcD/gR1 nvkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fromorbit-com.20210112.gappssmtp.com header.s=20210112 header.b=MldnmFi+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t184-20020a6381c1000000b0050be676d6casi25484pgd.689.2023.03.15.01.50.16; Wed, 15 Mar 2023 01:50:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fromorbit-com.20210112.gappssmtp.com header.s=20210112 header.b=MldnmFi+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231562AbjCOIt4 (ORCPT <rfc822;realc9580@gmail.com> + 99 others); Wed, 15 Mar 2023 04:49:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231770AbjCOIty (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 15 Mar 2023 04:49:54 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30DA45BCA1 for <linux-kernel@vger.kernel.org>; Wed, 15 Mar 2023 01:49:52 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id h12-20020a17090aea8c00b0023d1311fab3so1150053pjz.1 for <linux-kernel@vger.kernel.org>; Wed, 15 Mar 2023 01:49:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20210112.gappssmtp.com; s=20210112; t=1678870191; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DnnMb4Et7WhpEe76RPSGsI6qWidW0Ymzw0QUU6G4yao=; b=MldnmFi+QRjEcfycD9KY0bZvSKUHkvSL3UtA0U/PWvEzo8AB2GYhsOMJ9Yna93phsr 3pmBXGrj79AYyoeIfCO7JsUKNVP8tmqlS8mY/FTf5EtAxhPN1xd1Fm9/pzGq/ZdxfhQz eU2tuyfglF9o3N9mm4hhAzPHlUfBjcvnSq9Nb2s84Jjh61ufX2fH3XB7ShgyRL4j80Ax QyS9p698XnwvyGRgs0e4BrNF4ilCCsUmxrRDQcMuw618JIheaRe7R9Qmg/xhef7MwYkb GmW1c4Xe7Xs5vN1n3/NKD+0FvXsYvic5EsCMGBEC3z5N+9iBqt2u48HdxYZQHcZIPME0 idug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678870191; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DnnMb4Et7WhpEe76RPSGsI6qWidW0Ymzw0QUU6G4yao=; b=TOCfPVzWCZst/cKGnOi7IDqEWlI3YVQcbrEmcmo4kE3UDFLVpK32+H90PI4l3/8Wif mtGdA9CKA0IjXFaK3MqDuSSF12lWZDrOk8BTIBG/9ZfRU+ZJrCY8cvkToJDFPtP6p7Dc LdXEyXUii5N9ctvEOIiaTFKSxbjzsJA65o+WrqAO2IpKMtW6ngIRmpxCwWquZH7qfDka FuKmg2i8NH76Ni5XF/w6ZVn7G5SkpI7Br/QlVS97Oruvyn2zDsyNYBHMmJluGb1tVTDG ilqmJNTSOALxY1tyQ6c5f6LXUs3TH8HH2ffUlBUICut90mDFupJUABbzbDJe/KzQ/oUo +Sug== X-Gm-Message-State: AO0yUKWVsgE78ScfeIuwHSFGDzzE/TG3yZsNu5DPfsqxRBVG2PBkeR4F FDONjth5NueT6tvgaUhdeWtQzUWUcjQ+T7TeqOQ= X-Received: by 2002:a05:6a20:7d88:b0:cc:32a8:323d with SMTP id v8-20020a056a207d8800b000cc32a8323dmr15446982pzj.28.1678870191517; Wed, 15 Mar 2023 01:49:51 -0700 (PDT) Received: from dread.disaster.area (pa49-186-4-237.pa.vic.optusnet.com.au. [49.186.4.237]) by smtp.gmail.com with ESMTPSA id e29-20020a63501d000000b0050be183459bsm593527pgb.34.2023.03.15.01.49.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 01:49:51 -0700 (PDT) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.92.3) (envelope-from <dave@fromorbit.com>) id 1pcMpQ-008zeV-50; Wed, 15 Mar 2023 19:49:48 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.96) (envelope-from <dave@devoid.disaster.area>) id 1pcMpQ-00Ag6X-0S; Wed, 15 Mar 2023 19:49:48 +1100 From: Dave Chinner <david@fromorbit.com> To: linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org Cc: linux-mm@vger.kernel.org, linux-fsdevel@vger.kernel.org, yebin10@huawei.com Subject: [PATCH 4/4] pcpcntr: remove percpu_counter_sum_all() Date: Wed, 15 Mar 2023 19:49:38 +1100 Message-Id: <20230315084938.2544737-5-david@fromorbit.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315084938.2544737-1-david@fromorbit.com> References: <20230315084938.2544737-1-david@fromorbit.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760423034099019501?= X-GMAIL-MSGID: =?utf-8?q?1760423034099019501?= |
Series |
pcpctr: fix percpu_counter_sum vs cpu offline race
|
|
Commit Message
Dave Chinner
March 15, 2023, 8:49 a.m. UTC
From: Dave Chinner <dchinner@redhat.com> percpu_counter_sum_all() is now redundant as the race condition it was invented to handle is now dealt with by percpu_counter_sum() directly and all users of percpu_counter_sum_all() have been removed. Remove it. This effectively reverts the changes made in f689054aace2 ("percpu_counter: add percpu_counter_sum_all interface") except for the cpumask iteration that fixes percpu_counter_sum() made earlier in this series. Signed-off-by: Dave Chinner <dchinner@redhat.com> --- include/linux/percpu_counter.h | 6 ----- lib/percpu_counter.c | 40 ++++++++++------------------------ 2 files changed, 11 insertions(+), 35 deletions(-)
Comments
Hi Dave,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v6.3-rc2 next-20230315]
[cannot apply to dennis-percpu/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Dave-Chinner/cpumask-introduce-for_each_cpu_or/20230315-165202
patch link: https://lore.kernel.org/r/20230315084938.2544737-5-david%40fromorbit.com
patch subject: [PATCH 4/4] pcpcntr: remove percpu_counter_sum_all()
config: i386-randconfig-a005 (https://download.01.org/0day-ci/archive/20230316/202303160333.XqIRz3JU-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/8360dcb55f1eb08fe7a1f457f3b99bef8e306c8b
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Dave-Chinner/cpumask-introduce-for_each_cpu_or/20230315-165202
git checkout 8360dcb55f1eb08fe7a1f457f3b99bef8e306c8b
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 olddefconfig
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/hwmon/ fs/xfs/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303160333.XqIRz3JU-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/linux/string.h:5,
from include/linux/uuid.h:11,
from fs/xfs/xfs_linux.h:10,
from fs/xfs/xfs.h:22,
from fs/xfs/xfs_super.c:7:
fs/xfs/xfs_super.c: In function 'xfs_destroy_percpu_counters':
>> fs/xfs/xfs_super.c:1079:16: error: implicit declaration of function 'percpu_counter_sum_all'; did you mean 'percpu_counter_sum'? [-Werror=implicit-function-declaration]
1079 | percpu_counter_sum_all(&mp->m_delalloc_blks) == 0);
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:77:45: note: in definition of macro 'likely'
77 | # define likely(x) __builtin_expect(!!(x), 1)
| ^
fs/xfs/xfs_super.c:1078:9: note: in expansion of macro 'ASSERT'
1078 | ASSERT(xfs_is_shutdown(mp) ||
| ^~~~~~
cc1: some warnings being treated as errors
vim +1079 fs/xfs/xfs_super.c
8757c38f2cf6e5 Ian Kent 2019-11-04 1070
8757c38f2cf6e5 Ian Kent 2019-11-04 1071 static void
8757c38f2cf6e5 Ian Kent 2019-11-04 1072 xfs_destroy_percpu_counters(
8757c38f2cf6e5 Ian Kent 2019-11-04 1073 struct xfs_mount *mp)
8757c38f2cf6e5 Ian Kent 2019-11-04 1074 {
8757c38f2cf6e5 Ian Kent 2019-11-04 1075 percpu_counter_destroy(&mp->m_icount);
8757c38f2cf6e5 Ian Kent 2019-11-04 1076 percpu_counter_destroy(&mp->m_ifree);
8757c38f2cf6e5 Ian Kent 2019-11-04 1077 percpu_counter_destroy(&mp->m_fdblocks);
75c8c50fa16a23 Dave Chinner 2021-08-18 1078 ASSERT(xfs_is_shutdown(mp) ||
c35278f526edf1 Ye Bin 2023-03-14 @1079 percpu_counter_sum_all(&mp->m_delalloc_blks) == 0);
8757c38f2cf6e5 Ian Kent 2019-11-04 1080 percpu_counter_destroy(&mp->m_delalloc_blks);
2229276c528326 Darrick J. Wong 2022-04-12 1081 percpu_counter_destroy(&mp->m_frextents);
8757c38f2cf6e5 Ian Kent 2019-11-04 1082 }
8757c38f2cf6e5 Ian Kent 2019-11-04 1083
Hi Dave,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v6.3-rc2 next-20230315]
[cannot apply to dennis-percpu/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Dave-Chinner/cpumask-introduce-for_each_cpu_or/20230315-165202
patch link: https://lore.kernel.org/r/20230315084938.2544737-5-david%40fromorbit.com
patch subject: [PATCH 4/4] pcpcntr: remove percpu_counter_sum_all()
config: riscv-randconfig-r042-20230313 (https://download.01.org/0day-ci/archive/20230316/202303160421.bnmiVRCM-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/intel-lab-lkp/linux/commit/8360dcb55f1eb08fe7a1f457f3b99bef8e306c8b
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Dave-Chinner/cpumask-introduce-for_each_cpu_or/20230315-165202
git checkout 8360dcb55f1eb08fe7a1f457f3b99bef8e306c8b
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash fs/xfs/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303160421.bnmiVRCM-lkp@intel.com/
All errors (new ones prefixed by >>):
>> fs/xfs/xfs_super.c:1079:9: error: call to undeclared function 'percpu_counter_sum_all'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
percpu_counter_sum_all(&mp->m_delalloc_blks) == 0);
^
fs/xfs/xfs_super.c:1079:9: note: did you mean 'percpu_counter_sum'?
include/linux/percpu_counter.h:193:19: note: 'percpu_counter_sum' declared here
static inline s64 percpu_counter_sum(struct percpu_counter *fbc)
^
1 error generated.
vim +/percpu_counter_sum_all +1079 fs/xfs/xfs_super.c
8757c38f2cf6e5 Ian Kent 2019-11-04 1070
8757c38f2cf6e5 Ian Kent 2019-11-04 1071 static void
8757c38f2cf6e5 Ian Kent 2019-11-04 1072 xfs_destroy_percpu_counters(
8757c38f2cf6e5 Ian Kent 2019-11-04 1073 struct xfs_mount *mp)
8757c38f2cf6e5 Ian Kent 2019-11-04 1074 {
8757c38f2cf6e5 Ian Kent 2019-11-04 1075 percpu_counter_destroy(&mp->m_icount);
8757c38f2cf6e5 Ian Kent 2019-11-04 1076 percpu_counter_destroy(&mp->m_ifree);
8757c38f2cf6e5 Ian Kent 2019-11-04 1077 percpu_counter_destroy(&mp->m_fdblocks);
75c8c50fa16a23 Dave Chinner 2021-08-18 1078 ASSERT(xfs_is_shutdown(mp) ||
c35278f526edf1 Ye Bin 2023-03-14 @1079 percpu_counter_sum_all(&mp->m_delalloc_blks) == 0);
8757c38f2cf6e5 Ian Kent 2019-11-04 1080 percpu_counter_destroy(&mp->m_delalloc_blks);
2229276c528326 Darrick J. Wong 2022-04-12 1081 percpu_counter_destroy(&mp->m_frextents);
8757c38f2cf6e5 Ian Kent 2019-11-04 1082 }
8757c38f2cf6e5 Ian Kent 2019-11-04 1083
On Thu, Mar 16, 2023 at 03:22:31AM +0800, kernel test robot wrote: > Hi Dave, > > Thank you for the patch! Yet something to improve: No, ithere is nothing wrong with my patch series, this is something for _you_ to improve. > [auto build test ERROR on linus/master] > [also build test ERROR on v6.3-rc2 next-20230315] > [cannot apply to dennis-percpu/for-next] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: https://github.com/intel-lab-lkp/linux/commits/Dave-Chinner/cpumask-introduce-for_each_cpu_or/20230315-165202 > patch link: https://lore.kernel.org/r/20230315084938.2544737-5-david%40fromorbit.com > patch subject: [PATCH 4/4] pcpcntr: remove percpu_counter_sum_all() > config: i386-randconfig-a005 (https://download.01.org/0day-ci/archive/20230316/202303160333.XqIRz3JU-lkp@intel.com/config) > compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 > reproduce (this is a W=1 build): > # https://github.com/intel-lab-lkp/linux/commit/8360dcb55f1eb08fe7a1f457f3b99bef8e306c8b > git remote add linux-review https://github.com/intel-lab-lkp/linux > git fetch --no-tags linux-review Dave-Chinner/cpumask-introduce-for_each_cpu_or/20230315-165202 > git checkout 8360dcb55f1eb08fe7a1f457f3b99bef8e306c8b > # save the config file > mkdir build_dir && cp config build_dir/.config > make W=1 O=build_dir ARCH=i386 olddefconfig > make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/hwmon/ fs/xfs/ > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot <lkp@intel.com> > | Link: https://lore.kernel.org/oe-kbuild-all/202303160333.XqIRz3JU-lkp@intel.com/ > > All errors (new ones prefixed by >>): > > In file included from include/linux/string.h:5, > from include/linux/uuid.h:11, > from fs/xfs/xfs_linux.h:10, > from fs/xfs/xfs.h:22, > from fs/xfs/xfs_super.c:7: > fs/xfs/xfs_super.c: In function 'xfs_destroy_percpu_counters': > >> fs/xfs/xfs_super.c:1079:16: error: implicit declaration of function 'percpu_counter_sum_all'; did you mean 'percpu_counter_sum'? [-Werror=implicit-function-declaration] > 1079 | percpu_counter_sum_all(&mp->m_delalloc_blks) == 0); > | ^~~~~~~~~~~~~~~~~~~~~~ > include/linux/compiler.h:77:45: note: in definition of macro 'likely' > 77 | # define likely(x) __builtin_expect(!!(x), 1) > | ^ > fs/xfs/xfs_super.c:1078:9: note: in expansion of macro 'ASSERT' > 1078 | ASSERT(xfs_is_shutdown(mp) || > | ^~~~~~ > cc1: some warnings being treated as errors > > > vim +1079 fs/xfs/xfs_super.c > > 8757c38f2cf6e5 Ian Kent 2019-11-04 1070 > 8757c38f2cf6e5 Ian Kent 2019-11-04 1071 static void > 8757c38f2cf6e5 Ian Kent 2019-11-04 1072 xfs_destroy_percpu_counters( > 8757c38f2cf6e5 Ian Kent 2019-11-04 1073 struct xfs_mount *mp) > 8757c38f2cf6e5 Ian Kent 2019-11-04 1074 { > 8757c38f2cf6e5 Ian Kent 2019-11-04 1075 percpu_counter_destroy(&mp->m_icount); > 8757c38f2cf6e5 Ian Kent 2019-11-04 1076 percpu_counter_destroy(&mp->m_ifree); > 8757c38f2cf6e5 Ian Kent 2019-11-04 1077 percpu_counter_destroy(&mp->m_fdblocks); > 75c8c50fa16a23 Dave Chinner 2021-08-18 1078 ASSERT(xfs_is_shutdown(mp) || > c35278f526edf1 Ye Bin 2023-03-14 @1079 percpu_counter_sum_all(&mp->m_delalloc_blks) == 0); This change has not been committed to any tree that I am aware of. It was only posted to the XFS list yesterday, and I effectively NACK'd it and wrote this patchset instead to fix the issue. IOWs, if -anyone- has actually committed this change to add percpu_counter_sum_all() to XFS, they've done the wrong thing. Hence this build failure is a robot issue, not a problem with my patch series. -Dave.
On Thu, Mar 16, 2023 at 04:14:04AM +0800, kernel test robot wrote: > Hi Dave, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on linus/master] > [also build test ERROR on v6.3-rc2 next-20230315] > [cannot apply to dennis-percpu/for-next] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: https://github.com/intel-lab-lkp/linux/commits/Dave-Chinner/cpumask-introduce-for_each_cpu_or/20230315-165202 > patch link: https://lore.kernel.org/r/20230315084938.2544737-5-david%40fromorbit.com > patch subject: [PATCH 4/4] pcpcntr: remove percpu_counter_sum_all() > config: riscv-randconfig-r042-20230313 (https://download.01.org/0day-ci/archive/20230316/202303160421.bnmiVRCM-lkp@intel.com/config) > compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7) > reproduce (this is a W=1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # install riscv cross compiling tool for clang build > # apt-get install binutils-riscv64-linux-gnu > # https://github.com/intel-lab-lkp/linux/commit/8360dcb55f1eb08fe7a1f457f3b99bef8e306c8b > git remote add linux-review https://github.com/intel-lab-lkp/linux > git fetch --no-tags linux-review Dave-Chinner/cpumask-introduce-for_each_cpu_or/20230315-165202 > git checkout 8360dcb55f1eb08fe7a1f457f3b99bef8e306c8b > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv olddefconfig > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash fs/xfs/ > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot <lkp@intel.com> > | Link: https://lore.kernel.org/oe-kbuild-all/202303160421.bnmiVRCM-lkp@intel.com/ > > All errors (new ones prefixed by >>): > > >> fs/xfs/xfs_super.c:1079:9: error: call to undeclared function 'percpu_counter_sum_all'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] > percpu_counter_sum_all(&mp->m_delalloc_blks) == 0); > ^ > fs/xfs/xfs_super.c:1079:9: note: did you mean 'percpu_counter_sum'? > include/linux/percpu_counter.h:193:19: note: 'percpu_counter_sum' declared here > static inline s64 percpu_counter_sum(struct percpu_counter *fbc) > ^ > 1 error generated. > > > vim +/percpu_counter_sum_all +1079 fs/xfs/xfs_super.c > > 8757c38f2cf6e5 Ian Kent 2019-11-04 1070 > 8757c38f2cf6e5 Ian Kent 2019-11-04 1071 static void > 8757c38f2cf6e5 Ian Kent 2019-11-04 1072 xfs_destroy_percpu_counters( > 8757c38f2cf6e5 Ian Kent 2019-11-04 1073 struct xfs_mount *mp) > 8757c38f2cf6e5 Ian Kent 2019-11-04 1074 { > 8757c38f2cf6e5 Ian Kent 2019-11-04 1075 percpu_counter_destroy(&mp->m_icount); > 8757c38f2cf6e5 Ian Kent 2019-11-04 1076 percpu_counter_destroy(&mp->m_ifree); > 8757c38f2cf6e5 Ian Kent 2019-11-04 1077 percpu_counter_destroy(&mp->m_fdblocks); > 75c8c50fa16a23 Dave Chinner 2021-08-18 1078 ASSERT(xfs_is_shutdown(mp) || > c35278f526edf1 Ye Bin 2023-03-14 @1079 percpu_counter_sum_all(&mp->m_delalloc_blks) == 0); Ah, yes, ChatGPT-4 hired someone via Mechanical Turk to log in to my kernel.org account, answer the CAPTCHA, and push Ye's patch into for-next. (No it didn't. Is your bot merging random patches from the XFS list and whining when the result doesn't build? WTH is going on here??) --D > 8757c38f2cf6e5 Ian Kent 2019-11-04 1080 percpu_counter_destroy(&mp->m_delalloc_blks); > 2229276c528326 Darrick J. Wong 2022-04-12 1081 percpu_counter_destroy(&mp->m_frextents); > 8757c38f2cf6e5 Ian Kent 2019-11-04 1082 } > 8757c38f2cf6e5 Ian Kent 2019-11-04 1083 > > -- > 0-DAY CI Kernel Test Service > https://github.com/intel/lkp-tests
On Thu, Mar 16, 2023 at 07:55:50AM +1100, Dave Chinner wrote: > On Thu, Mar 16, 2023 at 03:22:31AM +0800, kernel test robot wrote: > > Hi Dave, > > > > Thank you for the patch! Yet something to improve: > > No, ithere is nothing wrong with my patch series, this is something > for _you_ to improve. > > > [auto build test ERROR on linus/master] > > [also build test ERROR on v6.3-rc2 next-20230315] > > [cannot apply to dennis-percpu/for-next] > > [If your patch is applied to the wrong git tree, kindly drop us a note. > > And when submitting patch, we suggest to use '--base' as documented in > > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > > > url: https://github.com/intel-lab-lkp/linux/commits/Dave-Chinner/cpumask-introduce-for_each_cpu_or/20230315-165202 > > patch link: https://lore.kernel.org/r/20230315084938.2544737-5-david%40fromorbit.com > > patch subject: [PATCH 4/4] pcpcntr: remove percpu_counter_sum_all() > > config: i386-randconfig-a005 (https://download.01.org/0day-ci/archive/20230316/202303160333.XqIRz3JU-lkp@intel.com/config) > > compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 > > reproduce (this is a W=1 build): > > # https://github.com/intel-lab-lkp/linux/commit/8360dcb55f1eb08fe7a1f457f3b99bef8e306c8b > > git remote add linux-review https://github.com/intel-lab-lkp/linux > > git fetch --no-tags linux-review Dave-Chinner/cpumask-introduce-for_each_cpu_or/20230315-165202 > > git checkout 8360dcb55f1eb08fe7a1f457f3b99bef8e306c8b > > # save the config file > > mkdir build_dir && cp config build_dir/.config > > make W=1 O=build_dir ARCH=i386 olddefconfig > > make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/hwmon/ fs/xfs/ > > > > If you fix the issue, kindly add following tag where applicable > > | Reported-by: kernel test robot <lkp@intel.com> > > | Link: https://lore.kernel.org/oe-kbuild-all/202303160333.XqIRz3JU-lkp@intel.com/ > > > > All errors (new ones prefixed by >>): > > > > In file included from include/linux/string.h:5, > > from include/linux/uuid.h:11, > > from fs/xfs/xfs_linux.h:10, > > from fs/xfs/xfs.h:22, > > from fs/xfs/xfs_super.c:7: > > fs/xfs/xfs_super.c: In function 'xfs_destroy_percpu_counters': > > >> fs/xfs/xfs_super.c:1079:16: error: implicit declaration of function 'percpu_counter_sum_all'; did you mean 'percpu_counter_sum'? [-Werror=implicit-function-declaration] > > 1079 | percpu_counter_sum_all(&mp->m_delalloc_blks) == 0); > > | ^~~~~~~~~~~~~~~~~~~~~~ > > include/linux/compiler.h:77:45: note: in definition of macro 'likely' > > 77 | # define likely(x) __builtin_expect(!!(x), 1) > > | ^ > > fs/xfs/xfs_super.c:1078:9: note: in expansion of macro 'ASSERT' > > 1078 | ASSERT(xfs_is_shutdown(mp) || > > | ^~~~~~ > > cc1: some warnings being treated as errors > > > > > > vim +1079 fs/xfs/xfs_super.c > > > > 8757c38f2cf6e5 Ian Kent 2019-11-04 1070 > > 8757c38f2cf6e5 Ian Kent 2019-11-04 1071 static void > > 8757c38f2cf6e5 Ian Kent 2019-11-04 1072 xfs_destroy_percpu_counters( > > 8757c38f2cf6e5 Ian Kent 2019-11-04 1073 struct xfs_mount *mp) > > 8757c38f2cf6e5 Ian Kent 2019-11-04 1074 { > > 8757c38f2cf6e5 Ian Kent 2019-11-04 1075 percpu_counter_destroy(&mp->m_icount); > > 8757c38f2cf6e5 Ian Kent 2019-11-04 1076 percpu_counter_destroy(&mp->m_ifree); > > 8757c38f2cf6e5 Ian Kent 2019-11-04 1077 percpu_counter_destroy(&mp->m_fdblocks); > > 75c8c50fa16a23 Dave Chinner 2021-08-18 1078 ASSERT(xfs_is_shutdown(mp) || > > c35278f526edf1 Ye Bin 2023-03-14 @1079 percpu_counter_sum_all(&mp->m_delalloc_blks) == 0); > > This change has not been committed to any tree that I am aware of. > It was only posted to the XFS list yesterday, and I effectively > NACK'd it and wrote this patchset instead to fix the issue. > > IOWs, if -anyone- has actually committed this change to add > percpu_counter_sum_all() to XFS, they've done the wrong thing. > Hence this build failure is a robot issue, not a problem with my > patch series. Sorry about this false positive report. The robot misinterpreted the link in the cover letter, and wrongly thought it was a prerequisite patch for this patch series, leading to this false report. We will improve the robot and increase the accuracy. -- Best Regards, Yujie
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index 521a733e21a9..75b73c83bc9d 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h @@ -45,7 +45,6 @@ void percpu_counter_set(struct percpu_counter *fbc, s64 amount); void percpu_counter_add_batch(struct percpu_counter *fbc, s64 amount, s32 batch); s64 __percpu_counter_sum(struct percpu_counter *fbc); -s64 percpu_counter_sum_all(struct percpu_counter *fbc); int __percpu_counter_compare(struct percpu_counter *fbc, s64 rhs, s32 batch); void percpu_counter_sync(struct percpu_counter *fbc); @@ -196,11 +195,6 @@ static inline s64 percpu_counter_sum(struct percpu_counter *fbc) return percpu_counter_read(fbc); } -static inline s64 percpu_counter_sum_all(struct percpu_counter *fbc) -{ - return percpu_counter_read(fbc); -} - static inline bool percpu_counter_initialized(struct percpu_counter *fbc) { return true; diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c index 0e096311e0c0..5004463c4f9f 100644 --- a/lib/percpu_counter.c +++ b/lib/percpu_counter.c @@ -122,23 +122,6 @@ void percpu_counter_sync(struct percpu_counter *fbc) } EXPORT_SYMBOL(percpu_counter_sync); -static s64 __percpu_counter_sum_mask(struct percpu_counter *fbc, - const struct cpumask *cpu_mask) -{ - s64 ret; - int cpu; - unsigned long flags; - - raw_spin_lock_irqsave(&fbc->lock, flags); - ret = fbc->count; - for_each_cpu_or(cpu, cpu_online_mask, cpu_mask) { - s32 *pcount = per_cpu_ptr(fbc->counters, cpu); - ret += *pcount; - } - raw_spin_unlock_irqrestore(&fbc->lock, flags); - return ret; -} - /* * Add up all the per-cpu counts, return the result. This is a more accurate * but much slower version of percpu_counter_read_positive(). @@ -153,22 +136,21 @@ static s64 __percpu_counter_sum_mask(struct percpu_counter *fbc, */ s64 __percpu_counter_sum(struct percpu_counter *fbc) { + s64 ret; + int cpu; + unsigned long flags; - return __percpu_counter_sum_mask(fbc, cpu_dying_mask); + raw_spin_lock_irqsave(&fbc->lock, flags); + ret = fbc->count; + for_each_cpu_or(cpu, cpu_online_mask, cpu_dying_mask) { + s32 *pcount = per_cpu_ptr(fbc->counters, cpu); + ret += *pcount; + } + raw_spin_unlock_irqrestore(&fbc->lock, flags); + return ret; } EXPORT_SYMBOL(__percpu_counter_sum); -/* - * This is slower version of percpu_counter_sum as it traverses all possible - * cpus. Use this only in the cases where accurate data is needed in the - * presense of CPUs getting offlined. - */ -s64 percpu_counter_sum_all(struct percpu_counter *fbc) -{ - return __percpu_counter_sum_mask(fbc, cpu_possible_mask); -} -EXPORT_SYMBOL(percpu_counter_sum_all); - int __percpu_counter_init(struct percpu_counter *fbc, s64 amount, gfp_t gfp, struct lock_class_key *key) {