Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752607AbdLLV2G (ORCPT ); Tue, 12 Dec 2017 16:28:06 -0500 Received: from mail-io0-f182.google.com ([209.85.223.182]:44262 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752415AbdLLV2E (ORCPT ); Tue, 12 Dec 2017 16:28:04 -0500 X-Google-Smtp-Source: ACJfBosWJUounTe+VcteLUuOSLmLRTKsKL6U1GqySWmJHZLIf9GRTAPo/y9TwWHYN+3tmz2/Re6K3Q== Date: Tue, 12 Dec 2017 13:28:01 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Dimitri Sivanich cc: Andrew Morton , Michal Hocko , Andrea Arcangeli , Benjamin Herrenschmidt , Paul Mackerras , Oded Gabbay , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , David Airlie , Joerg Roedel , Doug Ledford , Jani Nikula , Mike Marciniszyn , Sean Hefty , Dimitri Sivanich , Boris Ostrovsky , =?UTF-8?Q?J=C3=A9r=C3=B4me_Glisse?= , Paolo Bonzini , =?UTF-8?Q?Radim_Kr=C4=8Dm=C3=A1=C5=99?= , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch 1/2] mm, mmu_notifier: annotate mmu notifiers with blockable invalidate callbacks In-Reply-To: <20171212200542.GJ5848@hpe.com> Message-ID: References: <20171212200542.GJ5848@hpe.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 879 Lines: 23 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.