[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fcdd9ebd-05b9-30b1-877a-db84aaa96770@redhat.com>
Date: Tue, 15 May 2018 14:35:33 -0400
From: Waiman Long <longman@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
Davidlohr Bueso <dave@...olabs.net>,
"Theodore Y. Ts'o" <tytso@....edu>,
Oleg Nesterov <oleg@...hat.com>,
Amir Goldstein <amir73il@...il.com>, Jan Kara <jack@...e.cz>,
Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH v3 2/2] locking/percpu-rwsem: Annotate rwsem ownership
transfer by setting RWSEM_OWNER_UNKNOWN
On 05/15/2018 02:05 PM, Peter Zijlstra wrote:
> On Tue, May 15, 2018 at 02:02:00PM -0400, Waiman Long wrote:
>> On 05/15/2018 01:58 PM, Peter Zijlstra wrote:
>>> On Tue, May 15, 2018 at 01:38:04PM -0400, Waiman Long wrote:
>>>> +/*
>>>> + * Owner value to indicate the rwsem's owner is not currently known.
>>>> + */
>>>> +#define RWSEM_OWNER_UNKNOWN ((struct task_struct *)-1)
>>> It might be nice to comment that this works and relies on having that
>>> ANON_OWNER bit set.
>> I am just trying not to expose internal working of rwsem, but I can
>> document that one of the bits is the real deal without specifying which one.
> Thing is, you don't want someone changing this without knowing about
> that one magic bit. It doesn't hurt to be explicit here.
>
> Also, do we want -1L instead of a -1 literal?
>
Yes, I should -1L instead.
Cheers,
Longman
Powered by blists - more mailing lists