All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: Martin Wilck <martin.wilck@suse.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>,
	device-mapper development <dm-devel@lists.linux.dev>
Subject: Re: [PATCH v2 19/22] libmultipath: add libcheck_need_wait checker function
Date: Mon, 14 Oct 2024 13:48:14 -0400	[thread overview]
Message-ID: <Zw1ZXkfmU7ggBKol@redhat.com> (raw)
In-Reply-To: <8d27a1e4823d7382a19d1914c0b28b6feb94353e.camel@suse.com>

On Wed, Oct 09, 2024 at 05:49:33PM +0200, Martin Wilck wrote:
> On Tue, 2024-10-08 at 15:33 -0400, Benjamin Marzinski wrote:
> > On Thu, Oct 03, 2024 at 11:15:21PM +0200, Martin Wilck wrote:
> > > On Thu, 2024-09-12 at 17:49 -0400, Benjamin Marzinski wrote:

<snip>

> > > > diff --git a/libmultipath/checkers/directio.c
> > > > b/libmultipath/checkers/directio.c
> > > > index 904e3071..4beed02e 100644
> > > > --- a/libmultipath/checkers/directio.c
> > > > +++ b/libmultipath/checkers/directio.c
> > > > @@ -65,6 +65,7 @@ struct directio_context {
> > > >  	struct aio_group *aio_grp;
> > > >  	struct async_req *req;
> > > >  	struct timespec endtime;
> > > > +	bool waited_for;
> > > >  };
> > > >  
> > > >  static struct aio_group *
> > > > @@ -295,6 +296,7 @@ check_pending(struct directio_context *ct,
> > > > struct
> > > > timespec endtime)
> > > >  	int r;
> > > >  	struct timespec currtime, timeout;
> > > >  
> > > > +	ct->waited_for = true;
> > > 
> > > Not sure if it's important, but strictly speaking, we have only
> > > waited
> > > for the checker if the endtime was in the future, which is often
> > > not
> > > the case. Otherwise we'd just have polled.
> > 
> > But we always set the endtime in the future when we're starting a new
> > request, so the first time the we call check_pending() we don't
> > return
> > till we either get an answer or endtime has passed, which is what we
> > want waited_for to check (that we've give the checker till endtime to
> > respond).
> 
> That holds for this patch. But right in the next patch, the code is
> changed such that libcheck_pending doesn't actually wait at all. So
> "ct->waited_for" is a really confusing name. It just means that we have
> polled for the state once. In theory that can happen very quickly after
> starting the checker.

Oh. Yeah. I can change the of the variable to something like
is_unpolled, and the calling function to checker_is_unpolled(), which
matches what we're actually asking for.

-Ben

> Regards
> Martin


  reply	other threads:[~2024-10-14 17:48 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-12 21:49 [PATCH v2 00/22] Yet Another path checker refactor Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 01/22] libmultipath: store checker_check() result in checker struct Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 02/22] libmultipath: add missing checker function prototypes Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 03/22] libmultipath: split out the code to wait for pending checkers Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 04/22] libmultipath: remove pending wait code from libcheck_check calls Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 05/22] multipath-tools tests: fix up directio tests Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 06/22] libmultipath: split get_state into two functions Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 07/22] libmultipath: change path_offline to path_sysfs_state Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 08/22] multipathd: split check_path_state into two functions Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 09/22] multipathd: split do_checker_path Benjamin Marzinski
2024-10-03 20:23   ` Martin Wilck
2024-10-08 18:18     ` Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 10/22] multipathd: split check_path into two functions Benjamin Marzinski
2024-10-03 20:23   ` Martin Wilck
2024-10-08 18:29     ` Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 11/22] multipathd: split handle_uninitialized_path " Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 12/22] multipathd: split check_paths " Benjamin Marzinski
2024-10-03 20:41   ` Martin Wilck
2024-10-08 19:16     ` Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 13/22] multipathd: fix "fail path" and "reinstate path" commands Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 14/22] multipathd: update priority once after updating all paths Benjamin Marzinski
2024-10-03 21:00   ` Martin Wilck
2024-10-08 19:17     ` Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 15/22] multipathd: simplify checking for followover_should_failback Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 16/22] multipathd: only refresh prios on PATH_UP and PATH_GHOST Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 17/22] multipathd: remove pointless check Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 18/22] multipathd: fix deferred_failback_tick for reload removes Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 19/22] libmultipath: add libcheck_need_wait checker function Benjamin Marzinski
2024-10-03 21:15   ` Martin Wilck
2024-10-08 19:33     ` Benjamin Marzinski
2024-10-09 15:49       ` Martin Wilck
2024-10-14 17:48         ` Benjamin Marzinski [this message]
2024-10-14 21:08           ` Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 20/22] libmultipath: don't wait in libcheck_pending Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 21/22] multipathd: wait for checkers to complete Benjamin Marzinski
2024-09-12 21:49 ` [PATCH v2 22/22] multipath-tools tests: fix up directio tests Benjamin Marzinski
2024-09-13  9:30 ` [PATCH v2 00/22] Yet Another path checker refactor Martin Wilck
2024-09-16 21:11   ` Benjamin Marzinski
2024-09-17 10:13     ` Martin Wilck
2024-10-03 21:23 ` Martin Wilck

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=Zw1ZXkfmU7ggBKol@redhat.com \
    --to=bmarzins@redhat.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=martin.wilck@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.