Skip to content

Commit 920d076

Browse files
committed
Remove page-collection-locs
2 parents 6cc7e1d + cfaa5be commit 920d076

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

qemu/accel/tcg/translate-all.c

+8-14
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ static inline void page_unlock_tb(struct uc_struct *uc, const TranslationBlock *
522522
}
523523
}
524524

525+
#if 0
525526
static inline struct page_entry *
526527
page_entry_new(PageDesc *pd, tb_page_addr_t index)
527528
{
@@ -542,7 +543,6 @@ static void page_entry_destroy(gpointer p)
542543
g_free(pe);
543544
}
544545

545-
#if 0
546546
/* returns false on success */
547547
static bool page_entry_trylock(struct page_entry *pe)
548548
{
@@ -582,7 +582,6 @@ static gboolean page_entry_unlock(gpointer key, gpointer value, gpointer data)
582582
}
583583
return FALSE;
584584
}
585-
#endif
586585

587586
/*
588587
* Trylock a page, and if successful, add the page to a collection.
@@ -613,20 +612,14 @@ static bool page_trylock_add(struct uc_struct *uc, struct page_collection *set,
613612
*/
614613
if (set->max == NULL || pe->index > set->max->index) {
615614
set->max = pe;
616-
#if 0
617615
do_page_entry_lock(pe);
618-
#endif
619616
return false;
620617
}
621618
/*
622619
* Try to acquire out-of-order lock; if busy, return busy so that we acquire
623620
* locks in order.
624621
*/
625-
#if 0
626622
return page_entry_trylock(pe);
627-
#else
628-
return 0;
629-
#endif
630623
}
631624

632625
static gint tb_page_addr_cmp(gconstpointer ap, gconstpointer bp, gpointer udata)
@@ -641,6 +634,7 @@ static gint tb_page_addr_cmp(gconstpointer ap, gconstpointer bp, gpointer udata)
641634
}
642635
return 1;
643636
}
637+
#endif
644638

645639
/*
646640
* Lock a range of pages ([@start,@end[) as well as the pages of all
@@ -650,6 +644,7 @@ static gint tb_page_addr_cmp(gconstpointer ap, gconstpointer bp, gpointer udata)
650644
struct page_collection *
651645
page_collection_lock(struct uc_struct *uc, tb_page_addr_t start, tb_page_addr_t end)
652646
{
647+
#if 0
653648
struct page_collection *set = g_malloc(sizeof(*set));
654649
tb_page_addr_t index;
655650
PageDesc *pd;
@@ -664,9 +659,7 @@ page_collection_lock(struct uc_struct *uc, tb_page_addr_t start, tb_page_addr_t
664659
assert_no_pages_locked();
665660

666661
retry:
667-
#if 0
668662
g_tree_foreach(set->tree, page_entry_lock, NULL);
669-
#endif
670663

671664
for (index = start; index <= end; index++) {
672665
TranslationBlock *tb;
@@ -677,9 +670,7 @@ page_collection_lock(struct uc_struct *uc, tb_page_addr_t start, tb_page_addr_t
677670
continue;
678671
}
679672
if (page_trylock_add(uc, set, index << TARGET_PAGE_BITS)) {
680-
#if 0
681673
g_tree_foreach(set->tree, page_entry_unlock, NULL);
682-
#endif
683674
goto retry;
684675
}
685676
assert_page_locked(pd);
@@ -688,21 +679,24 @@ page_collection_lock(struct uc_struct *uc, tb_page_addr_t start, tb_page_addr_t
688679
(tb->page_addr[1] != -1 &&
689680
page_trylock_add(uc, set, tb->page_addr[1]))) {
690681
/* drop all locks, and reacquire in order */
691-
#if 0
692682
g_tree_foreach(set->tree, page_entry_unlock, NULL);
693-
#endif
694683
goto retry;
695684
}
696685
}
697686
}
698687
return set;
688+
#else
689+
return NULL;
690+
#endif
699691
}
700692

701693
void page_collection_unlock(struct page_collection *set)
702694
{
695+
#if 0
703696
/* entries are unlocked and freed via page_entry_destroy */
704697
g_tree_destroy(set->tree);
705698
g_free(set);
699+
#endif
706700
}
707701

708702
static void page_lock_pair(struct uc_struct *uc, PageDesc **ret_p1, tb_page_addr_t phys1,

0 commit comments

Comments
 (0)