From patchwork Mon Aug 5 18:38:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 13753969 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C59EC3DA7F for ; Mon, 5 Aug 2024 18:40:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9DDC06B0085; Mon, 5 Aug 2024 14:40:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 941BD6B0095; Mon, 5 Aug 2024 14:40:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 71E9F6B0096; Mon, 5 Aug 2024 14:40:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 51C316B0085 for ; Mon, 5 Aug 2024 14:40:39 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 0BFC140219 for ; Mon, 5 Aug 2024 18:40:39 +0000 (UTC) X-FDA: 82419057798.03.001923D Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by imf06.hostedemail.com (Postfix) with ESMTP id 1A5ED180013 for ; Mon, 5 Aug 2024 18:40:36 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=J5cQLUi4; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.218.43 as permitted sender) smtp.mailfrom=ubizjak@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722883187; a=rsa-sha256; cv=none; b=gEcnLCAWEDDaco9pmUGM0PqUSdEZKCdLhStG0eKDwZjLJrp+FYcyorjWzbIE+wphLKDVHN Ygib5WpcXDf2J9/DvgDkN/YRP+DBjsB35Sd5avIGmq/4HP4cWE+kHRnag6306mBXmkhUfI fhTgRmLbZi5Csd2D3Oob6wWUILpEBBQ= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=J5cQLUi4; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of ubizjak@gmail.com designates 209.85.218.43 as permitted sender) smtp.mailfrom=ubizjak@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722883187; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kE/o4qSaUHLv/y40/aLwm+zO5SXvHFNVlO+ercnrRJY=; b=8IcmMpe6mJl0KHmDGVv5QamQ4XK3xYArVf4qTiGOAIZbP2NLIvo/vuD4VlFdPEjahG7ZvM icuv1DWB9OaVwRQfQbuMIzf9kurd1zD07MWNZoH6uUE/ac555FvTWsoPODxY+qJjld0s8M Gii8Xyf6WzCR/3uC8WgGj68K69zL4Q4= Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a7a8a4f21aeso1399413166b.2 for ; Mon, 05 Aug 2024 11:40:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722883235; x=1723488035; darn=kvack.org; 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=kE/o4qSaUHLv/y40/aLwm+zO5SXvHFNVlO+ercnrRJY=; b=J5cQLUi4ZQ8iSVkFDnRtbNwzClB/g45ypreeDVFu9PvFaSzcSWDtR6NDkiCoTbenvI sIZiAJzTW0C6LqBqAqXIVRHGzH1g6H32nEQXWOQmVq4d6Lf2navSj7MsUvhyamoijP2s oaYkLgqUqUsu1PIxkq0n8YJSzqnjgoJAMesMjbaNAo0QTmcL3aGSBdm5oKhVxzLUR+5K yZX1KDV5RIH/NIIYzId9DcXBcR9qiou62zoWmcdWlbwb/EtaLW+vtUvXxJnwSmU2xWX8 JjgB12kYjQTBhK7IkANNIKFW91oW4oYingWQkXOCPBw7OU4pNXDdkwfAOCUdS2oDFlMN qBqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722883235; x=1723488035; 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=kE/o4qSaUHLv/y40/aLwm+zO5SXvHFNVlO+ercnrRJY=; b=lcl2Brhsa9B05WXFh7ocrtRb8PdjqxO9OAZJY8vOIkofq+BSngUNeEaxYaxf5M0Exn C1h+p3N9HIjf3rs+GLT80zrpQ4tN/QXWTgzGpeV7zpJKExgdUcqBRNA4LdDKNd4mwFhD /hNXlegFatxpFSDWN7TCW+ugLZwIqFKmLb+C2L849X+s2vlDK7/cuXov/C145uq3fpAm CLJd+Tr2F3ztNvsv87heo13396NVZC+Y9QSzvvmi0nXvHdm46dpPRueBQ5N7HHrtVdXp XYVzmV5cXvTNxYypM3jQ0kjQau7yu0WQoI4vHGTQCjI4oRHi61nW1ku2Y4ImOq/Y8jdx RzJw== X-Gm-Message-State: AOJu0Yym7wqxeYjSwxyNB8IiOLBDHKYNMDEZLYuWiO91L3Y3+YTwZ1nA DH5DOF3SQYTMb8WLgrlbvGqIJ77clo/5IwwHj7GcpTswb1hMR7jCipoJPiko X-Google-Smtp-Source: AGHT+IFkVV7ouGVBTfQqeCTN4nxr/EWf3RpQbZFrLGcAjto3LgX3mNyQ3drkidVkE3T2KpUQpA4GsQ== X-Received: by 2002:a17:907:7f90:b0:a7a:bece:6223 with SMTP id a640c23a62f3a-a7dc4db8bfcmr957386466b.6.1722883234971; Mon, 05 Aug 2024 11:40:34 -0700 (PDT) Received: from localhost.localdomain (93-103-32-68.dynamic.t-2.net. [93.103.32.68]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9c12ad3sm478517266b.88.2024.08.05.11.40.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Aug 2024 11:40:33 -0700 (PDT) From: Uros Bizjak To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Uros Bizjak , Dennis Zhou , Tejun Heo , Christoph Lameter , Andy Lutomirski , Ingo Molnar , Nadav Amit , Brian Gerst , Denys Vlasenko , "H . Peter Anvin" , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Borislav Petkov , Luc Van Oostenryck Subject: [RFC PATCH 1/3] percpu: Define __pcpu_typeof() Date: Mon, 5 Aug 2024 20:38:59 +0200 Message-ID: <20240805184012.358023-2-ubizjak@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240805184012.358023-1-ubizjak@gmail.com> References: <20240805184012.358023-1-ubizjak@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 1A5ED180013 X-Stat-Signature: op1g6maq9j44ij78jworrs4hznejct31 X-Rspam-User: X-HE-Tag: 1722883236-605124 X-HE-Meta: U2FsdGVkX1+Uw6oBVFF1ftES8VJOCcRwZB54666oE0K9niX/XTGZki2RlBnCAIE7B66XOmGxSt1d9AKpUHScr6Oz1LzrNNE8FOAZezpb5l9kwfpJGZzr1Em1UYaiOUozrC7VVMiaEesOgu+3TTP/rVgtjiflYK5PAOxe7xYMzkXJH8HdoMuGagPLIiCtvcllPp4gkDj2kZ8myhD4tPwv3sw4aH4LWCgg7Z5B3NSXFOu1ZPWgU2zTVtIadlq9oojwCOXu6+6tAL1AxZ1OlDjZjPjN0QtoqwN9pia+jvVZ1EPxS2IAIdapRYF8hB2hbMT3gUqPFB7z+useioTeWWyo6NgLjxle+HkuBALR3ecZJVfxf8vTUahXRmJ72jnmrPD0MA1MuuxnnQg0Bp3zKvXSBo00K13kZJHX+WxHNMjJ+IEbAFPDr5uIXsp+uv0lYlqIV1RbGgdTGfd/kQNN9XiNgv75nAAJ47u9hzuOevsmutnMm/4PqmVjwvVlR7hhQc6VIAeir322jj+mnbX2SBbQUOdrHr6Jy4/xoJYhRIPP8FPaAEKSdrYUkbHSWunXHRPA5khxOLb1AzdRY0kLvb9DyvBQ1lcFtmcMMzFtOyfqZibdecVY5u9sFj506eGe4YAlXlpa40PuOEks2L1Mwy/JedVmm684kB/AVdyZgko9gcaOCl56HRc5VtJo3+QxH6xzyQZYHgIntYeFCxy7PBGDPG47ZPNLSpYR+gFw2QyHCn1EMRgENlTLKrZ2PTnHXP/FvCQyh7066kbmiKSqOvfL25paidVNcVyDG9plhFyvFa5AKuLC8iqxLjohKcDlP43jMP5bS8f/ERE3kqdQpVe8mjkUOQg+1231mj1iyVnk37Cw3zWQj76qXk48G/SFElEuvuzrYtcnlWtGec+Zx81xN5S2eWiT0zh2ASLzWv4G3NL+cOdYHzOXJCAGutk/Dagw+fYVLBv7ao98Te5TZWM eCaCUnOd gVk46K1McP3IMN1xY3g3loni9dT0IlSqjTOoFww5r7yYY28nk/yPKH8XQzbtdiev6ENwZ65IggKrnAff0cnSfQl8nXjg98RFtR/t2OWpa9K5fXMrfXZyW9sSRIb2CvZkYAeFvpiZR8CW6DGKKHjEVdjNJjOGJvbUk7lUchMP+/I3QnSmsmvnhzG3xXwWD02Bogwh4RFmbuSBDz2+t+6t5cTHBRPtPbS+lljGXI8CZbkizacdNdrzYke8qLX4klhoLFuu9EEHSVP/e+VgWXJyhDMtM/bZ/Ig0XdA0SuEpbIK5hjFnyJU6LMBU8gVqN+YVbWiwyIiowYSGrHUO1ZpdlVgPrwgDMcqT0hfPgVnJYJmojzJi1EyneET0GxQxpvDU+ZOXVksW+scjq2SNUXOan9PrpsrfrEzLiQsf+uhm0gfY8Z2YdLEbPmPDiMRo9nRWieQKyh/gfE3w+fFSxJ9WF/U5FevPJ4uNijzh2nhyd+MX2JXxSftH8r6KBJhvBPsPnAyody79sre1k5BtdHWAKqU1UKntqTU9nd5rHplANz+Yk460GMGUC9Y86ZNWOkjttZ1niMpuPDdZz1s8SsWurtYuNk0UOi7kqKEqD0VcBL6KHWBfCSw2frtkkZmLPER3U0PFAx5H4p3Szl8aSZX87nlbaAjall4+wj3ho+SZXsy9gp++VUJoMXlJhKlDuq1S1v5sF3Jp563gD6Uh0OjjNi8lkP3TpQiT1JX6gFJhnZ+R2cwBESJtwyEMtu6W/ngSShpe8CYy5+2JLdmi1yt5kV75bfgsXrQ94tUJC X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Define __pcpu_typeof() to use __typeof_unqual__() as typeof operator when available, to return unqualified type of the expression. If an arch defines __percpu variables in their own named address space, then __pcpu_typeof() returns unqualified type of the expression without named address space quialifier when CONFIG_CC_HAS_TYPEOF_UNQUAL is defined. Signed-off-by: Uros Bizjak Cc: Dennis Zhou Cc: Tejun Heo Cc: Christoph Lameter Cc: Andy Lutomirski Cc: Ingo Molnar Cc: Nadav Amit Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Borislav Petkov Cc: Luc Van Oostenryck --- arch/x86/include/asm/percpu.h | 38 ++++++++++++++++++++++------------ include/linux/part_stat.h | 2 +- include/linux/percpu-defs.h | 39 ++++++++++++++++++++++++++++------- init/Kconfig | 3 +++ kernel/locking/percpu-rwsem.c | 2 +- 5 files changed, 62 insertions(+), 22 deletions(-) diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index c55a79d5feae..4d31203eb0d2 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h @@ -73,10 +73,14 @@ unsigned long tcp_ptr__ = raw_cpu_read_long(this_cpu_off); \ \ tcp_ptr__ += (__force unsigned long)(_ptr); \ - (typeof(*(_ptr)) __kernel __force *)tcp_ptr__; \ + (__pcpu_typeof(*(_ptr)) __kernel __force *)tcp_ptr__; \ }) #else -#define arch_raw_cpu_ptr(_ptr) ({ BUILD_BUG(); (typeof(_ptr))0; }) +#define arch_raw_cpu_ptr(_ptr) \ +({ \ + BUILD_BUG(); \ + (__pcpu_typeof(*(_ptr)) __kernel __force *)0; \ +}) #endif #define PER_CPU_VAR(var) %__percpu_seg:(var)__percpu_rel @@ -172,7 +176,7 @@ do { \ : [val] __pcpu_reg_##size("=", pfo_val__) \ : [var] "m" (__my_cpu_var(_var))); \ \ - (typeof(_var))(unsigned long) pfo_val__; \ + (__pcpu_typeof(_var))(unsigned long) pfo_val__; \ }) #define __raw_cpu_write(size, qual, _var, _val) \ @@ -180,7 +184,7 @@ do { \ __pcpu_type_##size pto_val__ = __pcpu_cast_##size(_val); \ \ if (0) { \ - typeof(_var) pto_tmp__; \ + __pcpu_typeof(_var) pto_tmp__; \ pto_tmp__ = (_val); \ (void)pto_tmp__; \ } \ @@ -193,7 +197,11 @@ do { \ * The generic per-CPU infrastrucutre is not suitable for * reading const-qualified variables. */ -#define __raw_cpu_read_const(pcp) ({ BUILD_BUG(); (typeof(pcp))0; }) +#define __raw_cpu_read_const(pcp) \ +({ \ + BUILD_BUG(); \ + (__pcpu_typeof(pcp))0; \ +}) #endif /* CONFIG_USE_X86_SEG_SUPPORT */ @@ -205,7 +213,7 @@ do { \ : [val] __pcpu_reg_##size("=", pfo_val__) \ : [var] "i" (&(_var))); \ \ - (typeof(_var))(unsigned long) pfo_val__; \ + (__pcpu_typeof(_var))(unsigned long) pfo_val__; \ }) #define percpu_unary_op(size, qual, op, _var) \ @@ -219,7 +227,7 @@ do { \ __pcpu_type_##size pto_val__ = __pcpu_cast_##size(_val); \ \ if (0) { \ - typeof(_var) pto_tmp__; \ + __pcpu_typeof(_var) pto_tmp__; \ pto_tmp__ = (_val); \ (void)pto_tmp__; \ } \ @@ -239,7 +247,7 @@ do { \ (int)(val) : 0; \ \ if (0) { \ - typeof(var) pao_tmp__; \ + __pcpu_typeof(var) pao_tmp__; \ pao_tmp__ = (val); \ (void)pao_tmp__; \ } \ @@ -263,7 +271,7 @@ do { \ : [tmp] __pcpu_reg_##size("+", paro_tmp__), \ [var] "+m" (__my_cpu_var(_var)) \ : : "memory"); \ - (typeof(_var))(unsigned long) (paro_tmp__ + _val); \ + (__pcpu_typeof(_var))(unsigned long) (paro_tmp__ + _val); \ }) /* @@ -272,7 +280,7 @@ do { \ */ #define raw_percpu_xchg_op(_var, _nval) \ ({ \ - typeof(_var) pxo_old__ = raw_cpu_read(_var); \ + __pcpu_typeof(_var) pxo_old__ = raw_cpu_read(_var); \ \ raw_cpu_write(_var, _nval); \ \ @@ -286,7 +294,7 @@ do { \ */ #define this_percpu_xchg_op(_var, _nval) \ ({ \ - typeof(_var) pxo_old__ = this_cpu_read(_var); \ + __pcpu_typeof(_var) pxo_old__ = this_cpu_read(_var); \ \ do { } while (!this_cpu_try_cmpxchg(_var, &pxo_old__, _nval)); \ \ @@ -309,7 +317,7 @@ do { \ : [nval] __pcpu_reg_##size(, pco_new__) \ : "memory"); \ \ - (typeof(_var))(unsigned long) pco_old__; \ + (__pcpu_typeof(_var))(unsigned long) pco_old__; \ }) #define percpu_try_cmpxchg_op(size, qual, _var, _ovalp, _nval) \ @@ -568,7 +576,11 @@ do { \ #else /* !CONFIG_X86_64: */ /* There is no generic 64-bit read stable operation for 32-bit targets. */ -#define this_cpu_read_stable_8(pcp) ({ BUILD_BUG(); (typeof(pcp))0; }) +#define this_cpu_read_stable_8(pcp) \ +({ \ + BUILD_BUG(); \ + (__pcpu_typeof(pcp))0; \ +}) #define raw_cpu_read_long(pcp) raw_cpu_read_4(pcp) diff --git a/include/linux/part_stat.h b/include/linux/part_stat.h index ac8c44dd8237..3807bc29ba05 100644 --- a/include/linux/part_stat.h +++ b/include/linux/part_stat.h @@ -33,7 +33,7 @@ struct disk_stats { #define part_stat_read(part, field) \ ({ \ - typeof((part)->bd_stats->field) res = 0; \ + __pcpu_typeof((part)->bd_stats->field) res = 0; \ unsigned int _cpu; \ for_each_possible_cpu(_cpu) \ res += per_cpu_ptr((part)->bd_stats, _cpu)->field; \ diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 8efce7414fad..842d10912fdd 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h @@ -220,6 +220,21 @@ do { \ (void)__vpp_verify; \ } while (0) +/* + * Define __percpu_typeof() to use __typeof_unqual__() as typeof + * operator when available, to return unqualified type of the exp. + * + * If an arch defines __percpu variables in their own named address + * space, then __pcpu_typeof() returns unqualified type of the + * expression without named address space qualifier when + * CONFIG_CC_HAS_TYPEOF_UNQUAL is defined. + */ +#ifdef CONFIG_CC_HAS_TYPEOF_UNQUAL +#define __pcpu_typeof(exp) __typeof_unqual__(exp) +#else +#define __pcpu_typeof(exp) __typeof__(exp) +#endif + #ifdef CONFIG_SMP /* @@ -228,7 +243,10 @@ do { \ * pointer value. The weird cast keeps both GCC and sparse happy. */ #define SHIFT_PERCPU_PTR(__p, __offset) \ - RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset)) + uintptr_t ptr__ = (__force uintptr_t)(__p); \ + \ + RELOC_HIDE((__pcpu_typeof(*(__p)) __kernel __force *)(ptr__), \ + (__offset)) #define per_cpu_ptr(ptr, cpu) \ ({ \ @@ -254,13 +272,20 @@ do { \ #else /* CONFIG_SMP */ -#define VERIFY_PERCPU_PTR(__p) \ +#define PERCPU_PTR(__p) \ ({ \ - __verify_pcpu_ptr(__p); \ - (typeof(*(__p)) __kernel __force *)(__p); \ + uintptr_t ptr__ = (__force uintptr_t)(__p); \ + \ + (__pcpu_typeof(*(__p)) __kernel __force *)(ptr__); \ +}) + +#define per_cpu_ptr(ptr, cpu) \ +({ \ + __verify_pcpu_ptr(ptr); \ + (void)(cpu); \ + PERCPU_PTR(ptr); \ }) -#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); VERIFY_PERCPU_PTR(ptr); }) #define raw_cpu_ptr(ptr) per_cpu_ptr(ptr, 0) #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) @@ -315,7 +340,7 @@ static __always_inline void __this_cpu_preempt_check(const char *op) { } #define __pcpu_size_call_return(stem, variable) \ ({ \ - typeof(variable) pscr_ret__; \ + __pcpu_typeof(variable) pscr_ret__; \ __verify_pcpu_ptr(&(variable)); \ switch(sizeof(variable)) { \ case 1: pscr_ret__ = stem##1(variable); break; \ @@ -330,7 +355,7 @@ static __always_inline void __this_cpu_preempt_check(const char *op) { } #define __pcpu_size_call_return2(stem, variable, ...) \ ({ \ - typeof(variable) pscr2_ret__; \ + __pcpu_typeof(variable) pscr2_ret__; \ __verify_pcpu_ptr(&(variable)); \ switch(sizeof(variable)) { \ case 1: pscr2_ret__ = stem##1(variable, __VA_ARGS__); break; \ diff --git a/init/Kconfig b/init/Kconfig index 37260d17267e..a9a04d0683b6 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -873,6 +873,9 @@ config ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH config CC_HAS_INT128 def_bool !$(cc-option,$(m64-flag) -D__SIZEOF_INT128__=0) && 64BIT +config CC_HAS_TYPEOF_UNQUAL + def_bool $(success,echo 'int foo (int a) { __typeof_unqual__(a) b = a; return b; }' | $(CC) -x c - -S -o /dev/null) + config CC_IMPLICIT_FALLTHROUGH string default "-Wimplicit-fallthrough=5" if CC_IS_GCC && $(cc-option,-Wimplicit-fallthrough=5) diff --git a/kernel/locking/percpu-rwsem.c b/kernel/locking/percpu-rwsem.c index 6083883c4fe0..ac9b2f4bcd92 100644 --- a/kernel/locking/percpu-rwsem.c +++ b/kernel/locking/percpu-rwsem.c @@ -184,7 +184,7 @@ EXPORT_SYMBOL_GPL(__percpu_down_read); #define per_cpu_sum(var) \ ({ \ - typeof(var) __sum = 0; \ + __pcpu_typeof(var) __sum = 0; \ int cpu; \ compiletime_assert_atomic_type(__sum); \ for_each_possible_cpu(cpu) \