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: <871q0emji1.fsf@oracle.com>
Date: Thu, 17 Oct 2024 15:50:46 -0700
From: Ankur Arora <ankur.a.arora@...cle.com>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: Ankur Arora <ankur.a.arora@...cle.com>,
        "Paul E. McKenney"
 <paulmck@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>, linux-kernel@...r.kernel.org,
        tglx@...utronix.de, mingo@...nel.org, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
        vschneid@...hat.com, frederic@...nel.org, efault@....de
Subject: Re: [PATCH 2/7] rcu: limit PREEMPT_RCU configurations


Sebastian Andrzej Siewior <bigeasy@...utronix.de> writes:

> On 2024-10-15 15:13:46 [-0700], Ankur Arora wrote:
>> Sebastian Andrzej Siewior <bigeasy@...utronix.de> writes:
>>
>> >>
>> >> As for PREEMPT_LAZY, you seem to be suggesting a more intrusive change
>> >> than just keeping non-preemptible RCU when the Kconfig options are
>> >> consistent with this being expected.  If this is the case, what are the
>> >> benefits of this more-intrusive change?
>> >
>> > As far as I understand you are only concerned about PREEMPT_LAZY and
>> > everything else (PREEMPT_LAZY + PREEMPT_DYNAMIC or PREEMPT_DYNAMIC
>> > without PREEMPT_LAZY) is fine.
>> > In the PREEMPT_LAZY + !PREEMPT_DYNAMIC the suggested change
>> >
>> > | config PREEMPT_RCU
>> > | 	bool
>> > | 	default y if (PREEMPT || PREEMPT_RT || PREEMPT_DYNAMIC)
>> > | 	select TREE_RCU
>> > | 	help
>> >
>> > would disable PREEMPT_RCU while the default model is PREEMPT. You argue
>>
>> With PREEMPT_LAZY=y, PREEMPT_DYNAMIC=n, isn't the default model
>> PREEMPT_LAZY, which has PREEMPTION=y, but PREEMPT=n?
>
> Correct.
>
>> > that only people on small embedded would do such a thing and they would
>> > like to safe additional memory.
>> >
>> > I don't think this is always the case because the "preemptible" users
>> > would also get this and this is an unexpected change for them.
>>
>> Can you clarify this? The intent with lazy is to be preemptible but
>> preempt less often. In that it is meant to be quite different from
>> CONFIG_PREEMPT.
>
> A wake up with PREEMPT may not always lead to a preemption but will lead
> to preemption once the time slice is up. With LAZY this changes to the
> point that a preemption point will be delayed to the sched tick. Tasks
> which are not based on the fail class (SCHED_DL, FIFO, …) will receive a
> wake up right away.

>> > I don't think this is always the case because the "preemptible" users
>> > would also get this and this is an unexpected change for them.

Yes. My point was that "preemptible" is a mechanism.

The policy about how often preemption happens is determined by the
chosen model PREEMPT_NONE/PREEMPT_VOLUNTARY/PREEMPT_LAZY/PREEMPT/
PREEMPT_RT.

> If in the long term NONE and VOL goes away you could argue that everyone
> using LAZY + !DYNAMIC is one of those.

> If additionally PREEMPT goes away then you can not.

Sure. But, that's just begging the question.

We want _NONE and _VOLUNTARY to go away because keeping cond_resched()
around incurs a cost.

> Therefore I would prefer to have the RCU model to be
> selectable rather than forced. While !PREEMPT_RCU may save memory, it
> also disable preemption for the read section.

When a user chooses one of PREEMPT_NONE/_VOLUNTARY/_LAZY, the implication
is that on the throughput -- latency axis, they care about optimizing
for throughput.

PREEMPT_RCU=n is clearly oriented towards that.

That said, I'm agnostic about making the RCU model selectable. Paul
is the best judge of that.

--
ankur

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ