cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 02/13] GFS2: Make do_xmote determine its own gh parameter
Date: Tue, 20 Nov 2018 15:46:46 +0000	[thread overview]
Message-ID: <6dade9d8-c4cd-b25c-d034-5a0e2bd9ac8d@redhat.com> (raw)
In-Reply-To: <1852142760.35114536.1542661582312.JavaMail.zimbra@redhat.com>

Hi,


On 19/11/18 21:06, Bob Peterson wrote:
> Hi Steve,
>
> ----- Original Message -----
>>
>> On 19/11/18 13:29, Bob Peterson wrote:
>>> This is another baby step toward a better glock state machine.
>>> Before this patch, do_xmote was called with a gh parameter, but
>>> only for promotes, not demotes. This patch allows do_xmote to
>>> determine the gh autonomously.
>>>
>>> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
> (snip)
>
>> Since gh is apparently only used to get the lock flags, it would make
>> more sense just to pass the lock flags rather than add in an additional
>> find_first_waiter() call,
>>
>> Steve.
> Perhaps I didn't put enough info into the comments for this patch.
>
> I need to get rid of the gh parameter in order to make the glock
> state machine fully autonomous. In other words, function do_xmote will
> become a state in the (stand alone) state machine, which itself does not
> require a gh parameter and may be called from several places under
> several conditions. The state of the glock will determine that it needs
> to call do_xmote, but do_xmote needs to figure it out on its own.
A function can't become a state in this sense. The state in this case is 
the content of struct gfs2_glock, and the
functions define how you get from one state to another,

>
> Before this patch, the caller does indeed know the gh pointer, but in
> the future, it will replaced by a generic call to the state machine
> which will not know it.
>
> Regards,
>
> Bob Peterson

That is not relevant to the point I was making though. The point is that 
if the flags are passed to do_xmote rather than the gh, then that 
resolves the issue of needing to pass the gh and reduces the amount of 
code, since you can pass 0 flags instead of NULL gh,

Steve.



  reply	other threads:[~2018-11-20 15:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19 13:29 [Cluster-devel] [PATCH 00/13] Radical Reform of glock state machine (take 2) Bob Peterson
2018-11-19 13:29 ` [Cluster-devel] [PATCH 01/13] GFS2: Remove gotos from function run_queue Bob Peterson
2018-11-19 13:29 ` [Cluster-devel] [PATCH 02/13] GFS2: Make do_xmote determine its own gh parameter Bob Peterson
2018-11-19 14:00   ` Steven Whitehouse
2018-11-19 21:06     ` Bob Peterson
2018-11-20 15:46       ` Steven Whitehouse [this message]
2018-11-19 13:29 ` [Cluster-devel] [PATCH 03/13] GFS2: Eliminate a goto in finish_xmote Bob Peterson
2018-11-19 13:49   ` Steven Whitehouse
2018-11-19 21:26     ` Bob Peterson
2018-11-20 15:52       ` Steven Whitehouse
2018-11-19 13:29 ` [Cluster-devel] [PATCH 04/13] GFS2: Baby step toward a real state machine: finish_xmote Bob Peterson
2018-11-19 13:29 ` [Cluster-devel] [PATCH 05/13] GFS2: Add do_xmote states to state machine Bob Peterson
2018-11-19 13:29 ` [Cluster-devel] [PATCH 06/13] GFS2: Make do_xmote not call the state machine again Bob Peterson
2018-11-19 13:29 ` [Cluster-devel] [PATCH 07/13] GFS2: Add blocking and non-blocking demote to state machine Bob Peterson
2018-11-19 13:29 ` [Cluster-devel] [PATCH 08/13] GFS2: Add a new GL_ST_PROMOTE state to glock " Bob Peterson
2018-11-19 13:29 ` [Cluster-devel] [PATCH 09/13] GFS2: Replace run_queue with new GL_ST_RUN state in " Bob Peterson
2018-11-19 13:29 ` [Cluster-devel] [PATCH 10/13] GFS2: Reduce redundancy in GL_ST_DEMOTE_NONBLOCK state Bob Peterson
2018-11-19 13:29 ` [Cluster-devel] [PATCH 11/13] GFS2: Reduce glock_work_func to a single call to state_machine Bob Peterson
2018-11-19 13:29 ` [Cluster-devel] [PATCH 12/13] GFS2: Add new GL_ST_UNLOCK state to reduce calls to the __ version Bob Peterson
2018-11-19 13:29 ` [Cluster-devel] [PATCH 13/13] GFS2: Optimization of GL_ST_UNLOCK state Bob Peterson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6dade9d8-c4cd-b25c-d034-5a0e2bd9ac8d@redhat.com \
    --to=swhiteho@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).