Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3934776imj; Tue, 19 Feb 2019 12:06:04 -0800 (PST) X-Google-Smtp-Source: AHgI3IYpko3f90y1ttGxCVXtZCLIp3UVA03CQ2yzJUk9Vnrr/0hLdzEn8yO9+zTimNaOOKFbD8Gz X-Received: by 2002:a65:63c2:: with SMTP id n2mr15493761pgv.439.1550606764235; Tue, 19 Feb 2019 12:06:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550606764; cv=none; d=google.com; s=arc-20160816; b=zp9Zde7tL4OuifE3QEImWL2c/+6gbaHuMt3IVRJp7KXN0ky3eC61vOZv/BRDM1Twxl c3CFYfF4njA5ZXvrYZsyXMWIRG4P6xwcsA2T+9s4MgZMu5fTOgNIjgNfQAa+TpCUpSda hpzemMEGzl8pDgLuUeGWuGRGy3Ht5WDyM8d/86+Q36lZcvJLNruOZBLQTOBKRLlEhbUc d3P9F1KKIlHClHGzWmAFdKubco+lNNZaAOXSDBHtd9SW2SuixIpJi4j9OcRbTNBJDsU4 DH9hxSVmovQ0wGTa8FsBaAle1ADUaFjdyEwqil92rnppWkIS4H04278ffZRynf8IBunC T5Hw== 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=y4cTz0AvI8I1jPok9kmJHggRtXPyxbatRSaKY8cn6S8=; b=Fb4mDM2h71JNHx8bOAHzfxMZ8dafUqbW5XHsI4KyBqYHZmWrysQz1FslmiTn2B5m33 jbSZTKgLAMMN2ZEe+dPblLk/gz7/AjVP/2ACf+Jeav3qjxBmPplqa0llk3KjYpoLAkN7 hN9aIIHNsyAilxpyGwqRiq6LvkLUvYI1Ns1baK26YNaNEhHBCZjkmKIqTaqrJRbs6ewB DwP4dxufH6fT00I1Tttd47L0blAghDZZaNqMn3kZ8pPbV4noWg95pArCN9hXc9J7BGb8 MqvOZ8Bx2IEoSU/JcOqhjDaOPSR+bzT0p420g5c9AWqppuQCLV//CYE2JmBAI71zpqbs ltlw== 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 d10si17320201pgf.136.2019.02.19.12.05.48; Tue, 19 Feb 2019 12:06:04 -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 S1730005AbfBSUE7 (ORCPT + 99 others); Tue, 19 Feb 2019 15:04:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34840 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729470AbfBSUE5 (ORCPT ); Tue, 19 Feb 2019 15:04:57 -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 04C1DCA1FD; Tue, 19 Feb 2019 20:04:57 +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 8FCED60141; Tue, 19 Feb 2019 20:04:53 +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, Arnd Bergmann Subject: [PATCH v5 3/9] mm/mmu_notifier: convert mmu_notifier_range->blockable to a flags Date: Tue, 19 Feb 2019 15:04:24 -0500 Message-Id: <20190219200430.11130-4-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.38]); Tue, 19 Feb 2019 20:04:57 +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 Use an unsigned field for flags other than blockable and convert the blockable field to be one of those 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: Arnd Bergmann --- include/linux/mmu_notifier.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index e630def131ce..c8672c366f67 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h @@ -25,11 +25,13 @@ struct mmu_notifier_mm { spinlock_t lock; }; +#define MMU_NOTIFIER_RANGE_BLOCKABLE (1 << 0) + struct mmu_notifier_range { struct mm_struct *mm; unsigned long start; unsigned long end; - bool blockable; + unsigned flags; }; struct mmu_notifier_ops { @@ -229,7 +231,7 @@ extern void __mmu_notifier_invalidate_range(struct mm_struct *mm, static inline bool mmu_notifier_range_blockable(const struct mmu_notifier_range *range) { - return range->blockable; + return (range->flags & MMU_NOTIFIER_RANGE_BLOCKABLE); } static inline void mmu_notifier_release(struct mm_struct *mm) @@ -275,7 +277,7 @@ static inline void mmu_notifier_invalidate_range_start(struct mmu_notifier_range *range) { if (mm_has_notifiers(range->mm)) { - range->blockable = true; + range->flags |= MMU_NOTIFIER_RANGE_BLOCKABLE; __mmu_notifier_invalidate_range_start(range); } } @@ -284,7 +286,7 @@ static inline int mmu_notifier_invalidate_range_start_nonblock(struct mmu_notifier_range *range) { if (mm_has_notifiers(range->mm)) { - range->blockable = false; + range->flags &= ~MMU_NOTIFIER_RANGE_BLOCKABLE; return __mmu_notifier_invalidate_range_start(range); } return 0; @@ -331,6 +333,7 @@ static inline void mmu_notifier_range_init(struct mmu_notifier_range *range, range->mm = mm; range->start = start; range->end = end; + range->flags = 0; } #define ptep_clear_flush_young_notify(__vma, __address, __ptep) \ -- 2.17.2