radix tree test suite: Convert tag_tagged_items to XArray

The tag_tagged_items() function is supposed to test the page-writeback
tagging code.  Since that has been converted to the XArray, there's
not much point in testing the radix tree's tagging code.  This requires
using the pthread mutex embedded in the xarray instead of an external
lock, so remove the pthread mutexes which protect xarrays/radix trees.
Also remove radix_tree_iter_tag_set() as this was the last user.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
This commit is contained in:
Matthew Wilcox
2018-08-18 07:09:22 -04:00
parent adb9d9c4cc
commit 372266ba02
10 changed files with 46 additions and 71 deletions

View File

@@ -44,7 +44,6 @@
#include "regression.h"
static RADIX_TREE(mt_tree, GFP_KERNEL);
static pthread_mutex_t mt_lock = PTHREAD_MUTEX_INITIALIZER;
struct page {
pthread_mutex_t lock;
@@ -126,29 +125,29 @@ static void *regression1_fn(void *arg)
struct page *p;
p = page_alloc(0);
pthread_mutex_lock(&mt_lock);
xa_lock(&mt_tree);
radix_tree_insert(&mt_tree, 0, p);
pthread_mutex_unlock(&mt_lock);
xa_unlock(&mt_tree);
p = page_alloc(1);
pthread_mutex_lock(&mt_lock);
xa_lock(&mt_tree);
radix_tree_insert(&mt_tree, 1, p);
pthread_mutex_unlock(&mt_lock);
xa_unlock(&mt_tree);
pthread_mutex_lock(&mt_lock);
xa_lock(&mt_tree);
p = radix_tree_delete(&mt_tree, 1);
pthread_mutex_lock(&p->lock);
p->count--;
pthread_mutex_unlock(&p->lock);
pthread_mutex_unlock(&mt_lock);
xa_unlock(&mt_tree);
page_free(p);
pthread_mutex_lock(&mt_lock);
xa_lock(&mt_tree);
p = radix_tree_delete(&mt_tree, 0);
pthread_mutex_lock(&p->lock);
p->count--;
pthread_mutex_unlock(&p->lock);
pthread_mutex_unlock(&mt_lock);
xa_unlock(&mt_tree);
page_free(p);
}
} else {