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]
Date:   Tue, 30 Jul 2019 13:23:13 +0530
From:   Mukesh Ojha <mojha@...eaurora.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     mingo@...hat.com, will@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] locking/mutex: Use mutex flags macro instead of hard
 code value


On 7/29/2019 4:37 PM, Peter Zijlstra wrote:
> On Mon, Jul 29, 2019 at 04:22:58PM +0530, Mukesh Ojha wrote:
>> Let's use the mutex flag macro(which got moved from mutex.c
>> to linux/mutex.h in the last patch) instead of hard code
>> value which was used in __mutex_owner().
>>
>> Signed-off-by: Mukesh Ojha <mojha@...eaurora.org>
>> ---
>>   include/linux/mutex.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/linux/mutex.h b/include/linux/mutex.h
>> index 79b28be..c3833ba 100644
>> --- a/include/linux/mutex.h
>> +++ b/include/linux/mutex.h
>> @@ -87,7 +87,7 @@ struct mutex {
>>    */
>>   static inline struct task_struct *__mutex_owner(struct mutex *lock)
>>   {
>> -	return (struct task_struct *)(atomic_long_read(&lock->owner) & ~0x07);
>> +	return (struct task_struct *)(atomic_long_read(&lock->owner) & ~MUTEX_FLAGS);
>>   }
> I would _much_ rather move __mutex_owner() out of line, you're exposing
> far too much stuff.

if i understand you correctly, you want me to move __mutex_owner() to 
mutex.c
__mutex_owner() is used in mutex_is_locked() and mutex_trylock_recursive 
inside linux/mutex.h.

Shall i move them as well ?

Thanks,
Mukesh


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ