From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH 5/5] mm/hmm: WARN on illegal ->sync_cpu_device_pagetables errors Date: Wed, 14 Aug 2019 21:11:37 -0300 Message-ID: <20190815001137.GE11200@ziepe.ca> References: <20190814202027.18735-1-daniel.vetter@ffwll.ch> <20190814202027.18735-6-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: <20190814202027.18735-6-daniel.vetter@ffwll.ch> Sender: linux-kernel-owner@vger.kernel.org To: Daniel Vetter Cc: LKML , linux-mm@kvack.org, DRI Development , Intel Graphics Development , Ralph Campbell , John Hubbard , Dan Williams , Dan Carpenter , Matthew Wilcox , Arnd Bergmann , Balbir Singh , Ira Weiny , Souptick Joarder , Andrew Morton , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Daniel Vetter List-Id: intel-gfx@lists.freedesktop.org On Wed, Aug 14, 2019 at 10:20:27PM +0200, Daniel Vetter wrote: > Similar to the warning in the mmu notifer, warning if an hmm mirror > callback gets it's blocking vs. nonblocking handling wrong, or if it > fails with anything else than -EAGAIN. > > Cc: Jason Gunthorpe > Cc: Ralph Campbell > Cc: John Hubbard > Cc: Dan Williams > Cc: Dan Carpenter > Cc: Matthew Wilcox > Cc: Arnd Bergmann > Cc: Balbir Singh > Cc: Ira Weiny > Cc: Souptick Joarder > Cc: Andrew Morton > Cc: "Jérôme Glisse" > Cc: linux-mm@kvack.org > Signed-off-by: Daniel Vetter > mm/hmm.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/mm/hmm.c b/mm/hmm.c > index 16b6731a34db..52ac59384268 100644 > +++ b/mm/hmm.c > @@ -205,6 +205,9 @@ static int hmm_invalidate_range_start(struct mmu_notifier *mn, > ret = -EAGAIN; > break; > } > + WARN(ret, "%pS callback failed with %d in %sblockable context\n", > + mirror->ops->sync_cpu_device_pagetables, ret, > + update.blockable ? "" : "non-"); > } > up_read(&hmm->mirrors_sem); Didn't I beat you to this? list_for_each_entry(mirror, &hmm->mirrors, list) { int rc; rc = mirror->ops->sync_cpu_device_pagetables(mirror, &update); if (rc) { if (WARN_ON(update.blockable || rc != -EAGAIN)) continue; ret = -EAGAIN; break; } } Thanks, Jason