All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Benjamin Marzinski" <bmarzins@redhat.com>
To: Hannes Reinecke <hare@suse.de>
Cc: tang.junhui@zte.com.cn, zhang.kai16@zte.com.cn,
	dm-devel@redhat.com, Bart Van Assche <bart.vanassche@sandisk.com>,
	Martin Wilck <mwilck@suse.com>
Subject: Re: Improve processing efficiency for addition and deletion of multipath devices
Date: Mon, 28 Nov 2016 10:07:08 -0600	[thread overview]
Message-ID: <20161128160708.GC1972@octiron.msp.redhat.com> (raw)
In-Reply-To: <9c955a41-83e0-12b4-72f6-8de797e93aed@suse.de>

On Mon, Nov 28, 2016 at 11:05:29AM +0100, Hannes Reinecke wrote:
> Hi Junhui,
> 
> On 11/28/2016 03:19 AM, tang.junhui@zte.com.cn wrote:
> > Hello Christophe, Ben, Hannes, Martin, Bart,
> > I am a member of host-side software development team of ZXUSP storage
> > project in ZTE Corporation. Facing the market demand, our team decides to write
> > code to promote multipath efficiency next month. The whole idea is in the mail
> > below. We hope to participate in and make progress with the open source community,
> > so any suggestion and comment would be welcome.
> > 
> Thank you for looking into it.
> This is one area which definitely needs improvement, so your
> contribution would be most welcome.
> 
> > 
> > ------------------------------------------------------------------------------------------------------------------------------
> > 
> > ------------------------------------------------------------------------------------------------------------------------------
> > 
> > 1.        Problem
> > In these scenarios, multipath processing efficiency is low:
> > 1) Many paths exist in each multipath device,
> > 2) Devices addition or deletion during iSCSI login/logout or FC link
> > up/down.
> > 
> > 2.        Reasons
> > Multipath process uevents one by one, and each one also produce a new dm
> > addition change or deletionuevent to increased system resource consumption,
> > actually most of these uevents have no sense at all.
> > 
> [ .. ]
> > In list_merger_uevents(&uevq_tmp), each node is traversed from the
> > latest to the oldest,
> > and the older node with the same WWID and uevent type(e.g. add) would be
> > moved to
> > the merger_node list of the later node. If a deletion uevent node
> > occurred, other older
> > uevent nodes about this device would be filtered(Thanks to Martin’s idea).
> > 
> > After above processing, attention must be paid to that the parameter
> > “struct uevent * uev” is not a single uevent any more in and after
> > uev_trigger(), code
> > need to be modified to process batch uevents in uev_add_path() and so on.
> > 
> To handle this properly you need to modify uev_add_path(); basically you
> need to treat 'uev_add_path()' and 'ev_add_path()' as two _distinct_
> events, where the former processes uevents and add the path to an
> internal list (->pathvec would be ideally suited here).
> 'ev_add_path()' then would need to be called once all uevents are
> processed, and would be processing all elements in ->pathvec, creating
> the resulting multipath map in one go.
> 
> Actually not a bad idea.
> 
> Tricky bit would be to figure out _when_ to stop uevent processing and
> calling 'ev_add_path'.
> I guess we'd need to make 'ev_add_path' running in a separate thread;
> that way we'd be putting pressure off the uevent processing thread and
> the whole thing should be running far smoother.

I still think that we don't need to force a wait here.
uevent_dispatch() already pulls off all the queued events in a batch. We
could just merge over the batch that we are given.  This has the nice
property that when uevents aren't coming in a storm, we quickly process
the next event, and when they are, the further multipathd gets behind, the
larger the list it will merge over.
 
> And looking at it closer, when you move 'ev_add_path' into a separate
> thread, and separating out 'uev_add_path' you _already_ have your event
> merging implemented.

Like I mentioned before, I'm not sure what a seperate thread will buy us
here, since we can't create multipath devices while paths might be
getting deleted. I do think your earlier point that we don't need any
locking until the paths are added to the pathvec is important.  Instead
of going a path at a time, getting the path's information and then
adding it to the pathvec, we could get the information on all the
outstanding paths and then add them all at once, and then call the
map creation code (basically the work that ev_add_path does) on all the
paths.

> With much less effort then trying to merge things at the uevent level.

Yes. I'd much rather deal with the uevents as they acutally are, and
have uev_add_path (possibly now called uev_add_paths) do the work.

> I'd be willing to look into it; please keep me informed about any
> progress here.
> 
> Cheers,
> 
> Hannes
> -- 
> Dr. Hannes Reinecke		   Teamlead Storage & Networking
> hare@suse.de			               +49 911 74053 688
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
> HRB 21284 (AG Nürnberg)

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

  reply	other threads:[~2016-11-28 16:07 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-28  2:19 Improve processing efficiency for addition and deletion of multipath devices tang.junhui
2016-11-28 10:05 ` Hannes Reinecke
2016-11-28 16:07   ` Benjamin Marzinski [this message]
2016-11-28 16:26     ` Zdenek Kabelac
2016-11-28 10:06 ` Zdenek Kabelac
2016-11-28 10:42   ` Hannes Reinecke
2016-11-28 11:51     ` Zdenek Kabelac
2016-11-28 12:06       ` Peter Rajnoha
2016-11-28 12:08       ` Hannes Reinecke
2016-11-28 12:23         ` Peter Rajnoha
2016-11-28 12:55         ` Zdenek Kabelac
2016-11-28 17:22         ` Benjamin Marzinski
2016-11-29  9:34           ` Zdenek Kabelac
2016-11-28 10:28 ` Martin Wilck
2016-11-28 17:31   ` Benjamin Marzinski
2016-11-29  7:52     ` Martin Wilck
2016-11-29 19:21       ` Benjamin Marzinski
2016-11-28 15:25 ` Benjamin Marzinski
2016-11-28 15:37   ` Hannes Reinecke
2016-12-01  1:16     ` tang.junhui
  -- strict thread matches above, loose matches on Subject: below --
2016-11-16  1:46 tang.junhui
2016-11-16  7:53 ` Hannes Reinecke
2016-11-16  8:45   ` tang.junhui
2016-11-16  9:49     ` Martin Wilck
2016-11-17  1:41       ` tang.junhui
2016-11-17 10:48         ` Martin Wilck
2016-11-18  1:02           ` tang.junhui
2016-11-18  7:39             ` Martin Wilck
2016-11-18  8:24               ` tang.junhui
2016-11-18  8:30                 ` Martin Wilck
2016-11-18  8:56                   ` tang.junhui
2016-11-18  9:12                   ` tang.junhui
2016-11-21 18:19                   ` Benjamin Marzinski
2016-11-18 22:26           ` Benjamin Marzinski
2016-11-23  1:08             ` tang.junhui
2016-11-29  9:07               ` Zdenek Kabelac
2016-11-29 10:13                 ` tang.junhui
2016-11-24  9:21             ` Martin Wilck
2016-11-28 18:46               ` Benjamin Marzinski
2016-11-29  6:47                 ` Hannes Reinecke
2016-11-29  8:02                   ` Martin Wilck
2016-11-29  8:10                     ` Zdenek Kabelac
2016-11-29  8:16                       ` Martin Wilck
2016-11-29  8:24                         ` Zdenek Kabelac
2016-11-29 17:25                     ` Benjamin Marzinski
2016-11-29  7:57                 ` Martin Wilck
2016-11-29 17:41                   ` Benjamin Marzinski

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=20161128160708.GC1972@octiron.msp.redhat.com \
    --to=bmarzins@redhat.com \
    --cc=bart.vanassche@sandisk.com \
    --cc=dm-devel@redhat.com \
    --cc=hare@suse.de \
    --cc=mwilck@suse.com \
    --cc=tang.junhui@zte.com.cn \
    --cc=zhang.kai16@zte.com.cn \
    /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.