Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp5039624rwb; Wed, 17 Aug 2022 10:00:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR68ywzisurkuCL71egP8N42m4E8xYeQ6rL77FDUKKrk2g+JBFTp17FVeIWB2UlN7UjOLv+3 X-Received: by 2002:a17:902:c408:b0:16d:c48d:978e with SMTP id k8-20020a170902c40800b0016dc48d978emr27451409plk.70.1660755622389; Wed, 17 Aug 2022 10:00:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660755622; cv=none; d=google.com; s=arc-20160816; b=ZRoasgfGkG3BvJU/e80jSji4l4iMyr0J/ZeJdBZbIAWbyfTYuzpmG3skQ0Bj65aGkz pkFDJDP02k34pWOavmu9J0fhcUIu+b8B3DmeO9brDIzpnp+uwn4lJusCV68OfIF+/bQ/ zTjBhP8s9FCAzt143aRTBa+bOjj9QhI07jxUjCpsJX1hoio0Ofygp+FMgEMoGcgG0LW6 /PZdzLRQMhme7u3KENOR5AAs9liAJxcKvNCvdUSsIDVkgfBvgbmhw0Ks6ij5bznrhIxj iBgNx+O00EpQzzQIoNeJcsdboGT7g6zApohoA8tVdnlIDntaqKCnKUOjhJW2Sz0f42fv vpBw== 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:dkim-signature :dkim-signature:from; bh=uD14oDgx3FWYy2lpa5ke4a7FAfpDJmqbWQP4XZyslYQ=; b=mnWGBBF+hd9gAbhAVT/ILpKmgXAfztuX4Hhg0P5Typinw9v7hu696Az7u6vPYu3t5/ Jz5OhdYFulccYRextjL5ANDyxT+MEREQQbeYMkCVLxAFH0xln7lexHWpvfwh9E+Ce3tO ciWGxk0yssQHnVdZLtHDA9W8xAXqejOKsnTUCSVWEhteMY+JNS5E0SFagRoxbwnzqHPP fx+eXyYoma2XvRb3BUmn+vOvmXxKtfmyF4e+KS2QyS2Iz6Liy/2oFHo29XoKQPPOaxVT TdclO1UXjye8/yH3X+o2NkPCYGC9Q9Iu9IqdmOvHKIwXyyY4IdJUsWq8fVSIIW9Bfuyt v39A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=pwMEWV1O; dkim=neutral (no key) header.i=@linutronix.de; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t12-20020a170902e84c00b0016d9566ab31si243324plg.439.2022.08.17.10.00.10; Wed, 17 Aug 2022 10:00:22 -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=@linutronix.de header.s=2020 header.b=pwMEWV1O; dkim=neutral (no key) header.i=@linutronix.de; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241099AbiHQQ17 (ORCPT + 99 others); Wed, 17 Aug 2022 12:27:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241000AbiHQQ1k (ORCPT ); Wed, 17 Aug 2022 12:27:40 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 908DAA0329 for ; Wed, 17 Aug 2022 09:27:38 -0700 (PDT) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1660753657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uD14oDgx3FWYy2lpa5ke4a7FAfpDJmqbWQP4XZyslYQ=; b=pwMEWV1ORtsBhWwUa8v7DjvJNCSvXYXfvaI1nzWmFzO34axX2YU1OwIEv00HeOxx9EskLh n+X76iezbyBUafup4Bs87iFbG7f4r2MULKgdyTvJq2kbNQ2tZDpIyJqLJ72ZwmkNQT59QD 5y2qy0qOmjLmW1nRTLrHlwYrnBUfe4IV0pdjgIh1shupwHaZTqPkgTXGR/Q7SveBeNCjlt qXEqH/eXj2NqFfKLq/rYcI9lCgqib3CTeGepPoQMDcTGRJ5ZVlpVKAGEhBZYoOs69OQ61e RIcQp/kgnY+LkE3zxJWz14klf9oOPJMCpCQ7jJ1k271/8RS1qLUBQnKfblyOrw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1660753657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uD14oDgx3FWYy2lpa5ke4a7FAfpDJmqbWQP4XZyslYQ=; b=w/DxSHF39+Tt6W/BvI0ZfDJidVshXYBpD/T6BXvbSwmFZMmR2HP2P4v1x02SJAGzL+riKK Df1TwmEPcoJlPPBA== To: linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Peter Zijlstra , Steven Rostedt , Linus Torvalds , Matthew Wilcox , Andrew Morton , linux-mm@kvack.org, Sebastian Andrzej Siewior Subject: [PATCH 4/9] mm/vmstat: Use preempt_[dis|en]able_nested() Date: Wed, 17 Aug 2022 18:26:58 +0200 Message-Id: <20220817162703.728679-5-bigeasy@linutronix.de> In-Reply-To: <20220817162703.728679-1-bigeasy@linutronix.de> References: <20220817162703.728679-1-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Gleixner Replace the open coded CONFIG_PREEMPT_RT conditional preempt_enable/disable() pairs with the new helper functions which hide the underlying implementation details. Signed-off-by: Thomas Gleixner Cc: Andrew Morton Cc: linux-mm@kvack.org Signed-off-by: Sebastian Andrzej Siewior --- mm/vmstat.c | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/mm/vmstat.c b/mm/vmstat.c index 373d2730fcf21..d514fe7f90af0 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -355,8 +355,7 @@ void __mod_zone_page_state(struct zone *zone, enum zone= _stat_item item, * CPU migrations and preemption potentially corrupts a counter so * disable preemption. */ - if (IS_ENABLED(CONFIG_PREEMPT_RT)) - preempt_disable(); + preempt_disable_nested(); =20 x =3D delta + __this_cpu_read(*p); =20 @@ -368,8 +367,7 @@ void __mod_zone_page_state(struct zone *zone, enum zone= _stat_item item, } __this_cpu_write(*p, x); =20 - if (IS_ENABLED(CONFIG_PREEMPT_RT)) - preempt_enable(); + preempt_enable_nested(); } EXPORT_SYMBOL(__mod_zone_page_state); =20 @@ -393,8 +391,7 @@ void __mod_node_page_state(struct pglist_data *pgdat, e= num node_stat_item item, } =20 /* See __mod_node_page_state */ - if (IS_ENABLED(CONFIG_PREEMPT_RT)) - preempt_disable(); + preempt_disable_nested(); =20 x =3D delta + __this_cpu_read(*p); =20 @@ -406,8 +403,7 @@ void __mod_node_page_state(struct pglist_data *pgdat, e= num node_stat_item item, } __this_cpu_write(*p, x); =20 - if (IS_ENABLED(CONFIG_PREEMPT_RT)) - preempt_enable(); + preempt_enable_nested(); } EXPORT_SYMBOL(__mod_node_page_state); =20 @@ -441,8 +437,7 @@ void __inc_zone_state(struct zone *zone, enum zone_stat= _item item) s8 v, t; =20 /* See __mod_node_page_state */ - if (IS_ENABLED(CONFIG_PREEMPT_RT)) - preempt_disable(); + preempt_disable_nested(); =20 v =3D __this_cpu_inc_return(*p); t =3D __this_cpu_read(pcp->stat_threshold); @@ -453,8 +448,7 @@ void __inc_zone_state(struct zone *zone, enum zone_stat= _item item) __this_cpu_write(*p, -overstep); } =20 - if (IS_ENABLED(CONFIG_PREEMPT_RT)) - preempt_enable(); + preempt_enable_nested(); } =20 void __inc_node_state(struct pglist_data *pgdat, enum node_stat_item item) @@ -466,8 +460,7 @@ void __inc_node_state(struct pglist_data *pgdat, enum n= ode_stat_item item) VM_WARN_ON_ONCE(vmstat_item_in_bytes(item)); =20 /* See __mod_node_page_state */ - if (IS_ENABLED(CONFIG_PREEMPT_RT)) - preempt_disable(); + preempt_disable_nested(); =20 v =3D __this_cpu_inc_return(*p); t =3D __this_cpu_read(pcp->stat_threshold); @@ -478,8 +471,7 @@ void __inc_node_state(struct pglist_data *pgdat, enum n= ode_stat_item item) __this_cpu_write(*p, -overstep); } =20 - if (IS_ENABLED(CONFIG_PREEMPT_RT)) - preempt_enable(); + preempt_enable_nested(); } =20 void __inc_zone_page_state(struct page *page, enum zone_stat_item item) @@ -501,8 +493,7 @@ void __dec_zone_state(struct zone *zone, enum zone_stat= _item item) s8 v, t; =20 /* See __mod_node_page_state */ - if (IS_ENABLED(CONFIG_PREEMPT_RT)) - preempt_disable(); + preempt_disable_nested(); =20 v =3D __this_cpu_dec_return(*p); t =3D __this_cpu_read(pcp->stat_threshold); @@ -513,8 +504,7 @@ void __dec_zone_state(struct zone *zone, enum zone_stat= _item item) __this_cpu_write(*p, overstep); } =20 - if (IS_ENABLED(CONFIG_PREEMPT_RT)) - preempt_enable(); + preempt_enable_nested(); } =20 void __dec_node_state(struct pglist_data *pgdat, enum node_stat_item item) @@ -526,8 +516,7 @@ void __dec_node_state(struct pglist_data *pgdat, enum n= ode_stat_item item) VM_WARN_ON_ONCE(vmstat_item_in_bytes(item)); =20 /* See __mod_node_page_state */ - if (IS_ENABLED(CONFIG_PREEMPT_RT)) - preempt_disable(); + preempt_disable_nested(); =20 v =3D __this_cpu_dec_return(*p); t =3D __this_cpu_read(pcp->stat_threshold); @@ -538,8 +527,7 @@ void __dec_node_state(struct pglist_data *pgdat, enum n= ode_stat_item item) __this_cpu_write(*p, overstep); } =20 - if (IS_ENABLED(CONFIG_PREEMPT_RT)) - preempt_enable(); + preempt_enable_nested(); } =20 void __dec_zone_page_state(struct page *page, enum zone_stat_item item) --=20 2.37.2