From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Darrick J. Wong" Subject: Re: [PATCH 14/14] mm: turn on vm_fault_t type checking Date: Wed, 16 May 2018 08:08:29 -0700 Message-ID: <20180516150829.GA4904@magnolia> References: <20180516054348.15950-1-hch@lst.de> <20180516054348.15950-15-hch@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Content-Disposition: inline In-Reply-To: <20180516054348.15950-15-hch@lst.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com To: Christoph Hellwig Cc: linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, linux-btrfs@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Matthew Wilcox , linux-mm@kvack.org, ocfs2-devel@oss.oracle.com, Souptick Joarder , linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.org, ceph-devel@vger.kernel.org, linux-ext4@vger.kernel.org, devel@lists.orangefs.org, lustre-devel@lists.lustre.org List-Id: ceph-devel.vger.kernel.org T24gV2VkLCBNYXkgMTYsIDIwMTggYXQgMDc6NDM6NDhBTSArMDIwMCwgQ2hyaXN0b3BoIEhlbGx3 aWcgd3JvdGU6Cj4gU3dpdGNoIHZtX2ZhdWx0X3QgdG8gcG9pbnQgdG8gYW4gdW5zaWduZWQgaW50 IHdpdGggX19i0ZZ0d2lzZSBhbm5vdGF0aW9ucy4KPiBUaGlzIGJvdGggY2F0Y2hlcyBhbnkgb2xk IC0+ZmF1bHQgb3IgLT5wYWdlX21rd3JpdGUgaW5zdGFuY2Ugd2l0aCBwbGFpbgo+IGNvbXBpbGVy IHR5cGUgY2hlY2tpbmcsIGFzIHdlbGwgYXMgZmluZGluZyBtb3JlIGludHJpY2F0ZSBwcm9ibGVt cyB3aXRoCj4gc3BhcnNlLgo+IAo+IFNpZ25lZC1vZmYt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wczovL29zcy5vcmFjbGUuY29tL21haWxtYW4vbGlzdGluZm8vb2NmczIt ZGV2ZWw= From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp2130.oracle.com ([156.151.31.86]:37200 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751647AbeEPPKD (ORCPT ); Wed, 16 May 2018 11:10:03 -0400 Date: Wed, 16 May 2018 08:08:29 -0700 From: "Darrick J. Wong" To: Christoph Hellwig Cc: Souptick Joarder , Matthew Wilcox , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, devel@lists.orangefs.org, ceph-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-mtd@lists.infradead.org, dri-devel@lists.freedesktop.org, lustre-devel@lists.lustre.org, linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org Subject: Re: [PATCH 14/14] mm: turn on vm_fault_t type checking Message-ID: <20180516150829.GA4904@magnolia> References: <20180516054348.15950-1-hch@lst.de> <20180516054348.15950-15-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 In-Reply-To: <20180516054348.15950-15-hch@lst.de> Sender: linux-btrfs-owner@vger.kernel.org List-ID: On Wed, May 16, 2018 at 07:43:48AM +0200, Christoph Hellwig wrote: > Switch vm_fault_t to point to an unsigned int with __bіtwise annotations. > This both catches any old ->fault or ->page_mkwrite instance with plain > compiler type checking, as well as finding more intricate problems with > sparse. > > Signed-off-by: Christoph Hellwig > --- For the iomap and xfs parts, Reviewed-by: Darrick J. Wong That said... > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index 54f1e05ecf3e..da2b77a19911 100644 > --- a/include/linux/mm_types.h > +++ b/include/linux/mm_types.h > @@ -22,7 +22,8 @@ > #endif > #define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1)) > > -typedef int vm_fault_t; > +typedef unsigned __bitwise vm_fault_t; > + > > struct address_space; > struct mem_cgroup; > @@ -619,7 +620,7 @@ struct vm_special_mapping { > * If non-NULL, then this is called to resolve page faults > * on the special mapping. If used, .pages is not checked. > */ > - int (*fault)(const struct vm_special_mapping *sm, > + vm_fault_t (*fault)(const struct vm_special_mapping *sm, Uh, we're changing function signatures /and/ redefinining vm_fault_t? All in the same 90K patch? I /was/ expecting a series of "convert XXXXX and all callers/users" patches followed by a trivial one to switch the definition, not a giant pile of change. FWIW I don't mind so much if you make a patch containing a change for some super-common primitive and a hojillion little diff hunks tree-wide, but only one logical change at a time for a big patch, please... I quite prefer seeing the whole series from start to finish all packaged up in one series, but wow this was overwhelming. :/ --D From mboxrd@z Thu Jan 1 00:00:00 1970 From: Darrick J. Wong Date: Wed, 16 May 2018 08:08:29 -0700 Subject: [lustre-devel] [PATCH 14/14] mm: turn on vm_fault_t type checking In-Reply-To: <20180516054348.15950-15-hch@lst.de> References: <20180516054348.15950-1-hch@lst.de> <20180516054348.15950-15-hch@lst.de> Message-ID: <20180516150829.GA4904@magnolia> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Christoph Hellwig Cc: linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, linux-btrfs@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Matthew Wilcox , linux-mm@kvack.org, ocfs2-devel@oss.oracle.com, Souptick Joarder , linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.org, ceph-devel@vger.kernel.org, linux-ext4@vger.kernel.org, devel@lists.orangefs.org, lustre-devel@lists.lustre.org On Wed, May 16, 2018 at 07:43:48AM +0200, Christoph Hellwig wrote: > Switch vm_fault_t to point to an unsigned int with __b?twise annotations. > This both catches any old ->fault or ->page_mkwrite instance with plain > compiler type checking, as well as finding more intricate problems with > sparse. > > Signed-off-by: Christoph Hellwig > --- For the iomap and xfs parts, Reviewed-by: Darrick J. Wong That said... > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index 54f1e05ecf3e..da2b77a19911 100644 > --- a/include/linux/mm_types.h > +++ b/include/linux/mm_types.h > @@ -22,7 +22,8 @@ > #endif > #define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1)) > > -typedef int vm_fault_t; > +typedef unsigned __bitwise vm_fault_t; > + > > struct address_space; > struct mem_cgroup; > @@ -619,7 +620,7 @@ struct vm_special_mapping { > * If non-NULL, then this is called to resolve page faults > * on the special mapping. If used, .pages is not checked. > */ > - int (*fault)(const struct vm_special_mapping *sm, > + vm_fault_t (*fault)(const struct vm_special_mapping *sm, Uh, we're changing function signatures /and/ redefinining vm_fault_t? All in the same 90K patch? I /was/ expecting a series of "convert XXXXX and all callers/users" patches followed by a trivial one to switch the definition, not a giant pile of change. FWIW I don't mind so much if you make a patch containing a change for some super-common primitive and a hojillion little diff hunks tree-wide, but only one logical change at a time for a big patch, please... I quite prefer seeing the whole series from start to finish all packaged up in one series, but wow this was overwhelming. :/ --D From mboxrd@z Thu Jan 1 00:00:00 1970 From: Darrick J. Wong Date: Wed, 16 May 2018 08:08:29 -0700 Subject: [Ocfs2-devel] [PATCH 14/14] mm: turn on vm_fault_t type checking In-Reply-To: <20180516054348.15950-15-hch@lst.de> References: <20180516054348.15950-1-hch@lst.de> <20180516054348.15950-15-hch@lst.de> Message-ID: <20180516150829.GA4904@magnolia> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Christoph Hellwig Cc: linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, linux-btrfs@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Matthew Wilcox , linux-mm@kvack.org, ocfs2-devel@oss.oracle.com, Souptick Joarder , linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.org, ceph-devel@vger.kernel.org, linux-ext4@vger.kernel.org, devel@lists.orangefs.org, lustre-devel@lists.lustre.org On Wed, May 16, 2018 at 07:43:48AM +0200, Christoph Hellwig wrote: > Switch vm_fault_t to point to an unsigned int with __b?twise annotations. > This both catches any old ->fault or ->page_mkwrite instance with plain > compiler type checking, as well as finding more intricate problems with > sparse. > > Signed-off-by: Christoph Hellwig > --- For the iomap and xfs parts, Reviewed-by: Darrick J. Wong That said... > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index 54f1e05ecf3e..da2b77a19911 100644 > --- a/include/linux/mm_types.h > +++ b/include/linux/mm_types.h > @@ -22,7 +22,8 @@ > #endif > #define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1)) > > -typedef int vm_fault_t; > +typedef unsigned __bitwise vm_fault_t; > + > > struct address_space; > struct mem_cgroup; > @@ -619,7 +620,7 @@ struct vm_special_mapping { > * If non-NULL, then this is called to resolve page faults > * on the special mapping. If used, .pages is not checked. > */ > - int (*fault)(const struct vm_special_mapping *sm, > + vm_fault_t (*fault)(const struct vm_special_mapping *sm, Uh, we're changing function signatures /and/ redefinining vm_fault_t? All in the same 90K patch? I /was/ expecting a series of "convert XXXXX and all callers/users" patches followed by a trivial one to switch the definition, not a giant pile of change. FWIW I don't mind so much if you make a patch containing a change for some super-common primitive and a hojillion little diff hunks tree-wide, but only one logical change at a time for a big patch, please... I quite prefer seeing the whole series from start to finish all packaged up in one series, but wow this was overwhelming. :/ --D From mboxrd@z Thu Jan 1 00:00:00 1970 From: darrick.wong@oracle.com (Darrick J. Wong) Date: Wed, 16 May 2018 08:08:29 -0700 Subject: [PATCH 14/14] mm: turn on vm_fault_t type checking In-Reply-To: <20180516054348.15950-15-hch@lst.de> References: <20180516054348.15950-1-hch@lst.de> <20180516054348.15950-15-hch@lst.de> Message-ID: <20180516150829.GA4904@magnolia> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, May 16, 2018 at 07:43:48AM +0200, Christoph Hellwig wrote: > Switch vm_fault_t to point to an unsigned int with __b?twise annotations. > This both catches any old ->fault or ->page_mkwrite instance with plain > compiler type checking, as well as finding more intricate problems with > sparse. > > Signed-off-by: Christoph Hellwig > --- For the iomap and xfs parts, Reviewed-by: Darrick J. Wong That said... > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index 54f1e05ecf3e..da2b77a19911 100644 > --- a/include/linux/mm_types.h > +++ b/include/linux/mm_types.h > @@ -22,7 +22,8 @@ > #endif > #define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1)) > > -typedef int vm_fault_t; > +typedef unsigned __bitwise vm_fault_t; > + > > struct address_space; > struct mem_cgroup; > @@ -619,7 +620,7 @@ struct vm_special_mapping { > * If non-NULL, then this is called to resolve page faults > * on the special mapping. If used, .pages is not checked. > */ > - int (*fault)(const struct vm_special_mapping *sm, > + vm_fault_t (*fault)(const struct vm_special_mapping *sm, Uh, we're changing function signatures /and/ redefinining vm_fault_t? All in the same 90K patch? I /was/ expecting a series of "convert XXXXX and all callers/users" patches followed by a trivial one to switch the definition, not a giant pile of change. FWIW I don't mind so much if you make a patch containing a change for some super-common primitive and a hojillion little diff hunks tree-wide, but only one logical change at a time for a big patch, please... I quite prefer seeing the whole series from start to finish all packaged up in one series, but wow this was overwhelming. :/ --D From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f198.google.com (mail-qk0-f198.google.com [209.85.220.198]) by kanga.kvack.org (Postfix) with ESMTP id 673BB6B0336 for ; Wed, 16 May 2018 11:08:57 -0400 (EDT) Received: by mail-qk0-f198.google.com with SMTP id a125-v6so996697qkd.4 for ; Wed, 16 May 2018 08:08:57 -0700 (PDT) Received: from userp2130.oracle.com (userp2130.oracle.com. [156.151.31.86]) by mx.google.com with ESMTPS id a11-v6si2842842qtc.235.2018.05.16.08.08.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 May 2018 08:08:56 -0700 (PDT) Date: Wed, 16 May 2018 08:08:29 -0700 From: "Darrick J. Wong" Subject: Re: [PATCH 14/14] mm: turn on vm_fault_t type checking Message-ID: <20180516150829.GA4904@magnolia> References: <20180516054348.15950-1-hch@lst.de> <20180516054348.15950-15-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180516054348.15950-15-hch@lst.de> Sender: owner-linux-mm@kvack.org List-ID: To: Christoph Hellwig Cc: Souptick Joarder , Matthew Wilcox , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, devel@lists.orangefs.org, ceph-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-mtd@lists.infradead.org, dri-devel@lists.freedesktop.org, lustre-devel@lists.lustre.org, linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org On Wed, May 16, 2018 at 07:43:48AM +0200, Christoph Hellwig wrote: > Switch vm_fault_t to point to an unsigned int with __bN?twise annotations. > This both catches any old ->fault or ->page_mkwrite instance with plain > compiler type checking, as well as finding more intricate problems with > sparse. > > Signed-off-by: Christoph Hellwig > --- For the iomap and xfs parts, Reviewed-by: Darrick J. Wong That said... > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index 54f1e05ecf3e..da2b77a19911 100644 > --- a/include/linux/mm_types.h > +++ b/include/linux/mm_types.h > @@ -22,7 +22,8 @@ > #endif > #define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1)) > > -typedef int vm_fault_t; > +typedef unsigned __bitwise vm_fault_t; > + > > struct address_space; > struct mem_cgroup; > @@ -619,7 +620,7 @@ struct vm_special_mapping { > * If non-NULL, then this is called to resolve page faults > * on the special mapping. If used, .pages is not checked. > */ > - int (*fault)(const struct vm_special_mapping *sm, > + vm_fault_t (*fault)(const struct vm_special_mapping *sm, Uh, we're changing function signatures /and/ redefinining vm_fault_t? All in the same 90K patch? I /was/ expecting a series of "convert XXXXX and all callers/users" patches followed by a trivial one to switch the definition, not a giant pile of change. FWIW I don't mind so much if you make a patch containing a change for some super-common primitive and a hojillion little diff hunks tree-wide, but only one logical change at a time for a big patch, please... I quite prefer seeing the whole series from start to finish all packaged up in one series, but wow this was overwhelming. :/ --D