Rework uevent filtering and merging
cover Rework uevent filtering and merging
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 1/14 multipathd: allow adding git rev as version suffix
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 2/14 multipathd: don't switch to DAEMON_IDLE during startup
In reply to [email protected]--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 3/14 uevent_dispatch(): use while in wait loop
In reply to [email protected]--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 4/14 libmultipath: uevent_dispatch(): process uevents one by one
In reply to [email protected]--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Benjamin Marzinski
maintainerRe: [dm-devel] [PATCH 04/14] libmultipath: uevent_dispatch(): process uevents one by one
Quoted 9 lines · On Thu, Mar 31, 2022 at 12:15:00AM +0200, [email protected] wrote:
The main rationale for delaying uevents is that the uevent dispatcher may have to wait for other threads to release the vecs lock, may the vecs lock for an extended amount of time, and even sleep occasionally. By delaying them, we have the chance to accumulate events for the same path device ("filtering") or WWID ("merging"), thus avoiding duplicate work if we merge these into one.
Quoted 4 lines
A similar effect can be obtained in the uevent dispatcher itself by looking for new uevents after each dispatched event, and trying to merge the newly arrived events with those that remained in the queue.
I'm not sure how I feel about this commit existing on its own. uevent_filter() can leak memory if it deletes a uevent that already has merged uevents. I see that you fixed this in your next patch. The question is, does the reviewing simplification from splitting the patches make up for adding an error in this one. If you want to leave it in as its own commit, you should probably flag that it creates a memory leak that will be fixed in a future patch.
-Ben
Quoted 130 lines
Signed-off-by Martin Wilck <[email protected]>--- libmultipath/list.h | 29 +++++++++++++++++++++++++++++ libmultipath/uevent.c | 37 ++++++++++++++++++++----------------- 2 files changed, 49 insertions(+), 17 deletions(-)libmultipath/list.h +29
-0@@ -246,6 +246,35 @@ static inline void list_splice_tail_init(struct list_head *list,#define list_entry (ptr, type, member) \ container_of(ptr, type, member) + +/** +* list_pop - unlink and return the first list element +* @head: the &struct list_head pointer. +*/ +static inline struct list_head *list_pop (struct list_head *head) +{ +struct list_head *tmp; + +if (list_empty (head)) +return NULL ; + tmp = head->next; +list_del_init (tmp); +return tmp; +} + +/** +* list_pop_entry - unlink and return the entry of the first list element +* @head: the &struct list_head pointer. +* @type: the type of the struct this is embedded in. +* @member: the name of the list_struct within the struct. +*/ +#define list_pop_entry (head, type, member) \ +({ \ + struct list_head *__h = list_pop(head); \ + \ + (__h ? container_of(__h, type, member) : NULL); \ +}) +/** * list_for_each - iterate over a list * @pos: the &struct list_head to use as a loop counter. libmultipath/uevent.c +20
-17@@ -366,6 +366,8 @@ uevent_merge(struct uevent *later, struct list_head *tmpq) later->action, later->kernel, later->wwid);list_move (&earlier->node, &later->merge_node); +list_splice_init (&earlier->merge_node, + &later->merge_node); } } }@@ -386,16 +388,15 @@ merge_uevq(struct list_head *tmpq)static void service_uevq (struct list_head *tmpq) { -struct uevent *uev, *tmp; +struct uevent *uev =list_pop_entry (tmpq,typeof (*uev), node); -list_for_each_entry_safe (uev, tmp, tmpq, node) { -list_del_init (&uev->node); - -pthread_cleanup_push (cleanup_uev, uev); -if (my_uev_trigger &&my_uev_trigger (uev, my_trigger_data)) -condlog (0 ,"uevent trigger error" ); -pthread_cleanup_pop (1 ); - } +if (uev ==NULL ) +return ; +condlog (4 ,"servicing uevent '%s %s'" , uev->action, uev->kernel); +pthread_cleanup_push (cleanup_uev, uev); +if (my_uev_trigger &&my_uev_trigger (uev, my_trigger_data)) +condlog (0 ,"uevent trigger error" ); +pthread_cleanup_pop (1 ); }static void uevent_cleanup (void *arg)@@ -432,33 +433,35 @@ static void cleanup_global_uevq(void *arg __attribute__((unused)))int uevent_dispatch (int (*uev_trigger)(struct uevent *,void * trigger_data),void * trigger_data) { +LIST_HEAD (uevq_work); + my_uev_trigger = uev_trigger; my_trigger_data = trigger_data;mlockall (MCL_CURRENT |MCL_FUTURE ); +pthread_cleanup_push (cleanup_uevq, &uevq_work);while (1 ) { -LIST_HEAD (uevq_tmp);pthread_cleanup_push (cleanup_mutex, uevq_lockp);pthread_mutex_lock (uevq_lockp); - servicing_uev =0 ; -while (list_empty (&uevq)) + servicing_uev = !list_empty (&uevq_work); + +while (list_empty (&uevq_work) &&list_empty (&uevq))pthread_cond_wait (uev_condp, uevq_lockp); servicing_uev =1 ; -list_splice_init (&uevq, &uevq_tmp); +list_splice_tail_init (&uevq, &uevq_work);pthread_cleanup_pop (1 );if (!my_uev_trigger)break ; -pthread_cleanup_push (cleanup_uevq, &uevq_tmp); -merge_uevq (&uevq_tmp); -service_uevq (&uevq_tmp); -pthread_cleanup_pop (1 ); +merge_uevq (&uevq_work); +service_uevq (&uevq_work); } +pthread_cleanup_pop (1 );condlog (3 ,"Terminating uev service queue" );return 0 ; }Signature · 1 line
2.35.1
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 5/14 libmultipath: uevent_dispatch(): only filter/merge new uevents
In reply to [email protected]--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Benjamin Marzinski
maintainerRe: [dm-devel] [PATCH 05/14] libmultipath: uevent_dispatch(): only filter/merge new uevents
Quoted 98 lines · On Thu, Mar 31, 2022 at 12:15:01AM +0200, [email protected] wrote:
When
uevq_workis non-empty and we append a list of new events, we don't need to check the entire list for filterable and mergeable uevents.uevq_workhad been filtered and merged already. So we just need to check the newly appended events. These must of course be checked for merges with earlier events, too.We must deal with some special cases here, like previously merged uevents being filtered later.
Signed-off-by Martin Wilck <[email protected]>--- libmultipath/list.h | 24 ++++++++++++++ libmultipath/uevent.c | 77 +++++++++++++++++++++++++++++++++---------- 2 files changed, 83 insertions(+), 18 deletions(-)libmultipath/list.h +24
-0@@ -363,6 +363,30 @@ static inline struct list_head *list_pop(struct list_head *head) &pos->member != (head); \ pos = n, n = list_entry(n->member.prev, typeof(*n), member)) +/** +* list_for_some_entry - iterate list from the given begin node to the given end node +* @pos: the type * to use as a loop counter. +* @from: the begin node of the iteration. +* @to: the end node of the iteration. +* @member: the name of the list_struct within the struct. +*/ +#define list_for_some_entry (pos, from, to, member) \ + for (pos = list_entry((from)->next, typeof(*pos), member); \ + &pos->member != (to); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) + +/** +* list_for_some_entry_reverse - iterate backwards list from the given begin node to the given end node +* @pos: the type * to use as a loop counter. +* @from: the begin node of the iteration. +* @to: the end node of the iteration. +* @member: the name of the list_struct within the struct. +*/ +#define list_for_some_entry_reverse (pos, from, to, member) \ + for (pos = list_entry((from)->prev, typeof(*pos), member); \ + &pos->member != (to); \ + pos = list_entry(pos->member.prev, typeof(*pos), member)) +/** * list_for_some_entry_safe - iterate list from the given begin node to the given end node safe against removal of list entry * @pos: the type * to use as a loop counter. libmultipath/uevent.c +36
-1@@ -306,17 +306,49 @@ uevent_can_merge(struct uevent *earlier, struct uevent *later)return false; } +static void uevent_delete_from_list (struct uevent *to_delete, +struct uevent **previous, +struct list_head **old_tail) +{ +/* +* "old_tail" is the list_head before the last list element to which +* the caller iterates (the list anchor if the caller iterates over +* the entire list). If this element is removed (which can't happen +* for the anchor), "old_tail" must be moved. It can happen that +* "old_tail" ends up pointing at the anchor. +*/ +if (*old_tail == &to_delete->node) + *old_tail = to_delete->node.prev; + +list_del_init (&to_delete->node); + +/* +* The "to_delete" uevent has been merged with other uevents +* previously. Re-insert them into the list, at the point we're +* currently at. This must be done after the list_del_init() above, +* otherwise previous->next would still point to to_delete. +*/ +if (!list_empty (&to_delete->merge_node)) { +struct uevent *last =list_entry (to_delete->merge_node.prev, +typeof (*last), node); + +list_splice (&to_delete->merge_node, &(*previous)->node); + *previous = last; + } +if (to_delete->udev) +udev_device_unref (to_delete->udev); + +free (to_delete); +} +static void -uevent_prepare (struct list_head *tmpq) +uevent_prepare (struct list_head *tmpq,struct list_head **stop) {
libmultipath/uevent.c uevent_can_merge(struct uevent *earlier, struct uevent *later) · line 351
Quoted 10 lines
libmultipath/uevent.c +2
-5struct uevent *uev, *tmp; -list_for_each_entry_reverse_safe (uev, tmp, tmpq, node) { + list_for_some_entry_reverse_safe(uev, tmp, tmpq, *stop, node) {if (uevent_can_discard (uev)) { -list_del_init (&uev->node); -if (uev->udev) -udev_device_unref (uev->udev); -free (uev); +uevent_delete_from_list (uev, &tmp, stop);
You are only running this on new events, so they can't possibly have any merged uevents, and can't possibly be equal to stop, so the old, simple, deleting code works fine here, and you can just pass stop as a regular pointer, right? Or is this tricker than I understand?
-Ben
Quoted 95 lines
libmultipath/uevent.c +21
-12continue ; }@@ -327,7 +359,7 @@ uevent_prepare(struct list_head *tmpq) }static void -uevent_filter (struct uevent *later,struct list_head *tmpq) +uevent_filter (struct uevent *later,struct list_head *tmpq,struct list_head **stop) {struct uevent *earlier, *tmp;@@ -341,16 +373,13 @@ uevent_filter(struct uevent *later, struct list_head *tmpq) earlier->kernel, earlier->action, later->kernel, later->action); -list_del_init (&earlier->node); -if (earlier->udev) -udev_device_unref (earlier->udev); -free (earlier); +uevent_delete_from_list (earlier, &tmp, stop); } } }static void -uevent_merge (struct uevent *later,struct list_head *tmpq) +uevent_merge (struct uevent *later,struct list_head *tmpq,struct list_head **stop) {struct uevent *earlier, *tmp;@@ -365,6 +394,10 @@ uevent_merge(struct uevent *later, struct list_head *tmpq) earlier->action, earlier->kernel, earlier->wwid, later->action, later->kernel, later->wwid); +/* See comment in uevent_delete_from_list() */ +if (&earlier->node == *stop) + *stop = earlier->node.prev; +list_move (&earlier->node, &later->merge_node);list_splice_init (&earlier->merge_node, &later->merge_node);@@ -373,15 +406,15 @@ uevent_merge(struct uevent *later, struct list_head *tmpq) }static void -merge_uevq (struct list_head *tmpq) +merge_uevq (struct list_head *tmpq,struct list_head *stop) {struct uevent *later; -uevent_prepare (tmpq); -list_for_each_entry_reverse (later, tmpq, node) { -uevent_filter (later, tmpq); +uevent_prepare (tmpq, &stop); + list_for_some_entry_reverse(later, tmpq, stop, node) { +uevent_filter (later, tmpq, &stop);if (uevent_need_merge ()) -uevent_merge (later, tmpq); +uevent_merge (later, tmpq, &stop); } }@@ -442,6 +475,7 @@ int uevent_dispatch(int (*uev_trigger)(struct uevent *, void * trigger_data),pthread_cleanup_push (cleanup_uevq, &uevq_work);while (1 ) { +struct list_head *stop;pthread_cleanup_push (cleanup_mutex, uevq_lockp);pthread_mutex_lock (uevq_lockp);@@ -452,13 +486,20 @@ int uevent_dispatch(int (*uev_trigger)(struct uevent *, void * trigger_data),pthread_cond_wait (uev_condp, uevq_lockp); servicing_uev =1 ; +/* +* "stop" is the list element towards which merge_uevq() +* will iterate: the last element of uevq_work before +* appending new uevents. If uveq_is empty, uevq_work.prev +* equals &uevq_work, which is what we need. +*/ + stop = uevq_work.prev;list_splice_tail_init (&uevq, &uevq_work);pthread_cleanup_pop (1 );if (!my_uev_trigger)break ; -merge_uevq (&uevq_work); +merge_uevq (&uevq_work, stop);service_uevq (&uevq_work); }pthread_cleanup_pop (1 );Signature · 1 line
2.35.1
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 6/14 multipathd: reconfigure: disallow changing uid_attrs
In reply to [email protected]--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Benjamin Marzinski
maintainerRe: [dm-devel] [PATCH 06/14] multipathd: reconfigure: disallow changing uid_attrs
Quoted 60 lines · On Thu, Mar 31, 2022 at 12:15:02AM +0200, [email protected] wrote:
uevent merging by WWID relies on the
uid_attrsconfig option. As we drop struct config between calls touevent_merge(), we must be sure that the WWID is not changed inreconfigure().Signed-off-by Martin Wilck <[email protected]>--- multipath/multipath.conf.5 | 2 ++ multipathd/main.c | 53 +++++++++++++++++++++++++++++++------- 2 files changed, 46 insertions(+), 9 deletions(-)multipath/multipath.conf.5 +2
-0@@ -264,6 +264,8 @@ If this option is configured and matches the device node name of a device, it overrides any other configured methods for determining the WWID for this device. .PP +This option cannot be changed during runtime with the multipathd \fBreconfigure\fR command. +.PP The default is: \fB<unset>\fR. To enable uevent merging, set it e.g. to \(dqsd:ID_SERIAL dasd:ID_UID nvme:ID_WWN\(dq. .REmultipathd/main.c +28
-0@@ -2835,11 +2835,52 @@ void rcu_free_config(struct rcu_head *head)free_config (conf); } +static bool reconfigure_check_uid_attrs (const struct _vector *old_attrs, +const struct _vector *new_attrs) +{ +int i; +char *old; + +if (VECTOR_SIZE (old_attrs) !=VECTOR_SIZE (new_attrs)) +return true; + + vector_foreach_slot(old_attrs, old, i) { +char *new =VECTOR_SLOT (new_attrs, i); + +if (strcmp (old, new)) +return true; + } + +return false; +} + +static void reconfigure_check (struct config *old,struct config *new) +{ +int old_marginal_pathgroups; + + old_marginal_pathgroups = old->marginal_pathgroups; +if ((old_marginal_pathgroups ==MARGINAL_PATHGROUP_FPIN ) != + (new->marginal_pathgroups ==MARGINAL_PATHGROUP_FPIN )) { + condlog(1, "multipathd must be restarted to turn %s fpin marginal paths", + (old_marginal_pathgroups == MARGINAL_PATHGROUP_FPIN)?
multipathd/main.c void rcu_free_config(struct rcu_head *head) · line 2875
Quoted 10 lines
multipathd/main.c +10
-0+ "off" : "on"); + new->marginal_pathgroups = old_marginal_pathgroups; + } + +if (reconfigure_check_uid_attrs (&old->uid_attrs, &new->uid_attrs)) { +struct _vector v = new->uid_attrs; + +condlog (1 ,"multipathd must be restarted to change uid_attrs, keeping old values" ); + new->uid_attrs = old->uid_attrs; +vector_reset (&v);
This leaks the strings that v points to, right? This also can happen in uid_attrs_handler(), I just noticed.
-Ben
Quoted 31 lines
multipathd/main.c +6
-9+ old->uid_attrs = v; + } +} +static int reconfigure (struct vectors *vecs,enum force_reload_types reload_type) {struct config * old, *conf; -int old_marginal_pathgroups; conf =load_config (DEFAULT_CONFIGFILE );if (!conf)@@ -2870,14 +2911,8 @@ reconfigure (struct vectors *vecs, enum force_reload_types reload_type) uxsock_timeout = conf->uxsock_timeout; old =rcu_dereference (multipath_conf); - old_marginal_pathgroups = old->marginal_pathgroups; -if ((old_marginal_pathgroups ==MARGINAL_PATHGROUP_FPIN ) != - (conf->marginal_pathgroups ==MARGINAL_PATHGROUP_FPIN )) { -condlog (1 ,"multipathd must be restarted to turn %s fpin marginal paths" , - (old_marginal_pathgroups ==MARGINAL_PATHGROUP_FPIN )? -"off" :"on" ); - conf->marginal_pathgroups = old_marginal_pathgroups; - } +reconfigure_check (old, conf); + conf->sequence_nr = old->sequence_nr +1 ;rcu_assign_pointer (multipath_conf, conf);call_rcu (&old->rcu, rcu_free_config);Signature · 1 line
2.35.1
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Re: [dm-devel] [PATCH 06/14] multipathd: reconfigure: disallow changing uid_attrs
Quoted 85 lines · Benjamin Marzinski
Quoted 77 lines · On Thu, Mar 31, 2022 at 12:15:02AM +0200, [email protected] wrote:
uevent merging by WWID relies on the
uid_attrsconfig option. As we drop struct config between calls touevent_merge(), we must be sure that the WWID is not changed inreconfigure().Signed-off-by Martin Wilck <[email protected]>---
multipath/multipath.conf.5 | 2 ++
multipathd/main.c | 53 +++++++++++++++++++++++++++++++---
----2 files changed, 46 insertions(+), 9 deletions(-)multipath/multipath.conf.5 +0
-0@@ -264,6 +264,8 @@ If this option is configured and matches thedevice
node name of a device, it overrides any other configured methods for
determining the WWID for this device.
.PP
+This option cannot be changed during runtime with the multipathd \fBreconfigure\fR command.
+.PP
The default is: \fB<unset>\fR. To enable uevent merging, set it e.g. to
\(dqsd:ID_SERIAL dasd:ID_UID nvme:ID_WWN\(dq.
.REmultipathd/main.c +0
-0@@ -2835,11 +2835,52 @@ void rcu_free_config(struct rcu_head *head) free_config(conf); }
+static bool reconfigure_check_uid_attrs(const struct_vector*old_attrs,
+ const struct_vector*new_attrs)multipathd/main.c +18
-0+{ + int i; + char *old; + + if (VECTOR_SIZE(old_attrs) != VECTOR_SIZE(new_attrs)) + return true; + + vector_foreach_slot(old_attrs, old, i) { + char *new = VECTOR_SLOT(new_attrs, i); + + if (strcmp(old, new)) + return true; + } + + return false; +} + +static void reconfigure_check(struct config *old, struct config*new)
multipathd/main.c +6
-0+{ + int old_marginal_pathgroups; + + old_marginal_pathgroups = old->marginal_pathgroups; + if ((old_marginal_pathgroups == MARGINAL_PATHGROUP_FPIN) != + (new->marginal_pathgroups == MARGINAL_PATHGROUP_FPIN)){
+ condlog(1, "multipathd must be restarted to turn %s fpin marginal paths",
+ (old_marginal_pathgroups ==MARGINAL_PATHGROUP_FPIN)?
+ "off" : "on");
+ new->marginal_pathgroups =old_marginal_pathgroups; + }
+
+ if (reconfigure_check_uid_attrs(&old->uid_attrs, &new-Quoted 7 lines
Quoted 1 line
uid_attrs)) {+ struct
_vectorv =new->uid_attrs;
+
+ condlog(1, "multipathd must be restarted to changeuid_attrs, keeping old values");
+ new->uid_attrs =old->uid_attrs;
+ vector_reset(&v);
Quoted 3 lines
This leaks the strings that v points to, right?
This also can happen inuid_attrs_handler(), I just noticed.
I was wondering about the same thing. But vector_reset() calls free() on every slot. So no, I don't think anything is leaked here. The API behaves admittedly in a surprising manner.
Martin
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Re: [dm-devel] [PATCH 06/14] multipathd: reconfigure: disallow changing uid_attrs
Quoted 4 lines · Martin Wilck
I was wondering about the same thing. But
vector_reset()callsfree()on every slot. So no, I don't think anything is leaked here. The API behaves admittedly in a surprising manner.
Sorry, I was confused. Only v->slot is freed. Forget about this.
Martin
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 7/14 libmultipath: microoptimize uevent filtering and merging
In reply to [email protected]--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 8/14 libmultipath: uevent_listen(): don't delay uevents
In reply to [email protected]--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 9/14 libmultipath: uevent: use struct to pass parameters around
In reply to [email protected]--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 10/14 libmultipath: uevent: log statistics about filtering and merging
In reply to [email protected]--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 11/14 libmultipath: merge_uevq(): filter first, then merge
In reply to [email protected]--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 12/14 libmultipath: uevent_filter(): filter previously merged events
In reply to [email protected]--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Re: [dm-devel] [PATCH 12/14] libmultipath: uevent_filter(): filter previously merged events
Quoted 25 lines · On Thu, Mar 31, 2022 at 12:15:08AM +0200, [email protected] wrote:
With the new list-appending logic, it can happen that previously merged events can now be filtered. Do it.
Signed-off-by Martin Wilck <[email protected]>--- libmultipath/uevent.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)libmultipath/uevent.c +1
-1@@ -305,7 +305,7 @@ static void uevent_delete_from_list(struct uevent *to_delete,* for the anchor), "old_tail" must be moved. It can happen that * "old_tail" ends up pointing at the anchor. */ -if (*old_tail == &to_delete->node) +if (old_tail && *old_tail == &to_delete->node) *old_tail = to_delete->node.prev;list_del_init (&to_delete->node);@@ -360,6 +360,20 @@ uevent_filter(struct uevent *later, struct uevent_filter_state *st)* filter unnessary earlier uevents * by the later uevent */
libmultipath/uevent.c uevent_filter(struct uevent *later, struct uevent_filter_state *st) · line 372
Quoted 10 lines
libmultipath/uevent.c +10
-0+if (!list_empty (&earlier->merge_node)) { +struct uevent *mn, *t; + +list_for_each_entry_reverse_safe (mn, t, &earlier->merge_node, node) { +if (uevent_can_filter (mn, later)) { +condlog (4 ,"uevent: \"%s %s\" (merged into \"%s %s\") filtered by \"%s %s\"" , + mn->action, mn->kernel, + earlier->action, earlier->kernel, + later->action, later->kernel); +uevent_delete_from_list (mn, &t,NULL );
Just like with 05/14, you could just use a much simpler delete function here, since moving old_tail and merged nodes is unnecessary. I guess I don't care that much, if you'd rather just have one function, so
Quoted 9 lines
libmultipath/uevent.c +4
-0+ st->filtered++; + } + } + }if (uevent_can_filter (earlier, later)) { condlog(3, "uevent: %s-%s has filtered by uevent: %s-%s", earlier->kernel, earlier->action,Signature · 1 line
2.35.1
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 13/14 libmultipath: uevent: improve log messages
In reply to [email protected]--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 14/14 libmultipath: uevent: add debug messages for event queue
In reply to [email protected]--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
[dm-devel] ZTE / Tang Junhui (Re: [PATCH 00/14] Rework uevent filtering and merging)
In reply to [email protected]Quoted 3 lines · On Thu, 2022-03-31 at 00:14 +0200, [email protected] wrote:
From: Martin Wilck <[email protected]>
Hi Ben, hi Christophe, hi Tang Junhui,
it turns out that Tang Junhui's email address bounces. Adding ZTE people to this email that used to be on the distribution list before.
If anyone can point out someone who might have taken Tang Junhui's responsibilities, please let me know.
Thanks,
Martin
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Quoted 17 lines · On Thu, Mar 31, 2022 at 12:14:56AM +0200, [email protected] wrote:
Hi Ben, hi Christophe, hi Tang Junhui,
the bulk of this patch set (3-8) is a rework of the uevent filtering and merging logic introduced in commit ee8888f ("multipath-tools: improve processing efficiency for addition and deletion of multipath devices"), by Tang Junhui.
The rationale is explained in detail in the commit message in patch 08/14. TL;DR: The previous approach delayed uevent handling, possibly a lot, which is often undesirable. The new logic passes events to the dispatcher immediately, but if they queue up (because the dispatcher can't keep up with the rate at which events arrive, or is blocked e.g. by the path checker), the dispatcher will apply filtering and merging between servicing individual events. This worked well in my own testing, but I'd appreciate if ZTE could give it a shot in their special test environment.
Quoted 6 lines
Patch 9-14 add some more improvements to the uevent handling code, and improve logging. The first 2 patches are unrelated fixes.
Comments welcome,
Martin
For everything except 04, 05, and 06
BTW, for some reason, these emails didn't come through a plain test for me.
Quoted 17 lines
Martin Wilck (14):
multipathd: allow adding git rev as version suffix
multipathd: don't switch toDAEMON_IDLEduring startupuevent_dispatch(): use while in wait loop
libmultipath:uevent_dispatch(): process uevents one by one
libmultipath:uevent_dispatch(): only filter/merge new uevents
multipathd: reconfigure: disallow changinguid_attrs
libmultipath: microoptimize uevent filtering and merging
libmultipath:uevent_listen(): don't delay uevents
libmultipath: uevent: use struct to pass parameters around
libmultipath: uevent: log statistics about filtering and merging
libmultipath:merge_uevq(): filter first, then merge
libmultipath:uevent_filter(): filter previously merged events
libmultipath: uevent: improve log messages
libmultipath: uevent: add debug messages for event queue
Quoted 15 lines
Makefile.inc | 3 +- libmultipath/config.c | 6 +- libmultipath/config.h | 4 +- libmultipath/discovery.c | 2 +- libmultipath/list.h | 53 +++++ libmultipath/structs.h | 2 +- libmultipath/uevent.c | 407 ++++++++++++++++++++++--------------- libmultipath/uevent.h | 3 +- multipath/multipath.conf.5 | 2 + multipathd/main.c | 59 ++++-- tests/uevent.c | 2 +- 11 files changed, 354 insertions(+), 189 deletions(-)Signature · 1 line
2.35.1
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel