[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKv+Gu_RC6mRqZXfm7Zyhn6KTh-svAZP0bNKa+xQdMa8LOf7PQ@mail.gmail.com>
Date: Wed, 28 Nov 2018 17:45:04 +0100
From: Ard Biesheuvel <ard.biesheuvel@...aro.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Will Deacon <will.deacon@....com>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Catalin Marinas <catalin.marinas@....com>, rml@...h9.net,
Thomas Gleixner <tglx@...utronix.de>,
Martin Schwidefsky <schwidefsky@...ibm.com>
Subject: Re: [PATCH 2/2] arm64: preempt: Provide our own implementation of asm/preempt.h
On Wed, 28 Nov 2018 at 17:41, Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Wed, Nov 28, 2018 at 04:35:42PM +0100, Ard Biesheuvel wrote:
> > On Tue, 27 Nov 2018 at 20:44, Will Deacon <will.deacon@....com> wrote:
> > >
> > > The asm-generic/preempt.h implementation doesn't make use of the
> > > PREEMPT_NEED_RESCHED flag, since this can interact badly with load/store
> > > architectures which rely on the preempt_count word being unchanged across
> > > an interrupt.
> > >
> > > However, since we're a 64-bit architecture and the preempt count is
> > > only 32 bits wide, we can simply pack it next to the resched flag and
> > > load the whole thing in one go, so that a dec-and-test operation doesn't
> > > need to load twice.
> > >
> >
> > Since the actual preempt count is a lot narrower than 32 bits, x86
> > just uses bit 31.
> >
> > So what is the reason for using two different words?
>
> See commit:
>
> ba1f14fbe709 ("sched: Remove PREEMPT_NEED_RESCHED from generic code")
Yup, that clears it up - thanks.
Powered by blists - more mailing lists