[PATCH] migration: savevm_state_insert_handler: constant-time element insertion

2019-10-16 Thread Scott Cheloha
ction, savevm_state_remove_handler(), which abstracts the logic for replacing the head of an element's subqueue when removing it. Signed-off-by: Scott Cheloha --- migration/savevm.c | 35 ++- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/migration/savevm.c b

Re: [PATCH] migration: savevm_state_insert_handler: constant-time element insertion

2019-10-17 Thread Scott Cheloha
On Thu, Oct 17, 2019 at 10:43:08AM +0200, Juan Quintela wrote: > Scott Cheloha wrote: > > > Registering a SaveStateEntry object via savevm_state_insert_handler() > > is an O(n) operation because the list is a priority queue maintained by > > walking the list from head to

[PATCH v2 0/2] migration: faster savevm_state_handler_insert()

2019-10-17 Thread Scott Cheloha
anges since v1: * Split patch 1 into 2 patches. Scott Cheloha (2): migration: add savevm_state_handler_remove() migration: savevm_state_handler_insert: constant-time element insertion migration/savevm.c | 35 ++- 1 file changed, 30 insertions(+), 5 dele

[PATCH v2 1/2] migration: add savevm_state_handler_remove()

2019-10-17 Thread Scott Cheloha
Create a function to abstract common logic needed when removing a SaveStateEntry element from the savevm_state.handlers queue. For now we just remove the element. Soon it will involve additional cleanup. Signed-off-by: Scott Cheloha --- migration/savevm.c | 9 +++-- 1 file changed, 7

[PATCH v2 2/2] migration: savevm_state_handler_insert: constant-time element insertion

2019-10-17 Thread Scott Cheloha
a ppc64 VM with maxmem=8T has 4 such objects to insert. Signed-off-by: Scott Cheloha --- migration/savevm.c | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index b2e3b7222a..f7a2d36bba 100644 --- a/mig

Re: [PATCH v2 2/2] migration: savevm_state_handler_insert: constant-time element insertion

2019-11-20 Thread Scott Cheloha
/10/2019 10:16, Dr. David Alan Gilbert wrote: > > > > > * Scott Cheloha (chel...@linux.vnet.ibm.com) wrote: > > > > >> savevm_state's SaveStateEntry TAILQ is a priority queue. Priority > > > > >> sorting is maintained by searching from head