From: Hannes Reinecke <hare@suse.de>
To: Mike Christie <michaelc@cs.wisc.edu>
Cc: device-mapper development <dm-devel@redhat.com>,
christophe.varoqui@gmail.com
Subject: Re: [multipath tools] pgp->priority average calculation
Date: Wed, 09 Jan 2013 08:35:44 +0100 [thread overview]
Message-ID: <50ED1DD0.9090900@suse.de> (raw)
In-Reply-To: <50ECA2F3.7070501@cs.wisc.edu>
On 01/08/2013 11:51 PM, Mike Christie wrote:
> Hey Ben and Hannes and Christophe,
>
> Happy multipath-tools patch submission day :)
>
> I had a question on the pgp->priority average calculation and its
> display to the user.
>
>
> Ben, you added the patch
>
> commit cd21bd290a57eed350d564bac403da9d6941a144
> Author: Benjamin Marzinski <bmarzins@redhat.com>
> Date: Wed Nov 10 12:52:20 2010 -0600
>
> multipath: sort all pathgroups by priority
>
>
> which did
>
> @@ -25,14 +25,17 @@ path_group_prio_update (struct pathgroup * pgp)
> pgp->enabled_paths++;
> }
> }
> - pgp->priority = priority;
> + if (pgp->enabled_paths)
> + pgp->priority = priority / pgp->enabled_paths;
> + else
> +
>
> and
>
> @@ -387,9 +386,7 @@ snprint_pg_pri (char * buff, size_t len, struct
> pathgroup *
> * Printing is another reason to update.
> */
> path_group_prio_update(pgp);
> - if (pgp->enabled_paths)
> - avg_priority = pgp->priority / pgp->enabled_paths;
> - return snprint_int(buff, len, avg_priority);
> +
>
>
> but then Hannes later added the patch:
>
>
> commit 750db1f0dc08bf1d96ce64d32786dfe07b8ae3f9
> Author: Hannes Reinecke <hare@suse.de>
> Date: Wed Mar 17 08:32:51 2010 +0100
>
> Display avg priority as group priority
>
>
> which added it back in the print code:
>
>
> - return snprint_int(buff, len, pgp->priority);
> + if (pgp->enabled_paths)
> + avg_priority = pgp->priority / pgp->enabled_paths;
> + return snprint_int(buff, len, avg_priority);
>
>
> So when we print the prio, it ends up getting divided by the number of
> enabled paths twice.
>
>
> Was Hannes's patch a mistake? Should it be reverted?
>
Yeah, that seems to be an error.
Please revert.
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
prev parent reply other threads:[~2013-01-09 7:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-08 22:51 [multipath tools] pgp->priority average calculation Mike Christie
2013-01-09 7:35 ` Hannes Reinecke [this message]
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=50ED1DD0.9090900@suse.de \
--to=hare@suse.de \
--cc=christophe.varoqui@gmail.com \
--cc=dm-devel@redhat.com \
--cc=michaelc@cs.wisc.edu \
/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