Skip to content

Commit

Permalink
Merge tag 'mm-hotfixes-stable-2022-12-22-14-34' of git://git.kernel.o…
Browse files Browse the repository at this point in the history
…rg/pub/scm/linux/kernel/git/akpm/mm

Pull hotfixes from Andrew Morton:
 "Eight fixes, all cc:stable. One is for gcov and the remainder are MM"

* tag 'mm-hotfixes-stable-2022-12-22-14-34' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  gcov: add support for checksum field
  test_maple_tree: add test for mas_spanning_rebalance() on insufficient data
  maple_tree: fix mas_spanning_rebalance() on insufficient data
  hugetlb: really allocate vma lock for all sharable vmas
  kmsan: export kmsan_handle_urb
  kmsan: include linux/vmalloc.h
  mm/mempolicy: fix memory leak in set_mempolicy_home_node system call
  mm, mremap: fix mremap() expanding vma with addr inside vma
  • Loading branch information
torvalds committed Dec 23, 2022
2 parents 8395ae0 + e96b95c commit 699aee7
Show file tree
Hide file tree
Showing 8 changed files with 184 additions and 187 deletions.
5 changes: 5 additions & 0 deletions kernel/gcov/gcc_4_7.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ struct gcov_fn_info {
* @version: gcov version magic indicating the gcc version used for compilation
* @next: list head for a singly-linked list
* @stamp: uniquifying time stamp
* @checksum: unique object checksum
* @filename: name of the associated gcov data file
* @merge: merge functions (null for unused counter type)
* @n_functions: number of instrumented functions
Expand All @@ -94,6 +95,10 @@ struct gcov_info {
unsigned int version;
struct gcov_info *next;
unsigned int stamp;
/* Since GCC 12.1 a checksum field is added. */
#if (__GNUC__ >= 12)
unsigned int checksum;
#endif
const char *filename;
void (*merge[GCOV_COUNTERS])(gcov_type *, unsigned int);
unsigned int n_functions;
Expand Down
4 changes: 3 additions & 1 deletion lib/maple_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2994,7 +2994,9 @@ static int mas_spanning_rebalance(struct ma_state *mas,
mast->free = &free;
mast->destroy = &destroy;
l_mas.node = r_mas.node = m_mas.node = MAS_NONE;
if (!(mast->orig_l->min && mast->orig_r->max == ULONG_MAX) &&

/* Check if this is not root and has sufficient data. */
if (((mast->orig_l->min != 0) || (mast->orig_r->max != ULONG_MAX)) &&
unlikely(mast->bn->b_end <= mt_min_slots[mast->bn->type]))
mast_spanning_rebalance(mast);

Expand Down
23 changes: 23 additions & 0 deletions lib/test_maple_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2498,6 +2498,25 @@ static noinline void check_dup(struct maple_tree *mt)
}
}

static noinline void check_bnode_min_spanning(struct maple_tree *mt)
{
int i = 50;
MA_STATE(mas, mt, 0, 0);

mt_set_non_kernel(9999);
mas_lock(&mas);
do {
mas_set_range(&mas, i*10, i*10+9);
mas_store(&mas, check_bnode_min_spanning);
} while (i--);

mas_set_range(&mas, 240, 509);
mas_store(&mas, NULL);
mas_unlock(&mas);
mas_destroy(&mas);
mt_set_non_kernel(0);
}

static DEFINE_MTREE(tree);
static int maple_tree_seed(void)
{
Expand Down Expand Up @@ -2742,6 +2761,10 @@ static int maple_tree_seed(void)
check_dup(&tree);
mtree_destroy(&tree);

mt_init_flags(&tree, MT_FLAGS_ALLOC_RANGE);
check_bnode_min_spanning(&tree);
mtree_destroy(&tree);

#if defined(BENCH)
skip:
#endif
Expand Down
Loading

0 comments on commit 699aee7

Please sign in to comment.