From: Jason Gunthorpe <jgg@mellanox.com> To: Ralph Campbell <rcampbell@nvidia.com> Cc: "nouveau@lists.freedesktop.org" <nouveau@lists.freedesktop.org>, "dri-devel@lists.freedesktop.org" <dri-devel@lists.freedesktop.org>, "linux-mm@kvack.org" <linux-mm@kvack.org>, David Zhou <David1.Zhou@amd.com>, Stefano Stabellini <sstabellini@kernel.org>, Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, "linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>, "amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>, Christoph Hellwig <hch@infradead.org>, Ben Skeggs <bskeggs@redhat.com>, "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Philip Yang <Philip.Yang@amd.com>, John Hubbard <jhubbard@nvidia.com>, Jerome Glisse <jglisse@redhat.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Petr Cvek <petrcvekcz@gmail.com>, Juergen Gross <jgross@suse.com>, Mike Marciniszyn <mike.marciniszyn@intel.com>, "Felix.Kuehling@amd.com" <Felix.Kuehl> Subject: Re: [PATCH v3 02/14] mm/mmu_notifier: add an interval tree notifier Date: Sat, 23 Nov 2019 23:59:53 +0000 [thread overview] Message-ID: <20191123235949.GE7481@mellanox.com> (raw) In-Reply-To: <cc5d4d76-df30-af7f-931c-eed8a7ada122@nvidia.com> On Fri, Nov 22, 2019 at 04:54:08PM -0800, Ralph Campbell wrote: > Actually, I think you can remove the "need_wake" variable since it is > unconditionally set to "true". Oh, yes, thank you. An earlier revision had a different control flow > Also, the comment in__mmu_interval_notifier_insert() says > "mni->mr_invalidate_seq" and I think that should be > "mni->invalidate_seq". Got it. I squashed this in: diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c index b3a064b3b31807..30abbfdc25be55 100644 --- a/mm/mmu_notifier.c +++ b/mm/mmu_notifier.c @@ -129,7 +129,6 @@ static void mn_itree_inv_end(struct mmu_notifier_mm *mmn_mm) { struct mmu_interval_notifier *mni; struct hlist_node *next; - bool need_wake = false; spin_lock(&mmn_mm->lock); if (--mmn_mm->active_invalidate_ranges || @@ -140,7 +139,6 @@ static void mn_itree_inv_end(struct mmu_notifier_mm *mmn_mm) /* Make invalidate_seq even */ mmn_mm->invalidate_seq++; - need_wake = true; /* * The inv_end incorporates a deferred mechanism like rtnl_unlock(). @@ -160,8 +158,7 @@ static void mn_itree_inv_end(struct mmu_notifier_mm *mmn_mm) } spin_unlock(&mmn_mm->lock); - if (need_wake) - wake_up_all(&mmn_mm->wq); + wake_up_all(&mmn_mm->wq); } /** @@ -884,7 +881,7 @@ static int __mmu_interval_notifier_insert( * possibility for live lock, instead defer the add to * mn_itree_inv_end() so this algorithm is deterministic. * - * In all cases the value for the mni->mr_invalidate_seq should be + * In all cases the value for the mni->invalidate_seq should be * odd, see mmu_interval_read_begin() */ spin_lock(&mmn_mm->lock); Jason _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@mellanox.com> To: Ralph Campbell <rcampbell@nvidia.com> Cc: "nouveau@lists.freedesktop.org" <nouveau@lists.freedesktop.org>, "dri-devel@lists.freedesktop.org" <dri-devel@lists.freedesktop.org>, "linux-mm@kvack.org" <linux-mm@kvack.org>, "David Zhou" <David1.Zhou@amd.com>, "Stefano Stabellini" <sstabellini@kernel.org>, "Oleksandr Andrushchenko" <oleksandr_andrushchenko@epam.com>, "linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>, "amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>, "Christoph Hellwig" <hch@infradead.org>, "Ben Skeggs" <bskeggs@redhat.com>, "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, "Philip Yang" <Philip.Yang@amd.com>, "John Hubbard" <jhubbard@nvidia.com>, "Jerome Glisse" <jglisse@redhat.com>, "Boris Ostrovsky" <boris.ostrovsky@oracle.com>, "Petr Cvek" <petrcvekcz@gmail.com>, "Juergen Gross" <jgross@suse.com>, "Mike Marciniszyn" <mike.marciniszyn@intel.com>, "Felix.Kuehling@amd.com" <Felix.Kuehling@amd.com>, "Christian König" <christian.koenig@amd.com>, "Alex Deucher" <alexander.deucher@amd.com>, "Dennis Dalessandro" <dennis.dalessandro@intel.com> Subject: Re: [PATCH v3 02/14] mm/mmu_notifier: add an interval tree notifier Date: Sat, 23 Nov 2019 23:59:53 +0000 [thread overview] Message-ID: <20191123235949.GE7481@mellanox.com> (raw) Message-ID: <20191123235953.KPrjYHXiUCn128LZKQnHC1Q6coG3jo9VajNPhtdPyPE@z> (raw) In-Reply-To: <cc5d4d76-df30-af7f-931c-eed8a7ada122@nvidia.com> On Fri, Nov 22, 2019 at 04:54:08PM -0800, Ralph Campbell wrote: > Actually, I think you can remove the "need_wake" variable since it is > unconditionally set to "true". Oh, yes, thank you. An earlier revision had a different control flow > Also, the comment in__mmu_interval_notifier_insert() says > "mni->mr_invalidate_seq" and I think that should be > "mni->invalidate_seq". Got it. I squashed this in: diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c index b3a064b3b31807..30abbfdc25be55 100644 --- a/mm/mmu_notifier.c +++ b/mm/mmu_notifier.c @@ -129,7 +129,6 @@ static void mn_itree_inv_end(struct mmu_notifier_mm *mmn_mm) { struct mmu_interval_notifier *mni; struct hlist_node *next; - bool need_wake = false; spin_lock(&mmn_mm->lock); if (--mmn_mm->active_invalidate_ranges || @@ -140,7 +139,6 @@ static void mn_itree_inv_end(struct mmu_notifier_mm *mmn_mm) /* Make invalidate_seq even */ mmn_mm->invalidate_seq++; - need_wake = true; /* * The inv_end incorporates a deferred mechanism like rtnl_unlock(). @@ -160,8 +158,7 @@ static void mn_itree_inv_end(struct mmu_notifier_mm *mmn_mm) } spin_unlock(&mmn_mm->lock); - if (need_wake) - wake_up_all(&mmn_mm->wq); + wake_up_all(&mmn_mm->wq); } /** @@ -884,7 +881,7 @@ static int __mmu_interval_notifier_insert( * possibility for live lock, instead defer the add to * mn_itree_inv_end() so this algorithm is deterministic. * - * In all cases the value for the mni->mr_invalidate_seq should be + * In all cases the value for the mni->invalidate_seq should be * odd, see mmu_interval_read_begin() */ spin_lock(&mmn_mm->lock); Jason _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2019-11-23 23:59 UTC|newest] Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-11-12 20:22 [PATCH hmm v3 00/14] Consolidate the mmu notifier interval_tree and locking Jason Gunthorpe 2019-11-12 20:22 ` Jason Gunthorpe 2019-11-12 20:22 ` [PATCH v3 01/14] mm/mmu_notifier: define the header pre-processor parts even if disabled Jason Gunthorpe 2019-11-12 20:22 ` Jason Gunthorpe 2019-11-13 13:52 ` Christoph Hellwig 2019-11-13 13:52 ` Christoph Hellwig 2019-11-12 20:22 ` [PATCH v3 02/14] mm/mmu_notifier: add an interval tree notifier Jason Gunthorpe 2019-11-12 20:22 ` Jason Gunthorpe 2019-11-13 13:59 ` Christoph Hellwig 2019-11-13 13:59 ` Christoph Hellwig 2019-11-13 16:46 ` Jason Gunthorpe 2019-11-13 16:46 ` Jason Gunthorpe 2019-11-23 0:54 ` Ralph Campbell 2019-11-23 0:54 ` Ralph Campbell 2019-11-23 23:59 ` Jason Gunthorpe [this message] 2019-11-23 23:59 ` Jason Gunthorpe 2019-11-12 20:22 ` [PATCH v3 03/14] mm/hmm: allow hmm_range to be used with a mmu_interval_notifier or hmm_mirror Jason Gunthorpe 2019-11-12 20:22 ` Jason Gunthorpe 2019-11-13 14:00 ` Christoph Hellwig 2019-11-13 14:00 ` Christoph Hellwig 2019-11-12 20:22 ` [PATCH v3 04/14] mm/hmm: define the pre-processor related parts of hmm.h even if disabled Jason Gunthorpe 2019-11-12 20:22 ` Jason Gunthorpe 2019-11-13 14:01 ` Christoph Hellwig 2019-11-13 14:01 ` Christoph Hellwig 2019-11-12 20:22 ` [PATCH v3 05/14] RDMA/odp: Use mmu_interval_notifier_insert() Jason Gunthorpe 2019-11-12 20:22 ` Jason Gunthorpe 2019-11-12 20:22 ` [PATCH v3 06/14] RDMA/hfi1: Use mmu_interval_notifier_insert for user_exp_rcv Jason Gunthorpe 2019-11-12 20:22 ` Jason Gunthorpe 2019-11-12 20:22 ` [PATCH v3 07/14] drm/radeon: use mmu_interval_notifier_insert Jason Gunthorpe 2019-11-12 20:22 ` Jason Gunthorpe 2019-11-12 20:22 ` [PATCH v3 08/14] nouveau: use mmu_notifier directly for invalidate_range_start Jason Gunthorpe 2019-11-12 20:22 ` Jason Gunthorpe 2019-11-12 20:22 ` [PATCH v3 09/14] nouveau: use mmu_interval_notifier instead of hmm_mirror Jason Gunthorpe 2019-11-12 20:22 ` Jason Gunthorpe 2019-11-12 20:22 ` [PATCH v3 10/14] drm/amdgpu: Call find_vma under mmap_sem Jason Gunthorpe 2019-11-12 20:22 ` Jason Gunthorpe 2019-11-12 20:22 ` [PATCH v3 11/14] drm/amdgpu: Use mmu_interval_insert instead of hmm_mirror Jason Gunthorpe 2019-11-12 20:22 ` Jason Gunthorpe 2019-11-12 20:22 ` [PATCH v3 12/14] drm/amdgpu: Use mmu_interval_notifier " Jason Gunthorpe 2019-11-12 20:22 ` Jason Gunthorpe 2019-11-19 19:59 ` Philip Yang 2019-11-19 19:59 ` Philip Yang 2019-11-12 20:22 ` [PATCH v3 13/14] mm/hmm: remove hmm_mirror and related Jason Gunthorpe 2019-11-12 20:22 ` Jason Gunthorpe 2019-11-13 14:02 ` Christoph Hellwig 2019-11-13 14:02 ` Christoph Hellwig 2019-11-12 20:22 ` [PATCH v3 14/14] xen/gntdev: use mmu_interval_notifier_insert Jason Gunthorpe 2019-11-12 20:22 ` Jason Gunthorpe
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20191123235949.GE7481@mellanox.com \ --to=jgg@mellanox.com \ --cc=David1.Zhou@amd.com \ --cc=Philip.Yang@amd.com \ --cc=amd-gfx@lists.freedesktop.org \ --cc=boris.ostrovsky@oracle.com \ --cc=bskeggs@redhat.com \ --cc=dri-devel@lists.freedesktop.org \ --cc=hch@infradead.org \ --cc=jglisse@redhat.com \ --cc=jgross@suse.com \ --cc=jhubbard@nvidia.com \ --cc=linux-mm@kvack.org \ --cc=linux-rdma@vger.kernel.org \ --cc=mike.marciniszyn@intel.com \ --cc=nouveau@lists.freedesktop.org \ --cc=oleksandr_andrushchenko@epam.com \ --cc=petrcvekcz@gmail.com \ --cc=rcampbell@nvidia.com \ --cc=sstabellini@kernel.org \ --cc=xen-devel@lists.xenproject.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).