Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp1780859imc; Fri, 22 Feb 2019 11:03:06 -0800 (PST) X-Google-Smtp-Source: AHgI3IYGyN4L1uwe5sOFgE9SyQM/BUytpaF7ksdoUqLBcN2cRtHJTqMUdp3acAP95Jez9lxjlYnJ X-Received: by 2002:a17:902:2e01:: with SMTP id q1mr5643614plb.240.1550862186313; Fri, 22 Feb 2019 11:03:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550862186; cv=none; d=google.com; s=arc-20160816; b=HOBR2iCiCMf1F4X1O/ta1ftGciwn/FYPkSRXdDrvDMOGm58PqSwpe5cDi3y26uD6Qf H1eQvQXBU0sw2dUY7LZ/pN0TKjPjNcs9n9jR2zLnW53qnJ9O2/RZgiFWynMWJc3cY3mP YDeL8/xDlkihp0wAQINRrG4A4sAoD06lb6GuiNxmu1sM7LohKe5+BonAFzBzucJ+bgOQ e5Iy8hnpzp63MYrsfMqssO1YrJILHsgLJGT4g37oqphbybOg3pRkLBQT4HNb4958lvka TULC3XjTYyRLZGvRIH4qadsa2rU5PqDvYIU7pwcn8nTfMH3XNIL7yvGN8XDkcVWX5dy6 22VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=x3ep/Gi+sTbOk9gLW6cFVFGUmrcJKXma0tiO4b4QgOg=; b=IEgoarboO2mK3EwY7ybEuT3jwY3VSeIC3dWsdbRI5UgCgUp8wdN4oZSZiY0pLK8jbw C57sMRMrW9bGkNvLf5Ei/Tt36/uSIO8BNRj9yee2B+UsUDlSzlT+s8WeImpyJNXbKh+9 8waJfOWiKjI5ViwKS89QeVsuGKw2KskJCs76iMgS9PVEtz3HEKfK6KeIIZa4fOpq14QT OgOSC81dUN9p6aJ76J/KL9FVKHuSqsVTbfl58J1ysk+SyHYC25C9Gp482zsZEqC3St2T TwPh5rIEkN0n6Bp4MOpATQQFTxCwn6Gddfq9HNY2+/m6wPcTDIwVWf5sDwNXcBChJixm M+qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=YPy7Q3OM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s123si2005135pgs.93.2019.02.22.11.02.51; Fri, 22 Feb 2019 11:03:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=YPy7Q3OM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726492AbfBVTBD (ORCPT + 99 others); Fri, 22 Feb 2019 14:01:03 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:9420 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726178AbfBVTBD (ORCPT ); Fri, 22 Feb 2019 14:01:03 -0500 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 22 Feb 2019 11:01:00 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Fri, 22 Feb 2019 11:01:02 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Fri, 22 Feb 2019 11:01:02 -0800 Received: from rcampbell-dev.nvidia.com (10.124.1.5) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 22 Feb 2019 19:01:01 +0000 Subject: Re: [PATCH v5 1/9] mm/mmu_notifier: helper to test if a range invalidation is blockable To: , , Andrew Morton CC: , =?UTF-8?Q?Christian_K=c3=b6nig?= , Joonas Lahtinen , Jani Nikula , Rodrigo Vivi , Jan Kara , Andrea Arcangeli , Peter Xu , Felix Kuehling , Jason Gunthorpe , Ross Zwisler , Dan Williams , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Michal Hocko , John Hubbard , , , , , Arnd Bergmann References: <20190219200430.11130-1-jglisse@redhat.com> <20190219200430.11130-2-jglisse@redhat.com> From: Ralph Campbell Message-ID: Date: Fri, 22 Feb 2019 11:01:01 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20190219200430.11130-2-jglisse@redhat.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL101.nvidia.com (172.20.187.10) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1550862060; bh=x3ep/Gi+sTbOk9gLW6cFVFGUmrcJKXma0tiO4b4QgOg=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=YPy7Q3OMR8x41jv2A+iuoBr/NEseguMVKb+xW4/BDY4vP1uynrzZVXtz7+vwpM0pz Z/LQ2s6yAsC0aqxH7hKB6PjUog2hYAlv4K8t1r3RbU01x874oUNH2UqLURkDAJsU7s B7DLZ1FeBqXJzAZTTCj0VKnGkHzhW11xY3osITv6Eb92BvzgpmCb2rltVgZb2g+XA6 AE8qO3v6CnAX5iQGjGqzGCJU4mfd1LX4fPrNL8V+VZffI4zZg8m1uA9BlgARC/LKio ufrKrUUb7kcM/5Tr73O5hPzWqT1VfVbH8kLc2sf8I6ExkxpreHxsqNxyggmViUJIdD uMbIo5Ay2VvHQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/19/19 12:04 PM, jglisse@redhat.com wrote: > From: J=C3=A9r=C3=B4me Glisse >=20 > Simple helpers to test if range invalidation is blockable. Latter > patches use cocinnelle to convert all direct dereference of range-> > blockable to use this function instead so that we can convert the > blockable field to an unsigned for more flags. >=20 > Signed-off-by: J=C3=A9r=C3=B4me Glisse > Cc: Christian K=C3=B6nig > Cc: Joonas Lahtinen > Cc: Jani Nikula > Cc: Rodrigo Vivi > Cc: Jan Kara > Cc: Andrea Arcangeli > Cc: Peter Xu > Cc: Felix Kuehling > Cc: Jason Gunthorpe > Cc: Andrew Morton > Cc: Ross Zwisler > Cc: Dan Williams > Cc: Paolo Bonzini > Cc: Radim Kr=C4=8Dm=C3=A1=C5=99 > Cc: Michal Hocko > Cc: Christian Koenig > Cc: Ralph Campbell > Cc: John Hubbard > Cc: kvm@vger.kernel.org > Cc: dri-devel@lists.freedesktop.org > Cc: linux-rdma@vger.kernel.org > Cc: linux-fsdevel@vger.kernel.org > Cc: Arnd Bergmann > --- > include/linux/mmu_notifier.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) >=20 > diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h > index 4050ec1c3b45..e630def131ce 100644 > --- a/include/linux/mmu_notifier.h > +++ b/include/linux/mmu_notifier.h > @@ -226,6 +226,12 @@ extern void __mmu_notifier_invalidate_range_end(stru= ct mmu_notifier_range *r, > extern void __mmu_notifier_invalidate_range(struct mm_struct *mm, > unsigned long start, unsigned long end); > =20 > +static inline bool > +mmu_notifier_range_blockable(const struct mmu_notifier_range *range) > +{ > + return range->blockable; > +} > + > static inline void mmu_notifier_release(struct mm_struct *mm) > { > if (mm_has_notifiers(mm)) > @@ -455,6 +461,11 @@ static inline void _mmu_notifier_range_init(struct m= mu_notifier_range *range, > #define mmu_notifier_range_init(range, mm, start, end) \ > _mmu_notifier_range_init(range, start, end) > =20 > +static inline bool > +mmu_notifier_range_blockable(const struct mmu_notifier_range *range) > +{ > + return true; > +} > =20 > static inline int mm_has_notifiers(struct mm_struct *mm) > { Reviewed-by: Ralph Campbell