Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3934601imj; Tue, 19 Feb 2019 12:05:54 -0800 (PST) X-Google-Smtp-Source: AHgI3IYWgxo6gvhBAl5Ipi5XuQXBwwR70qV1Zuwz/4fn1ia4MCiWyk9DtXBEW7yjzxILVTbH67GT X-Received: by 2002:a17:902:b901:: with SMTP id bf1mr9387807plb.207.1550606754013; Tue, 19 Feb 2019 12:05:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550606754; cv=none; d=google.com; s=arc-20160816; b=Nu0oSWLFUsTW7+cS7nhaVl3CcjjpQRZytBYghVVDekwjfH0fSyjWVvls1vwLG+uLeV 0ui0L6AmOR+W1J7jMH3fyPQ4WKR1HlhKW20JXJlWhTOb7ezkRpCjXNqduzkByIbE3yOn 2m5TGxl9s0ek+MoIdfvs2gBQzV5zIEXapyJbPjU4qd1MxRv9g7lVFg7o1S3BQzruXrbz PIl3ukpPExDAJg+r6IU/qtr8Q8ZfbNUlwM86P5QKDc9zwX/wcKyiGGbcd2yIdqAUYUwj 7ooZnh2FEdES0UrJ52h1eFrvA/bl7+voXbMFpVNLjq9+e8en/irETHghmuyNkuGaxBNy 1K3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=vhT/JRh5Ora1ssBCghfNtXJPPBh/LCkkIILPHCIsWjs=; b=PcqDBiPeHXw33sk3n5qF07QMcWLwSQitv1jU1IGsr0vWb6kLN2Qn40jIEEkzIAd82r SgFayKfTDWJfL+knn77KWPIAF8Lyi0QhgxmO0QWhrhwTzIVh8ENoOGmM18rXx8OmzDCK AZjeTeZ4xLSEFo/vBtbpFKabYi1ymRQYq6wSHXIeCpnFKJD1WekaquN5kNduhd0/qTel UeE0DH1hsnIfVSwIJjUXgyYRWy75s+Lail0b7K9Q1o+F2LIPBg9YLOwTf7CoiM8J49Pp 2zXSvqtwio6uibuNiWBU72M9jLXUZv//RvTEL5mBui9t5KizmhyhNjvQ7LMBaiEiXEzg AfSg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k15si11025039pls.92.2019.02.19.12.05.38; Tue, 19 Feb 2019 12:05:54 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729925AbfBSUEv (ORCPT + 99 others); Tue, 19 Feb 2019 15:04:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49070 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729891AbfBSUEt (ORCPT ); Tue, 19 Feb 2019 15:04:49 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6A42A369A0; Tue, 19 Feb 2019 20:04:48 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-122-134.rdu2.redhat.com [10.10.122.134]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5ABE86013D; Tue, 19 Feb 2019 20:04:45 +0000 (UTC) From: jglisse@redhat.com To: linux-mm@kvack.org, Andrew Morton Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , =?UTF-8?q?Christian=20K=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?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Michal Hocko , Ralph Campbell , John Hubbard , kvm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, linux-fsdevel@vger.kernel.org, Arnd Bergmann Subject: [PATCH v5 1/9] mm/mmu_notifier: helper to test if a range invalidation is blockable Date: Tue, 19 Feb 2019 15:04:22 -0500 Message-Id: <20190219200430.11130-2-jglisse@redhat.com> In-Reply-To: <20190219200430.11130-1-jglisse@redhat.com> References: <20190219200430.11130-1-jglisse@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 19 Feb 2019 20:04:48 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jérôme Glisse 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. Signed-off-by: Jérôme Glisse Cc: Christian König 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čmář 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(+) 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(struct mmu_notifier_range *r, extern void __mmu_notifier_invalidate_range(struct mm_struct *mm, unsigned long start, unsigned long end); +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 mmu_notifier_range *range, #define mmu_notifier_range_init(range, mm, start, end) \ _mmu_notifier_range_init(range, start, end) +static inline bool +mmu_notifier_range_blockable(const struct mmu_notifier_range *range) +{ + return true; +} static inline int mm_has_notifiers(struct mm_struct *mm) { -- 2.17.2