Displaying 8 results from an estimated 8 matches for "has_interval".
2019 Oct 28
0
[PATCH v2 02/15] mm/mmu_notifier: add an interval tree notifier
...inux/srcu.h>
#include <linux/rcupdate.h>
#include <linux/sched.h>
@@ -36,10 +37,243 @@ struct lockdep_map __mmu_notifier_invalidate_range_start_map = {
struct mmu_notifier_mm {
/* all mmu notifiers registered in this mm are queued in this list */
struct hlist_head list;
+ bool has_interval;
/* to serialize the list modifications and hlist_unhashed */
spinlock_t lock;
+ unsigned long invalidate_seq;
+ unsigned long active_invalidate_ranges;
+ struct rb_root_cached itree;
+ wait_queue_head_t wq;
+ struct hlist_head deferred_list;
};
+/*
+ * This is a collision-retry read-side/wr...
2019 Oct 29
1
[PATCH v2 02/15] mm/mmu_notifier: add an interval tree notifier
...p holds an mm_count pin
> * itself.
> */
> -void __mmu_notifier_release(struct mm_struct *mm)
> +static void mn_hlist_release(struct mmu_notifier_mm *mmn_mm,
> + struct mm_struct *mm)
> {
> struct mmu_notifier *mn;
> int id;
>
> + if (mmn_mm->has_interval)
> + mn_itree_release(mmn_mm, mm);
> +
> + if (hlist_empty(&mmn_mm->list))
> + return;
This seems to duplicate the conditions in __mmu_notifier_release. See my
comments below, I think one of them is wrong. I suspect this one,
because __mmu_notifier_release follows the same p...
2019 Oct 29
0
[PATCH v2 02/15] mm/mmu_notifier: add an interval tree notifier
...; > */
> > -void __mmu_notifier_release(struct mm_struct *mm)
> > +static void mn_hlist_release(struct mmu_notifier_mm *mmn_mm,
> > + struct mm_struct *mm)
> > {
> > struct mmu_notifier *mn;
> > int id;
> >
> > + if (mmn_mm->has_interval)
> > + mn_itree_release(mmn_mm, mm);
> > +
> > + if (hlist_empty(&mmn_mm->list))
> > + return;
>
> This seems to duplicate the conditions in __mmu_notifier_release. See my
> comments below, I think one of them is wrong. I suspect this one,
> because _...
2019 Nov 08
0
[PATCH v2 02/15] mm/mmu_notifier: add an interval tree notifier
...9;s how I found it. The top of your mmu_notifier branch has this:
>
> int __mmu_notifier_invalidate_range_start(struct mmu_notifier_range *range)
> {
> struct mmu_notifier_mm *mmn_mm = range->mm->mmu_notifier_mm;
> int ret = 0;
>
> if (mmn_mm->has_interval) {
> ret = mn_itree_invalidate(mmn_mm, range);
> if (ret)
> return ret;
> }
> if (!hlist_empty(&mmn_mm->list))
> return mn_hlist_invalidate_range_start(mmn_mm, range);
> retur...
2019 Nov 07
0
[PATCH v2 02/15] mm/mmu_notifier: add an interval tree notifier
...ks OK in my tree?
Nope, that's how I found it. The top of your mmu_notifier branch has this:
int __mmu_notifier_invalidate_range_start(struct mmu_notifier_range *range)
{
struct mmu_notifier_mm *mmn_mm = range->mm->mmu_notifier_mm;
int ret = 0;
if (mmn_mm->has_interval) {
ret = mn_itree_invalidate(mmn_mm, range);
if (ret)
return ret;
}
if (!hlist_empty(&mmn_mm->list))
return mn_hlist_invalidate_range_start(mmn_mm, range);
return 0;
}
>
>>>...
2019 Oct 28
32
[PATCH v2 00/15] Consolidate the mmu notifier interval_tree and locking
From: Jason Gunthorpe <jgg at mellanox.com>
8 of the mmu_notifier using drivers (i915_gem, radeon_mn, umem_odp, hfi1,
scif_dma, vhost, gntdev, hmm) drivers are using a common pattern where
they only use invalidate_range_start/end and immediately check the
invalidating range against some driver data structure to tell if the
driver is interested. Half of them use an interval_tree, the others
2019 Nov 07
1
[PATCH v2 02/15] mm/mmu_notifier: add an interval tree notifier
On Wed, Nov 06, 2019 at 04:23:21PM -0800, John Hubbard wrote:
> Nice design, I love the seq foundation! So far, I'm not able to spot anything
> actually wrong with the implementation, sorry about that.
Alas :( I feel there must be a bug in here still, but onwards!
One of the main sad points was it didn't make sense to use the
existing seqlock/seqcount primitives as they have
2019 Nov 07
5
[PATCH v2 02/15] mm/mmu_notifier: add an interval tree notifier
...linux/rcupdate.h>
> #include <linux/sched.h>
> @@ -36,10 +37,243 @@ struct lockdep_map __mmu_notifier_invalidate_range_start_map = {
> struct mmu_notifier_mm {
> /* all mmu notifiers registered in this mm are queued in this list */
> struct hlist_head list;
> + bool has_interval;
> /* to serialize the list modifications and hlist_unhashed */
> spinlock_t lock;
> + unsigned long invalidate_seq;
> + unsigned long active_invalidate_ranges;
> + struct rb_root_cached itree;
> + wait_queue_head_t wq;
> + struct hlist_head deferred_list;
> };
>
&...