linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Tetsuo Handa" <penguin-kernel@I-love.SAKURA.ne.jp>,
	"Christian König" <christian.koenig@amd.com>,
	"David Rientjes" <rientjes@google.com>,
	"Dimitri Sivanich" <sivanich@hpe.com>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
	"Michal Hocko" <mhocko@suse.com>,
	"Andrea Arcangeli" <aarcange@redhat.com>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Paul Mackerras" <paulus@samba.org>,
	"Oded Gabbay" <oded.gabbay@gmail.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"David Airlie" <airlied@linux.ie>,
	"Joerg Roedel" <joro@8bytes.org>,
	"Doug Ledford" <dledford@redhat.com>,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	"Mike Marciniszyn" <mike.marciniszyn@intel.com>,
	"Sean Hefty" <sean.hefty@intel.com>,
	"Dimitri Sivanich" <sivanich@sgi.com>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	"Jérôme Glisse" <jglisse@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>
Subject: Re: [patch 1/2] mm, mmu_notifier: annotate mmu notifiers with blockable invalidate callbacks
Date: Wed, 13 Dec 2017 11:37:25 +0100	[thread overview]
Message-ID: <e576ba24-7e36-4727-479a-d3406dbe6959@redhat.com> (raw)
In-Reply-To: <d435cf68-1073-7bdb-c5e7-c28f3e15bcb0@I-love.SAKURA.ne.jp>

On 13/12/2017 11:26, Tetsuo Handa wrote:
> On 2017/12/13 18:34, Christian KA?nig wrote:
>> Am 12.12.2017 um 22:28 schrieb David Rientjes:
>>> On Tue, 12 Dec 2017, Dimitri Sivanich wrote:
>>>
>>>>> --- a/drivers/misc/sgi-gru/grutlbpurge.c
>>>>> +++ b/drivers/misc/sgi-gru/grutlbpurge.c
>>>>> @@ -298,6 +298,7 @@ struct gru_mm_struct *gru_register_mmu_notifier(void)
>>>>>               return ERR_PTR(-ENOMEM);
>>>>>           STAT(gms_alloc);
>>>>>           spin_lock_init(&gms->ms_asid_lock);
>>>>> +        gms->ms_notifier.flags = 0;
>>>>>           gms->ms_notifier.ops = &gru_mmuops;
>>>>>           atomic_set(&gms->ms_refcnt, 1);
>>>>>           init_waitqueue_head(&gms->ms_wait_queue);
>>>>> diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
>>>> There is a kzalloc() just above this:
>>>>     gms = kzalloc(sizeof(*gms), GFP_KERNEL);
>>>>
>>>> Is that not sufficient to clear the 'flags' field?
>>>>
>>> Absolutely, but whether it is better to explicitly document that the mmu
>>> notifier has cleared flags, i.e. there are no blockable callbacks, is
>>> another story.  I can change it if preferred.
>>
>> Actually I would invert the new flag, in other words specify that an MMU notifier will never sleep.
>>
>> The first reason is that we have 8 blocking notifiers and 5 not blocking if I counted right. So it is actually more common to sleep than not to.
>>
>> The second reason is to be conservative and assume the worst, e.g. that the flag is forgotten when a new notifier is added.
> 
> I agree. Some out of tree module might forget to set the flags.
> 
> Although you don't need to fix out of tree modules, as a troubleshooting
> staff at a support center, I want to be able to identify the careless module.
> 
> I guess specifying the flags at register function would be the best, for
> an attempt to call register function without knowing this change will
> simply results in a build failure.

Specifying them in the ops would have the same effect and it would be
even better, as you don't have to split the information across two places.

Paolo

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-12-13 10:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 22:11 David Rientjes
2017-12-11 22:11 ` [patch 2/2] mm, oom: avoid reaping only for mm's " David Rientjes
2017-12-11 22:23 ` [patch 1/2] mm, mmu_notifier: annotate mmu notifiers " Paolo Bonzini
2017-12-11 23:09   ` David Rientjes
2017-12-12 20:05 ` Dimitri Sivanich
2017-12-12 21:28   ` David Rientjes
2017-12-13  9:34     ` Christian König
2017-12-13 10:26       ` Tetsuo Handa
2017-12-13 10:37         ` Paolo Bonzini [this message]
2017-12-14  9:19       ` David Rientjes
2017-12-14 12:46 ` kbuild test robot
2017-12-14 21:30 ` [patch v2 " David Rientjes
2017-12-14 21:31   ` [patch v2 2/2] mm, oom: avoid reaping only for mm's " David Rientjes
2017-12-15 16:35     ` Michal Hocko
2017-12-15 21:46       ` David Rientjes
2017-12-15  8:42   ` [patch v2 1/2] mm, mmu_notifier: annotate mmu notifiers " Paolo Bonzini
2017-12-15 12:19   ` Christian König
2017-12-15 13:36   ` Dimitri Sivanich
2017-12-15 16:25   ` Michal Hocko
2017-12-16  6:21     ` Tetsuo Handa
2017-12-16 11:33       ` Michal Hocko
2017-12-15 23:04   ` Andrew Morton
2017-12-16  7:14     ` Tetsuo Handa
2017-12-16 11:36       ` Michal Hocko
2017-12-16 14:45         ` Tetsuo Handa
2017-12-16  9:10     ` Michal Hocko
2018-01-09 21:40     ` [patch -mm] mm, mmu_notifier: annotate mmu notifiers with blockable invalidate callbacks fix fix David Rientjes

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=e576ba24-7e36-4727-479a-d3406dbe6959@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.deucher@amd.com \
    --cc=benh@kernel.crashing.org \
    --cc=boris.ostrovsky@oracle.com \
    --cc=christian.koenig@amd.com \
    --cc=dledford@redhat.com \
    --cc=jani.nikula@linux.intel.com \
    --cc=jglisse@redhat.com \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=mike.marciniszyn@intel.com \
    --cc=oded.gabbay@gmail.com \
    --cc=paulus@samba.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=rientjes@google.com \
    --cc=rkrcmar@redhat.com \
    --cc=sean.hefty@intel.com \
    --cc=sivanich@hpe.com \
    --cc=sivanich@sgi.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