On (02/12/19 15:29), John Ogness wrote:
> +static bool __prb_trylock(struct prb_cpulock *cpu_lock,
> + unsigned int *cpu_store)
> +{
> + unsigned long *flags;
> + unsigned int cpu;
> +
> + cpu = get_cpu();
> +
> + *cpu_store = atomic_read(_lock->owner);
> +
On 2019-02-15, Petr Mladek wrote:
>>> void prb_lock(struct prb_cpulock *cpu_lock)
>>> {
>>> unsigned int flags;
>>> int cpu;
>>
>> I added an explicit preempt_disable here:
>>
>> cpu = get_cpu();
>
> It is superfluous. Preemption is not possible when interrupts
> are disabled.
On Thu 2019-02-14 13:10:28, John Ogness wrote:
> On 2019-02-14, Petr Mladek wrote:
> >>> cpu_store looks like an implementation detail. The caller
> >>> needs to remember it to handle the nesting properly.
> >>>
> >>> We could achieve the same with a recursion counter hidden
> >>> in struct
On 2019-02-14, Petr Mladek wrote:
>>> cpu_store looks like an implementation detail. The caller
>>> needs to remember it to handle the nesting properly.
>>>
>>> We could achieve the same with a recursion counter hidden
>>> in struct prb_lock.
>
> The atomic operations are tricky. I feel other
On Wed 2019-02-13 22:39:20, John Ogness wrote:
> On 2019-02-13, Petr Mladek wrote:
> >> +/*
> >> + * prb_unlock: Perform a processor-reentrant spin unlock.
> >> + * @cpu_lock: A pointer to the lock object.
> >> + * @cpu_store: A "flags" object storing lock status information.
> >> + *
> >> + *
On 2019-02-13, Petr Mladek wrote:
>> Add processor-reentrant spin locking functions. These allow
>> restricting the number of possible contexts to 2, which can simplify
>> implementing code that also supports NMI interruptions.
>>
>> prb_lock();
>>
>> /*
>> * This code is
On Tue 2019-02-12 15:29:40, John Ogness wrote:
> Add processor-reentrant spin locking functions. These allow
> restricting the number of possible contexts to 2, which can simplify
> implementing code that also supports NMI interruptions.
>
> prb_lock();
>
> /*
> * This code is
Add processor-reentrant spin locking functions. These allow
restricting the number of possible contexts to 2, which can simplify
implementing code that also supports NMI interruptions.
prb_lock();
/*
* This code is synchronized with all contexts
* except an NMI on the same
8 matches
Mail list logo