mmu_notifier.c (a23e1966932464e1c5226cb9ac4ce1d5fc10ba22) mmu_notifier.c (49b1b8d6f6831026cb105b0eafa18f13db612d86)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/mm/mmu_notifier.c
4 *
5 * Copyright (C) 2008 Qumranet, Inc.
6 * Copyright (C) 2008 SGI
7 * Christoph Lameter <cl@linux.com>
8 */

--- 5 unchanged lines hidden (view full) ---

14#include <linux/err.h>
15#include <linux/interval_tree.h>
16#include <linux/srcu.h>
17#include <linux/rcupdate.h>
18#include <linux/sched.h>
19#include <linux/sched/mm.h>
20#include <linux/slab.h>
21
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/mm/mmu_notifier.c
4 *
5 * Copyright (C) 2008 Qumranet, Inc.
6 * Copyright (C) 2008 SGI
7 * Christoph Lameter <cl@linux.com>
8 */

--- 5 unchanged lines hidden (view full) ---

14#include <linux/err.h>
15#include <linux/interval_tree.h>
16#include <linux/srcu.h>
17#include <linux/rcupdate.h>
18#include <linux/sched.h>
19#include <linux/sched/mm.h>
20#include <linux/slab.h>
21
22#include "vma.h"
23
22/* global SRCU for all MMs */
23DEFINE_STATIC_SRCU(srcu);
24
25#ifdef CONFIG_LOCKDEP
26struct lockdep_map __mmu_notifier_invalidate_range_start_map = {
27 .name = "mmu_notifier_invalidate_range_start"
28};
29#endif

--- 389 unchanged lines hidden (view full) ---

419 break;
420 }
421 }
422 srcu_read_unlock(&srcu, id);
423
424 return young;
425}
426
24/* global SRCU for all MMs */
25DEFINE_STATIC_SRCU(srcu);
26
27#ifdef CONFIG_LOCKDEP
28struct lockdep_map __mmu_notifier_invalidate_range_start_map = {
29 .name = "mmu_notifier_invalidate_range_start"
30};
31#endif

--- 389 unchanged lines hidden (view full) ---

421 break;
422 }
423 }
424 srcu_read_unlock(&srcu, id);
425
426 return young;
427}
428
427void __mmu_notifier_change_pte(struct mm_struct *mm, unsigned long address,
428 pte_t pte)
429{
430 struct mmu_notifier *subscription;
431 int id;
432
433 id = srcu_read_lock(&srcu);
434 hlist_for_each_entry_rcu(subscription,
435 &mm->notifier_subscriptions->list, hlist,
436 srcu_read_lock_held(&srcu)) {
437 if (subscription->ops->change_pte)
438 subscription->ops->change_pte(subscription, mm, address,
439 pte);
440 }
441 srcu_read_unlock(&srcu, id);
442}
443
444static int mn_itree_invalidate(struct mmu_notifier_subscriptions *subscriptions,
445 const struct mmu_notifier_range *range)
446{
447 struct mmu_interval_notifier *interval_sub;
448 unsigned long cur_seq;
449
450 for (interval_sub =
451 mn_itree_inv_start_range(subscriptions, range, &cur_seq);

--- 663 unchanged lines hidden ---
429static int mn_itree_invalidate(struct mmu_notifier_subscriptions *subscriptions,
430 const struct mmu_notifier_range *range)
431{
432 struct mmu_interval_notifier *interval_sub;
433 unsigned long cur_seq;
434
435 for (interval_sub =
436 mn_itree_inv_start_range(subscriptions, range, &cur_seq);

--- 663 unchanged lines hidden ---