linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@mellanox.com>
To: Ralph Campbell <rcampbell@nvidia.com>
Cc: linux-mm@kvack.org, "Michal Hocko" <mhocko@suse.com>,
	"Jérôme Glisse" <jglisse@redhat.com>,
	"Christoph Hellwig" <hch@lst.de>
Subject: Re: [PATCH v3] mm/mmu_notifier: prevent unpaired invalidate_start and invalidate_end
Date: Tue, 11 Feb 2020 19:42:10 -0400	[thread overview]
Message-ID: <20200211234210.GQ4271@mellanox.com> (raw)
In-Reply-To: <de6e6c74-dd62-5f1f-78d4-7387030082bf@nvidia.com>

On Tue, Feb 11, 2020 at 01:28:42PM -0800, Ralph Campbell wrote:
> > +/*
> > + * Add a hlist subscription to the list. The list is kept sorted by the
> > + * existence of ops->invalidate_range_end. If there is more than one
> > + * invalidate_range_end in the list then this process can no longer support
> > + * non-blocking invalidation.
> > + *
> > + * non-blocking invalidation is problematic as a requirement to block results in
> > + * the invalidation being aborted, however due to the use of RCU we have no
> > + * reliable way to ensure that every sueessful invalidate_range_start() results
> 
> s/sueessful/successful

woops, yes, two spellos, thanks

> > +{
> > +	struct mmu_notifier *last = NULL;
> > +	struct mmu_notifier *itr;
> > +
> > +	hlist_for_each_entry(itr, &subscriptions->list, hlist)
> > +		last = itr;
> > +
> > +	if (last && last->ops->invalidate_range_end &&
> > +	    subscription->ops->invalidate_range_end) {
> > +		subscriptions->no_blocking = true;
> > +		pr_warn_once(
> > +			"%s (%d) created two mmu_notifier's with invalidate_range_end(): %ps and %ps, non-blocking notifiers disabled\n",
> 
> line length?

Style guide is to keep strings across the 80 cols for grepability

> >   /*
> >    * Same as mmu_notifier_register but here the caller must hold the mmap_sem in
> >    * write mode. A NULL mn signals the notifier is being registered for itree
> > @@ -660,8 +707,8 @@ int __mmu_notifier_register(struct mmu_notifier *subscription,
> >   		subscription->users = 1;
> >   		spin_lock(&mm->notifier_subscriptions->lock);
> > -		hlist_add_head_rcu(&subscription->hlist,
> > -				   &mm->notifier_subscriptions->list);
> > +		mn_hist_add_subscription(mm->notifier_subscriptions,
> > +					 subscription);
> >   		spin_unlock(&mm->notifier_subscriptions->lock);
> >   	} else
> >   		mm->notifier_subscriptions->has_itree = true;
> > 
> 
> Other than some nits, looks good to me so you can add:
> Reviewed-by: Ralph Campbell <rcampbell@nvidia.com>

Great, thanks!

Jason


  reply	other threads:[~2020-02-11 23:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11 20:52 [PATCH v3] mm/mmu_notifier: prevent unpaired invalidate_start and invalidate_end Jason Gunthorpe
2020-02-11 21:28 ` Ralph Campbell
2020-02-11 23:42   ` Jason Gunthorpe [this message]
2020-02-28 13:50 ` Jason Gunthorpe
2020-03-24 19:41   ` Jason Gunthorpe
2020-03-25  8:01     ` Michal Hocko
2020-03-25 12:14       ` Jason Gunthorpe
2020-03-25 13:06         ` Michal Hocko
2020-03-26 13:06 ` Qian Cai
2020-03-26 14:56   ` 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=20200211234210.GQ4271@mellanox.com \
    --to=jgg@mellanox.com \
    --cc=hch@lst.de \
    --cc=jglisse@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=rcampbell@nvidia.com \
    /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: link
Be 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).