Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp1784445imc; Fri, 22 Feb 2019 11:06:31 -0800 (PST) X-Google-Smtp-Source: AHgI3IaADGI4bWlEfbPea1Th+HaqHeO/Tn3sFX7b0+yZsuY8YcPl2PD1wmlR8zXsbiaPWHe0rl00 X-Received: by 2002:a63:ce:: with SMTP id 197mr5341930pga.212.1550862391570; Fri, 22 Feb 2019 11:06:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550862391; cv=none; d=google.com; s=arc-20160816; b=aOBzigJyqDn5plVemKrIUFO+N4QQg4cz7cSVGdCP6jivy1F/Fy6E6lpwGm0dFGCajM 8PwDA+BKpKpDzlnDxNMM//LvzvxkJE9UzZTuMWUWIOfuqaUBckSAN+UvlJwVtFRtBzzK Ay+T1kPkoz9vIBIbFqTYz1fZB2E4JbmW9D9AMYYYWACyIDIGy/9OHMcjv7dh/adGBMZJ mT4G0HyRsp6/yTCfKSlklEMq0NJe5X7pQc9mje7TYG35X/pJqfxheRwH5c70GTf1DpL8 0advtp/g3k1px0K4qIgxM6li3kBTA6xbztOJJY65E4nFVc60rAnMX7AaP59v26itAnkS wrPg== 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=IFpaaIptLrwQE87JJJzJIYC6OGivJZKshlLacnhoUH0=; b=genMm4/55FaPgQAnAW9OenY3/ZCTiF4jh9vS5tg7TJyNY1Phdb014xpenfJTXzo/Op TRXzQSlXkD1fJxw/pj6xkbhcCxPjmOZLr8QlVIh9Ky83AjfN5qlSFs+DMXj+5BFtd/oY URp74lQNDnRzUm0YXl/lI+gvzxoHP9bEQZVQXNQFfWLDrXUe/z/eYL0eM1KsmF12Jusg ouUrqXoW7uSTgbxD0m7G5/bkKYU6sfkzd6AqfN/boKCf34w61e3QSZlxLK7Jw8fBdO0f js6qy4fffngaUnLXlrOxL7CgLNlyHvQ0WbwqFEs9SBpG6ghXKieoOjCAE1T/caQkKxj2 5QcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=m7owq4vS; 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 k22si1954692pfi.256.2019.02.22.11.06.15; Fri, 22 Feb 2019 11:06:31 -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=m7owq4vS; 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 S1726768AbfBVTEH (ORCPT + 99 others); Fri, 22 Feb 2019 14:04:07 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:4605 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725878AbfBVTEG (ORCPT ); Fri, 22 Feb 2019 14:04:06 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 22 Feb 2019 11:04:11 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Fri, 22 Feb 2019 11:04:05 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Fri, 22 Feb 2019 11:04:05 -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:04:04 +0000 Subject: Re: [PATCH v5 3/9] mm/mmu_notifier: convert mmu_notifier_range->blockable to a flags 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-4-jglisse@redhat.com> From: Ralph Campbell Message-ID: Date: Fri, 22 Feb 2019 11:04:04 -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-4-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=1550862251; bh=IFpaaIptLrwQE87JJJzJIYC6OGivJZKshlLacnhoUH0=; 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=m7owq4vS//y5MpqMTiKuT6s5znD26AjJqrf0Rv/92Dcg3Ymg5WDaEgE2Yg2S/8jGS frqhi2qWqvcWIflCXCpUTQl2pUUleboeVZ54BQRNQff/ptGzMB59v1o1mxcDLOPjS/ lfxfL7JTJQNDd34SPJOHhYSTc6QfJ9nRyD9I2JGJ/pSnISg2VxG1TjZ4azUTERYsBX aSkLuendkmUUNBqVHvLhqoaLHXs9rzjrxIlRlLguIvbwG78XtpgjXvxa6QbEdfWbXh L2eya6zWp7HS71dmdU9oAN0ac+Og7tEbq32y5w58CWiA8hpx5ouuUpFR5gpkIrH/Ni hNcbp/rT/IwFw== 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 > Use an unsigned field for flags other than blockable and convert > the blockable field to be one of those 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: Arnd Bergmann > --- > include/linux/mmu_notifier.h | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) >=20 > 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; > }; > =20 > +#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; > }; > =20 > 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); > } > =20 > 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 =3D true; > + range->flags |=3D 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 =3D false; > + range->flags &=3D ~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 =3D mm; > range->start =3D start; > range->end =3D end; > + range->flags =3D 0; > } > =20 > #define ptep_clear_flush_young_notify(__vma, __address, __ptep) \ >=20 Reviewed-by: Ralph Campbell