lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87h7g4123u.ffs@tglx>
Date:   Thu, 05 Aug 2021 14:56:53 +0200
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Mel Gorman <mgorman@...hsingularity.net>,
        Vlastimil Babka <vbabka@...e.cz>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Ingo Molnar <mingo@...nel.org>,
        Hugh Dickins <hughd@...gle.com>, Linux-MM <linux-mm@...ck.org>,
        Linux-RT-Users <linux-rt-users@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 2/2] mm/vmstat: Protect per cpu variables with preempt
 disable on RT

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.

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ