Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp669544pxt; Thu, 5 Aug 2021 08:49:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtG2b6oGAFqaJBXnll0pAccYW0Tk0s3iC3Q+yf1AuqU2jBT/z2q6HB8mxRUEr6hOK/Z2Nx X-Received: by 2002:a05:6e02:e02:: with SMTP id a2mr88126ilk.127.1628178559369; Thu, 05 Aug 2021 08:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628178559; cv=none; d=google.com; s=arc-20160816; b=fY+Vi/rC3+/PbxIR9gkcjidP91N96lvfOiQsuPRpIMfkNxhBvQsE3ZujftFV/AvKTH ZenguzEEanUA+B1tOAtxIypZAaCPAra2kbBz/1QGDemIMtzHfw9fTlFKXI4zBP1oC/DR JP6UFy/e/mn1wSPlGSuz2Z4ZtmDtX4I55TH+gUq/5w3xTHwrc0CrZzbASupLH8/fTkV+ VpW6G6RufGyO7VEJgh1Xnrw3nAUR9GsTv+4CAIL1/DLBskq1fgw2+0Fp3SlaUALm9uM0 6VVadmYzwZa9ARTRJoFnx9n/7Pp+EG57GmwAS7anKkBJucqsiUCn7rnKjwF7OQG/35UT 0T2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=Glq/GSaXnqPNnPMpJu4AoXBlC3J+ZdP4PETLNLpbhAo=; b=OdO6JIJ/GWSqqpQDrmZIyMql4jbOwXAN1cAb6THmmSGou2SzY3pfQuXX/IViko3UMw PNFHAvAdKjojpK92xRjzVG2QGonFwBwxABScG+BLo8MyXywwJpgcMz/77ULtRD9dhc19 +jKBVIUgjJnh1FIsR6bd8YDM7yodXW7Is64n2kSGEHEpUT3oWrsI9RQRPoVr510f1p/B 0nc4A0KX3p52TZNMrxXcybr+fqQf1H5vzUMMnWiMWc16jVAs4mSnWzGwJL1mzs+2NkaI whfzULEQdBCedhi2r5Vh8dfpts2+3KhFCfTuZ9RurfnSz7eioAWAVsmEPM7g8su0ORcT mCyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=0TW4AJBp; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l4si457467iol.18.2021.08.05.08.49.07; Thu, 05 Aug 2021 08:49:19 -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=@linutronix.de header.s=2020 header.b=0TW4AJBp; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242191AbhHEPq3 (ORCPT + 99 others); Thu, 5 Aug 2021 11:46:29 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:44312 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242436AbhHEPmz (ORCPT ); Thu, 5 Aug 2021 11:42:55 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1628178160; h=from:from:reply-to:subject:subject: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=Glq/GSaXnqPNnPMpJu4AoXBlC3J+ZdP4PETLNLpbhAo=; b=0TW4AJBpWvjvaJCgxNDRKCp4/fxGG3Cx13Iajcf4wxt4m8hWpVTpaDQiU7gjvakWc+qN7A /0xRL+kPd3JiJcVS+BrBZVeFwuYqE31nETIgclCBzeUYDCmgEHNBKwy6urmDhMV8Z6Q+wg A+H9BmC0jt2uHnAEccba2S+jeeIciC998MhGNGeChI4Tji2uQ8v066R9BNstxzuTfWu9lr Wizg/cVC28HzuFSzBw40DndOgWOuO2wKDcheqiY3nstm68d1yx3dOY3rJGw25FfIRu0sny mtA+UDa2+xtxqx1lqoeqt5/hh/yp+wAWOp0KeKZsvwENQY2TxN6mLt9WP4Tp+A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1628178160; h=from:from:reply-to:subject:subject: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=Glq/GSaXnqPNnPMpJu4AoXBlC3J+ZdP4PETLNLpbhAo=; b=TSzs3w/3Mu3fojDbNwE6ct33nt6LZ6vvsW2m7QDN0GUAQmkh97leuoOX/2wZlBjXtqsLwS OhhRtShxfVYRvPDg== To: Mel Gorman Cc: Vlastimil Babka , Andrew Morton , Ingo Molnar , Hugh Dickins , Linux-MM , Linux-RT-Users , LKML , Peter Zijlstra Subject: Re: [PATCH 2/2] mm/vmstat: Protect per cpu variables with preempt disable on RT In-Reply-To: <20210805140458.GF6464@techsingularity.net> References: <20210723100034.13353-1-mgorman@techsingularity.net> <20210723100034.13353-3-mgorman@techsingularity.net> <87czqu2iew.ffs@tglx> <20210804095425.GA6464@techsingularity.net> <91b2f893-eb6a-d91d-3769-baba8601b0f6@suse.cz> <20210804142306.GE6464@techsingularity.net> <87h7g4123u.ffs@tglx> <20210805140458.GF6464@techsingularity.net> Date: Thu, 05 Aug 2021 17:42:40 +0200 Message-ID: <87wnoz6gpb.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 05 2021 at 15:04, Mel Gorman wrote: > On Thu, Aug 05, 2021 at 02:56:53PM +0200, Thomas Gleixner wrote: >> On Wed, Aug 04 2021 at 15:23, Mel Gorman wrote: >> Mel, >> >> > On Wed, Aug 04, 2021 at 03:42:25PM +0200, Vlastimil Babka wrote: >> >> The idea was not build-time, but runtime (hidden behind lockdep, VM_DEBUG or >> >> whatnot), i.e.: >> >> >> >> what that code needs is switch(item) { case foo1: case foo2: >> >> lockdep_assert_irqs_disabled(); break; case bar1: case bar2: >> >> lockdep_assert_preempt_disabled(); lockdep_assert_no_in_irq(); break; } or >> >> something along those lines >> >> >> > Ok, that would potentially work. It may not even need to split the stats >> > into different enums. Simply document which stats need protection from >> > IRQ or preemption and use PROVE_LOCKING to check if preemption or IRQs >> > are disabled depending on the kernel config. I don't think it gets rid >> > of preempt_disable_rt unless the API was completely reworked with entry >> > points that describe the locking requirements. That would be tricky >> > because the requirements differ between kernel configurations. >> >> Right. This won't get rid of the preempt disabling on RT, but I think we >> should rather open code this >> >> if (IS_ENABLED(CONFIG_PREEMPT_RT)) >> preempt_dis/enable(); >> >> instead of proliferating these helper macros which have only one user left. >> > > Ok, that is reasonable. I tried creating a vmstat-specific helper but the > names were misleading so I ended up with the patch below which open-codes > it as you suggest. The comment is not accurate because "locking/local_lock: > Add RT support" is not upstream but it'll eventually be accurate. > > Is this ok? Looks good. Acked-by: Thomas Gleixner