All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: Martin Wilck <mwilck@suse.com>
Cc: lixiaokeng@huawei.com, dm-devel@redhat.com,
	Chongyun Wu <wu.chongyun@h3c.com>
Subject: Re: [dm-devel] [PATCH v2 30/48] multipathd: uxlsnr: add idle notification
Date: Mon, 29 Nov 2021 10:26:27 -0600	[thread overview]
Message-ID: <20211129162627.GB19591@octiron.msp.redhat.com> (raw)
In-Reply-To: <84682701a0d34ffadc3356a843f8803e458cd8d2.camel@suse.com>

On Fri, Nov 26, 2021 at 03:23:18PM +0100, Martin Wilck wrote:
> On Wed, 2021-11-24 at 19:08 -0600, Benjamin Marzinski wrote:
> > On Thu, Nov 18, 2021 at 11:58:22PM +0100, mwilck@suse.com wrote:
> > > From: Martin Wilck <mwilck@suse.com>
> > > 
> > > The previous patches added the state machine and the timeout
> > > handling,
> > > but there was no wakeup mechanism for the uxlsnr for cases where
> > > client connections were waiting for the vecs lock.
> > > 
> > > This patch uses the previously introduced wakeup mechanism of
> > > struct mutex_lock for this purpose. Processes which unlock the
> > > "global" vecs lock send an event in an eventfd which the uxlsnr
> > > loop is polling for.
> > > 
> > > As we are now woken up for servicing client handlers that don't
> > > wait for input but for the lock, we need to set up the pollfds
> > > differently, and iterate over all clients when handling events,
> > > not only over the ones that are receiving. The hangup handling
> > > is changed, too. We have to look at every client, even if one has
> > > hung up. Note that I don't take client_lock for the loop in
> > > uxsock_listen(), it's not necessary and will be removed elsewhere
> > > in a follow-up patch.
> > > 
> > > With this in place, the lock need not be taken in execute_handler()
> > > any more. The uxlsnr only ever calls trylock() on the vecs lock,
> > > avoiding any waiting for other threads to finish.
> > > 
> > > Signed-off-by: Martin Wilck <mwilck@suse.com>
> > > ---
> > >  multipathd/uxlsnr.c | 200 ++++++++++++++++++++++++++++------------
> > > ----
> > >  1 file changed, 129 insertions(+), 71 deletions(-)
> > > 
> > > diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c
> > > index 87134d5..bf9780d 100644
> > > --- a/multipathd/uxlsnr.c
> > > +++ b/multipathd/uxlsnr.c
> > 
> > Nitpick: This would look clearer to me if, instead of a switch
> > statement, it was just
> > 
> > if (c->state != CLT_RECV)
> >         continue;
> > 
> > polls[i].events = POLLIN;
> > polls[i].fd = c->fd;
> > ...
> 
> That's true if you look at this patch in isolation. The reason I use a
> switch statement is that with patch 32, we get another case to treat
> here (CLT_SEND). At that point, the switch is at least on par wrt
> clarity, IMO.
> 
> No?

Yep. I retrack my objection

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>

> 
> Martin

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  reply	other threads:[~2021-11-30  6:12 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18 22:57 [dm-devel] [PATCH v2 00/47] multipathd: uxlsnr overhaul mwilck
2021-11-18 22:57 ` [dm-devel] [PATCH v2 01/48] libmultipath: add timespeccmp() utility function mwilck
2021-11-18 22:57 ` [dm-devel] [PATCH v2 02/48] libmultipath: add trylock() helper mwilck
2021-11-18 22:57 ` [dm-devel] [PATCH v2 03/48] libmultipath: add optional wakeup functionality to lock.c mwilck
2021-11-24 20:41   ` Benjamin Marzinski
2021-11-24 21:20     ` Martin Wilck
2021-11-29 19:27       ` Benjamin Marzinski
2021-11-29 20:52         ` Martin Wilck
2021-11-30 16:52           ` Benjamin Marzinski
2021-11-30 20:28             ` Martin Wilck
2021-12-01 12:06               ` Martin Wilck
2021-12-14 23:25                 ` Benjamin Marzinski
2021-12-15  7:33                   ` Martin Wilck
2021-12-15 21:01                     ` Martin Wilck
2021-12-16 15:34                       ` Benjamin Marzinski
2021-11-18 22:57 ` [dm-devel] [PATCH v2 04/48] libmultipath: print: add __snprint_config() mwilck
2021-11-18 22:57 ` [dm-devel] [PATCH v2 05/48] libmultipath: improve cleanup of uevent queues on exit mwilck
2021-11-18 22:57 ` [dm-devel] [PATCH v2 06/48] multipathd: fix systemd notification when stopping while reloading mwilck
2021-11-18 22:57 ` [dm-devel] [PATCH v2 07/48] multipathd: improve delayed reconfigure mwilck
2021-11-24 21:18   ` Benjamin Marzinski
2021-11-18 22:58 ` [dm-devel] [PATCH v2 08/48] multipathd: cli.h: formatting improvements mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 09/48] multipathd: cli_del_map: fix reply for delayed action mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 10/48] multipathd: add prototype for cli_handler functions mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 11/48] multipathd: make all cli_handlers static mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 12/48] multipathd: add and set cli_handlers in a single step mwilck
2021-11-24 21:41   ` Benjamin Marzinski
2021-11-18 22:58 ` [dm-devel] [PATCH v2 13/48] multipathd: cli.c: use ESRCH for "command not found" mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 14/48] multipathd: uxlsnr: avoid stalled clients during reconfigure mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 15/48] multipathd: uxlsnr: handle client HUP mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 16/48] multipathd: uxlsnr: use symbolic values for pollfd indices mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 17/48] multipathd: uxlsnr: avoid using fd -1 in ppoll() mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 18/48] multipathd: uxlsnr: data structure for stateful client connection mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 19/48] multipathd: move uxsock_trigger() to uxlsnr.c mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 20/48] multipathd: move parse_cmd() " mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 21/48] multipathd: uxlsnr: remove check_timeout() mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 22/48] multipathd: uxlsnr: move client handling to separate function mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 23/48] multipathd: uxlsnr: use main poll loop for receiving mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 24/48] multipathd: use strbuf in cli_handler functions mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 25/48] multipathd: uxlsnr: check root on connection startup mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 26/48] multipathd: uxlsnr: pass struct client to uxsock_trigger() and parse_cmd() mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 27/48] multipathd: uxlsnr: move handler execution to separate function mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 28/48] multipathd: uxlsnr: use parser to determine non-root commands mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 29/48] multipathd: uxlsnr: merge uxsock_trigger() into state machine mwilck
2021-11-24 23:48   ` Benjamin Marzinski
2021-11-25  0:38   ` Benjamin Marzinski
2021-11-26 14:34     ` Martin Wilck
2021-11-29 16:19       ` Benjamin Marzinski
2021-11-29 17:00         ` Martin Wilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 30/48] multipathd: uxlsnr: add idle notification mwilck
2021-11-25  1:08   ` Benjamin Marzinski
2021-11-26 14:23     ` Martin Wilck
2021-11-29 16:26       ` Benjamin Marzinski [this message]
2021-11-18 22:58 ` [dm-devel] [PATCH v2 31/48] multipathd: uxlsnr: add timeout handling mwilck
2021-11-25  1:23   ` Benjamin Marzinski
2021-11-18 22:58 ` [dm-devel] [PATCH v2 32/48] multipathd: uxlsnr: use poll loop for sending, too mwilck
2021-11-25  1:43   ` Benjamin Marzinski
2021-11-26 14:06     ` Martin Wilck
2021-11-29 19:01     ` Martin Wilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 33/48] multipathd: uxlsnr: drop client_lock mwilck
2021-11-25  1:45   ` Benjamin Marzinski
2021-11-18 22:58 ` [dm-devel] [PATCH v2 34/48] multipathd: uxclt: allow client mode for non-root, too mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 35/48] multipathd: uxlsnr: use recv() for command length mwilck
2021-11-25  1:54   ` Benjamin Marzinski
2021-11-18 22:58 ` [dm-devel] [PATCH v2 36/48] multipathd: move delayed_reconfig out of struct config mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 37/48] multipathd: remove reconfigure from header file mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 38/48] multipathd: pass in the type of reconfigure mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 39/48] multipathd: add "reconfigure all" command mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 40/48] multipathd: remove missing paths on startup mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 41/48] libmultipath: skip unneeded steps to get path name mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 42/48] libmultipath: don't use fallback wwid in update_pathvec_from_dm mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 43/48] libmultipath: always set INIT_REMOVED in set_path_removed mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 44/48] multipathd: fully initialize paths added by update_pathvec_from_dm mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 45/48] multipathd: retrigger uevent for partial paths mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 46/48] multipathd: remove INIT_PARTIAL paths that aren't in a multipath device mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 47/48] multipathd: Remove dependency on systemd-udev-settle.service mwilck
2021-11-18 22:58 ` [dm-devel] [PATCH v2 48/48] libmultipath: add path wildcard "%I" for init state mwilck

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=20211129162627.GB19591@octiron.msp.redhat.com \
    --to=bmarzins@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=lixiaokeng@huawei.com \
    --cc=mwilck@suse.com \
    --cc=wu.chongyun@h3c.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.