linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Mel Gorman <mgorman@techsingularity.net>
Cc: Vlastimil Babka <vbabka@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@kernel.org>, Hugh Dickins <hughd@google.com>,
	Linux-MM <linux-mm@kvack.org>,
	Linux-RT-Users <linux-rt-users@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH 2/2] mm/vmstat: Protect per cpu variables with preempt disable on RT
Date: Thu, 05 Aug 2021 17:42:40 +0200	[thread overview]
Message-ID: <87wnoz6gpb.ffs@tglx> (raw)
In-Reply-To: <20210805140458.GF6464@techsingularity.net>

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.:
>> >> 
>> >> <sched_expert> 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 <tglx@linutronix.de>


  reply	other threads:[~2021-08-05 15:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 10:00 [PATCH 0/2] Protect vmstats on PREEMPT_RT Mel Gorman
2021-07-23 10:00 ` [PATCH 1/2] preempt: Provide preempt_*_(no)rt variants Mel Gorman
2021-07-23 10:00 ` [PATCH 2/2] mm/vmstat: Protect per cpu variables with preempt disable on RT Mel Gorman
2021-08-03 23:54   ` Thomas Gleixner
2021-08-04  9:54     ` Mel Gorman
2021-08-04 13:42       ` Vlastimil Babka
2021-08-04 14:23         ` Mel Gorman
2021-08-05 12:56           ` Thomas Gleixner
2021-08-05 14:04             ` Mel Gorman
2021-08-05 15:42               ` Thomas Gleixner [this message]
2021-08-05 18:47               ` Daniel Vacek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wnoz6gpb.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mgorman@techsingularity.net \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).