Linux RAID subsystem development
 help / color / mirror / Atom feed
* [PATCH] imsm: count arrays under VMD HBAs correctly
From: Alexey Obitotskiy @ 2017-01-09 12:12 UTC (permalink / raw)
  To: linux-raid; +Cc: Jes.Sorensen

OROM defines maximum number of arrays supported. On array creation mdadm
checks if number of arrays doesn't exceed that limit, however it is not
calculated correctly for VMD now.

The current code performs a lookup of HBA using the id. VMD HBAs have
the same id so each lookup returns the same structure (first
encountered). Take a different approach for VMD HBAs. As id is not
unique and cannot be used for lookups, iterate over all VMD HBAs and
compare both id and HBA path.

Signed-off-by: Alexey Obitotskiy <aleksey.obitotskiy@intel.com>
---
 platform-intel.c | 10 ++++++++++
 platform-intel.h |  1 +
 super-intel.c    | 48 ++++++++++++++++++++++++++++++++++++------------
 3 files changed, 47 insertions(+), 12 deletions(-)

diff --git a/platform-intel.c b/platform-intel.c
index c60fd9e..72a4f19 100644
--- a/platform-intel.c
+++ b/platform-intel.c
@@ -178,6 +178,16 @@ struct sys_dev *device_by_id(__u16 device_id)
 	return NULL;
 }
 
+struct sys_dev *device_by_id_and_path(__u16 device_id, const char *path)
+{
+	struct sys_dev *iter;
+
+	for (iter = intel_devices; iter != NULL; iter = iter->next)
+		if ((iter->dev_id == device_id) && strstr(iter->path, path))
+			return iter;
+	return NULL;
+}
+
 static int devpath_to_ll(const char *dev_path, const char *entry, unsigned long long *val)
 {
 	char path[strlen(dev_path) + strlen(entry) + 2];
diff --git a/platform-intel.h b/platform-intel.h
index a8ae85f..4b4e67f 100644
--- a/platform-intel.h
+++ b/platform-intel.h
@@ -244,4 +244,5 @@ const char *get_sys_dev_type(enum sys_dev_type);
 const struct orom_entry *get_orom_entry_by_device_id(__u16 dev_id);
 const struct imsm_orom *get_orom_by_device_id(__u16 device_id);
 struct sys_dev *device_by_id(__u16 device_id);
+struct sys_dev *device_by_id_and_path(__u16 device_id, const char *path);
 char *vmd_domain_to_controller(struct sys_dev *hba, char *buf);
diff --git a/super-intel.c b/super-intel.c
index 0407d43..93cea8c 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -6475,20 +6475,20 @@ count_volumes_list(struct md_list *devlist, char *homehost,
 	return count;
 }
 
-static int
-count_volumes(struct intel_hba *hba, int dpa, int verbose)
+static int __count_volumes(char *hba_path, int dpa, int verbose,
+			   int cmp_hba_path)
 {
 	struct sys_dev *idev, *intel_devices = find_intel_devices();
 	int count = 0;
 	const struct orom_entry *entry;
 	struct devid_list *dv, *devid_list;
 
-	if (!hba || !hba->path)
+	if (!hba_path)
 		return 0;
 
 	for (idev = intel_devices; idev; idev = idev->next) {
-		if (strstr(idev->path, hba->path))
-				break;
+		if (strstr(idev->path, hba_path))
+			break;
 	}
 
 	if (!idev || !idev->dev_id)
@@ -6502,22 +6502,28 @@ count_volumes(struct intel_hba *hba, int dpa, int verbose)
 	devid_list = entry->devid_list;
 	for (dv = devid_list; dv; dv = dv->next) {
 		struct md_list *devlist;
-		struct sys_dev *device = device_by_id(dv->devid);
-		char *hba_path;
+		struct sys_dev *device = NULL;
+		char *hpath;
 		int found = 0;
 
+		if (cmp_hba_path)
+			device = device_by_id_and_path(dv->devid, hba_path);
+		else
+			device = device_by_id(dv->devid);
+
 		if (device)
-			hba_path = device->path;
+			hpath = device->path;
 		else
 			return 0;
 
-		devlist = get_devices(hba_path);
+		devlist = get_devices(hpath);
 		/* if no intel devices return zero volumes */
 		if (devlist == NULL)
 			return 0;
 
-		count += active_arrays_by_format("imsm", hba_path, &devlist, dpa, verbose);
-		dprintf("path: %s active arrays: %d\n", hba_path, count);
+		count += active_arrays_by_format("imsm", hpath, &devlist, dpa,
+						 verbose);
+		dprintf("path: %s active arrays: %d\n", hpath, count);
 		if (devlist == NULL)
 			return 0;
 		do  {
@@ -6529,7 +6535,7 @@ count_volumes(struct intel_hba *hba, int dpa, int verbose)
 			dprintf("found %d count: %d\n", found, count);
 		} while (found);
 
-		dprintf("path: %s total number of volumes: %d\n", hba_path, count);
+		dprintf("path: %s total number of volumes: %d\n", hpath, count);
 
 		while (devlist) {
 			struct md_list *dv = devlist;
@@ -6541,6 +6547,24 @@ count_volumes(struct intel_hba *hba, int dpa, int verbose)
 	return count;
 }
 
+static int count_volumes(struct intel_hba *hba, int dpa, int verbose)
+{
+	if (!hba)
+		return 0;
+	if (hba->type == SYS_DEV_VMD) {
+		struct sys_dev *dev;
+		int count = 0;
+
+		for (dev = find_intel_devices(); dev; dev = dev->next) {
+			if (dev->type == SYS_DEV_VMD)
+				count += __count_volumes(dev->path, dpa,
+							 verbose, 1);
+		}
+		return count;
+	}
+	return __count_volumes(hba->path, dpa, verbose, 0);
+}
+
 static int imsm_default_chunk(const struct imsm_orom *orom)
 {
 	/* up to 512 if the plaform supports it, otherwise the platform max.
-- 
2.7.4


^ permalink raw reply related

* Re: [PATCH v2 7/7] uapi: export all headers under uapi directories
From: Russell King - ARM Linux @ 2017-01-09 12:01 UTC (permalink / raw)
  To: Nicolas Dichtel
  Cc: arnd-r2nGTMty4D4, linux-mips-6z/3iImG2C8G8FEW9MqTrA,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-ia64-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA, airlied-cv59FeDIM0c,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	sparclinux-u79uwXL29TY76Z2rM5mHXA,
	linux-arch-u79uwXL29TY76Z2rM5mHXA,
	linux-s390-u79uwXL29TY76Z2rM5mHXA,
	linux-am33-list-H+wXaHxf7aLQT0dZR+AlfA,
	linux-c6x-dev-jPsnJVOj+W6hPH1hqNUYSQ,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	linux-hexagon-u79uwXL29TY76Z2rM5mHXA,
	linux-sh-u79uwXL29TY76Z2rM5mHXA, coreteam-Cap9r6Oaw4JrovVCs/uTlw,
	fcoe-devel-s9riP+hp16TNLxjTenLetw,
	xen-devel-GuqFBffKawtpuQazS67q72D2FQJk+8+b,
	linux-snps-arc-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-media-u79uwXL29TY76Z2rM5mHXA,
	uclinux-h8-devel-5NWGOfrQmneRv+LV9MX5uooqe+aC9MnS,
	linux-xtensa-PjhNF2WwrV/0Sa2dR60CXw,
	linux-kbuild-u79uwXL29TY76Z2rM5mHXA,
	adi-buildroot-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-raid-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1483695839-18660-8-git-send-email-nicolas.dichtel-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>

On Fri, Jan 06, 2017 at 10:43:59AM +0100, Nicolas Dichtel wrote:
> diff --git a/arch/arm/include/uapi/asm/Kbuild b/arch/arm/include/uapi/asm/Kbuild
> index 46a76cd6acb6..607f702c2d62 100644
> --- a/arch/arm/include/uapi/asm/Kbuild
> +++ b/arch/arm/include/uapi/asm/Kbuild
> @@ -1,23 +1,6 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
>  
> -header-y += auxvec.h
> -header-y += byteorder.h
> -header-y += fcntl.h
> -header-y += hwcap.h
> -header-y += ioctls.h
> -header-y += kvm_para.h
> -header-y += mman.h
> -header-y += perf_regs.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += setup.h
> -header-y += sigcontext.h
> -header-y += signal.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += unistd.h
>  genhdr-y += unistd-common.h
>  genhdr-y += unistd-oabi.h
>  genhdr-y += unistd-eabi.h

Acked-by: Russell King <rmk+kernel-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply

* Re: [PATCH v2 1/7] arm: put types.h in uapi
From: Russell King - ARM Linux @ 2017-01-09 12:00 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linuxppc-dev, linux-kbuild, linux-mips, alsa-devel, linux-ia64,
	linux-doc, airlied, linux-fbdev, dri-devel, linux-mtd, sparclinux,
	linux-arch, linux-s390, linux-am33-list, linux-c6x-dev,
	linux-rdma, linux-hexagon, linux-sh, coreteam, fcoe-devel,
	xen-devel, linux-snps-arc, linux-media, uclinux-h8-devel,
	adi-buildroot-devel, linux-raid, linux-m68k
In-Reply-To: <1990589.0aJHWbJK4F@wuerfel>

On Mon, Jan 09, 2017 at 12:33:02PM +0100, Arnd Bergmann wrote:
> On Friday, January 6, 2017 10:43:53 AM CET Nicolas Dichtel wrote:
> > 
> > diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h
> > index a53cdb8f068c..c48fee3d7b3b 100644
> > --- a/arch/arm/include/asm/types.h
> > +++ b/arch/arm/include/asm/types.h
> > @@ -1,40 +1,6 @@
> >  #ifndef _ASM_TYPES_H
> >  #define _ASM_TYPES_H
> >  
> > -#include <asm-generic/int-ll64.h>
> ...
> > -#define __UINTPTR_TYPE__       unsigned long
> > -#endif
> > +#include <uapi/asm/types.h>
> >  
> >  #endif /* _ASM_TYPES_H */
> > 
> 
> Moving the file is correct as far as I can tell, but the extra
> #include is not necessary here, as the kernel will automatically
> search both arch/arm/include/ and arch/arm/include/uapi/.

Indeed, I'd like to see the include/asm file gone.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply

* Re: [PATCH v2 0/7] uapi: export all headers under uapi directories
From: Arnd Bergmann @ 2017-01-09 11:33 UTC (permalink / raw)
  To: linuxppc-dev, linux-kbuild
  Cc: linux-mips, alsa-devel, linux-ia64, linux-doc, airlied,
	linux-fbdev, dri-devel, linux-mtd, sparclinux, linux-arch,
	linux-s390, linux-am33-list, linux-c6x-dev, linux-rdma,
	linux-hexagon, linux-sh, coreteam, fcoe-devel, xen-devel,
	linux-snps-arc, linux-media, uclinux-h8-devel,
	adi-buildroot-devel, linux-raid, linux-m68k, openrisc,
	Nicolas Dichtel, linux-metag, linux-arm-kernel
In-Reply-To: <1483695839-18660-1-git-send-email-nicolas.dichtel@6wind.com>

On Friday, January 6, 2017 10:43:52 AM CET Nicolas Dichtel wrote:
> Here is the v2 of this series. The first 5 patches are just cleanup: some
> exported headers were still under a non-uapi directory.

Since this is meant as a cleanup, I commented on this to point out a cleaner
way to do the same.

> The patch 6 was spotted by code review: there is no in-tree user of this
> functionality.
> The last patch remove the use of header-y. Now all files under an uapi
> directory are exported.

Very nice!

> asm is a bit special, most of architectures export asm/<arch>/include/uapi/asm
> only, but there is two exceptions:
>  - cris which exports arch/cris/include/uapi/arch-v[10|32];

This is interesting, though not your problem. Maybe someone who understands
cris better can comment on this: How is the decision made about which of
the arch/user.h headers gets used? I couldn't find that in the sources,
but it appears to be based on kernel compile-time settings, which is
wrong for user space header files that should be independent of the kernel
config.

>  - tile which exports arch/tile/include/uapi/arch.
> Because I don't know if the output of 'make headers_install_all' can be changed,
> I introduce subdir-y in Kbuild file. The headers_install_all target copies all
> asm/<arch>/include/uapi/asm to usr/include/asm-<arch> but
> arch/cris/include/uapi/arch-v[10|32] and arch/tile/include/uapi/arch are not
> prefixed (they are put asis in usr/include/). If it's acceptable to modify the
> output of 'make headers_install_all' to export asm headers in
> usr/include/asm-<arch>/asm, then I could remove this new subdir-y and exports
> everything under arch/<arch>/include/uapi/.

I don't know if anyone still uses "make headers_install_all", I suspect
distros these days all use "make headers_install", so it probably
doesn't matter much.

In case of cris, it should be easy enough to move all the contents of the
uapi/arch-*/*.h headers into the respective uapi/asm/*.h headers, they
only seem to be referenced from there.

For tile, I suspect that would not work as the arch/*.h headers are
apparently defined as interfaces for both user space and kernel.

> Note also that exported files for asm are a mix of files listed by:
>  - include/uapi/asm-generic/Kbuild.asm;
>  - arch/x86/include/uapi/asm/Kbuild;
>  - arch/x86/include/asm/Kbuild.
> This complicates a lot the processing (arch/x86/include/asm/Kbuild is also
> used by scripts/Makefile.asm-generic).
> 
> This series has been tested with a 'make headers_install' on x86 and a
> 'make headers_install_all'. I've checked the result of both commands.
> 
> This patch is built against linus tree. I don't know if it should be
> made against antoher tree.

The series should probably get merged through the kbuild tree, but testing
it on mainline is fine here.

	Arnd

^ permalink raw reply

* Re: [PATCH v2 3/7] nios2: put setup.h in uapi
From: Arnd Bergmann @ 2017-01-09 11:33 UTC (permalink / raw)
  To: linuxppc-dev, linux-kbuild
  Cc: Nicolas Dichtel, linux-mips, alsa-devel, linux-ia64, linux-doc,
	airlied, linux-fbdev, dri-devel, linux-mtd, sparclinux,
	linux-arch, linux-s390, linux-am33-list, linux-c6x-dev,
	linux-rdma, linux-hexagon, linux-sh, coreteam, fcoe-devel,
	xen-devel, linux-snps-arc, linux-media, uclinux-h8-devel,
	adi-buildroot-devel, linux-raid, linux-m68k
In-Reply-To: <1483695839-18660-4-git-send-email-nicolas.dichtel@6wind.com>

On Friday, January 6, 2017 10:43:55 AM CET Nicolas Dichtel wrote:

> diff --git a/arch/nios2/include/uapi/asm/setup.h b/arch/nios2/include/uapi/asm/setup.h
> new file mode 100644
> index 000000000000..8d8285997ba8
> --- /dev/null
> +++ b/arch/nios2/include/uapi/asm/setup.h
> @@ -0,0 +1,6 @@
> +#ifndef _UAPI_ASM_NIOS2_SETUP_H
> +#define _UAPI_ASM_NIOS2_SETUP_H
> +
> +#include <asm-generic/setup.h>
> +
> +#endif /* _UAPI_ASM_NIOS2_SETUP_H */
> 

This one is only a redirect to an asm-generic header, so it can be
removed completely and replaced with a line in the 
arch/nios2/include/uapi/asm/ file:

generic-y += setup.h

	Arnd

^ permalink raw reply

* Re: [PATCH v2 1/7] arm: put types.h in uapi
From: Arnd Bergmann @ 2017-01-09 11:33 UTC (permalink / raw)
  To: linuxppc-dev, linux-kbuild
  Cc: linux-mips, alsa-devel, linux-ia64, linux-doc, airlied,
	linux-fbdev, dri-devel, linux-mtd, sparclinux, linux-arch,
	linux-s390, linux-am33-list, linux-c6x-dev, linux-rdma,
	linux-hexagon, linux-sh, coreteam, fcoe-devel, xen-devel,
	linux-snps-arc, linux-media, uclinux-h8-devel,
	adi-buildroot-devel, linux-raid, linux-m68k, openrisc,
	Nicolas Dichtel, linux-metag, linux-arm-kernel
In-Reply-To: <1483695839-18660-2-git-send-email-nicolas.dichtel@6wind.com>

On Friday, January 6, 2017 10:43:53 AM CET Nicolas Dichtel wrote:
> 
> diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h
> index a53cdb8f068c..c48fee3d7b3b 100644
> --- a/arch/arm/include/asm/types.h
> +++ b/arch/arm/include/asm/types.h
> @@ -1,40 +1,6 @@
>  #ifndef _ASM_TYPES_H
>  #define _ASM_TYPES_H
>  
> -#include <asm-generic/int-ll64.h>
...
> -#define __UINTPTR_TYPE__       unsigned long
> -#endif
> +#include <uapi/asm/types.h>
>  
>  #endif /* _ASM_TYPES_H */
> 

Moving the file is correct as far as I can tell, but the extra
#include is not necessary here, as the kernel will automatically
search both arch/arm/include/ and arch/arm/include/uapi/.

The same applies to patches 2 and 4.

	Arnd

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply

* Re: [PATCH v2 7/7] uapi: export all headers under uapi directories
From: Daniel Vetter @ 2017-01-09 10:01 UTC (permalink / raw)
  To: Nicolas Dichtel
  Cc: arnd, mmarek, linux-kbuild, linux-doc, linux-kernel, linux-alpha,
	linux-snps-arc, linux-arm-kernel, adi-buildroot-devel,
	linux-c6x-dev, linux-cris-kernel, uclinux-h8-devel, linux-hexagon,
	linux-ia64, linux-m68k, linux-metag, linux-mips, linux-am33-list,
	nios2-dev, openrisc, linux-parisc, linuxppc-dev, linux-s390,
	linux-sh, sparclinux, linux-xtensa
In-Reply-To: <1483695839-18660-8-git-send-email-nicolas.dichtel@6wind.com>

On Fri, Jan 06, 2017 at 10:43:59AM +0100, Nicolas Dichtel wrote:
> Regularly, when a new header is created in include/uapi/, the developer
> forgets to add it in the corresponding Kbuild file. This error is usually
> detected after the release is out.
> 
> In fact, all headers under uapi directories should be exported, thus it's
> useless to have an exhaustive list.
> 
> After this patch, the following files, which were not exported, are now
> exported (with make headers_install_all):
> asm-unicore32/shmparam.h
> asm-unicore32/ucontext.h
> asm-hexagon/shmparam.h
> asm-mips/ucontext.h
> asm-mips/hwcap.h
> asm-mips/reg.h
> drm/vgem_drm.h
> drm/armada_drm.h
> drm/omap_drm.h
> drm/etnaviv_drm.h
> asm-tile/shmparam.h
> asm-blackfin/shmparam.h
> asm-blackfin/ucontext.h
> asm-powerpc/perf_regs.h
> rdma/qedr-abi.h
> asm-parisc/kvm_para.h
> asm-openrisc/shmparam.h
> asm-nios2/kvm_para.h
> asm-nios2/ucontext.h
> asm-sh/kvm_para.h
> asm-sh/ucontext.h
> asm-xtensa/kvm_para.h
> asm-avr32/kvm_para.h
> asm-m32r/kvm_para.h
> asm-h8300/shmparam.h
> asm-h8300/ucontext.h
> asm-metag/kvm_para.h
> asm-metag/shmparam.h
> asm-metag/ucontext.h
> asm-m68k/kvm_para.h
> asm-m68k/shmparam.h
> linux/bcache.h
> linux/kvm.h
> linux/kvm_para.h
> linux/kfd_ioctl.h
> linux/cryptouser.h
> linux/kcm.h
> linux/kcov.h
> linux/seg6_iptunnel.h
> linux/stm.h
> linux/genwqe
> linux/genwqe/.install
> linux/genwqe/genwqe_card.h
> linux/genwqe/..install.cmd
> linux/seg6.h
> linux/cifs
> linux/cifs/.install
> linux/cifs/cifs_mount.h
> linux/cifs/..install.cmd
> linux/auto_dev-ioctl.h
> 
> Thanks to Julien Floret <julien.floret@6wind.com> for the tip to get all
> subdirs with a pure makefile command.
> 
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Makes lots of sense.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  Documentation/kbuild/makefiles.txt          |  41 ++-
>  arch/alpha/include/uapi/asm/Kbuild          |  41 ---
>  arch/arc/include/uapi/asm/Kbuild            |   3 -
>  arch/arm/include/uapi/asm/Kbuild            |  17 -
>  arch/arm64/include/uapi/asm/Kbuild          |  18 --
>  arch/avr32/include/uapi/asm/Kbuild          |  20 --
>  arch/blackfin/include/uapi/asm/Kbuild       |  17 -
>  arch/c6x/include/uapi/asm/Kbuild            |   8 -
>  arch/cris/include/uapi/arch-v10/arch/Kbuild |   5 -
>  arch/cris/include/uapi/arch-v32/arch/Kbuild |   3 -
>  arch/cris/include/uapi/asm/Kbuild           |  43 +--
>  arch/frv/include/uapi/asm/Kbuild            |  33 --
>  arch/h8300/include/uapi/asm/Kbuild          |  28 --
>  arch/hexagon/include/asm/Kbuild             |   3 -
>  arch/hexagon/include/uapi/asm/Kbuild        |  13 -
>  arch/ia64/include/uapi/asm/Kbuild           |  45 ---
>  arch/m32r/include/uapi/asm/Kbuild           |  31 --
>  arch/m68k/include/uapi/asm/Kbuild           |  24 --
>  arch/metag/include/uapi/asm/Kbuild          |   8 -
>  arch/microblaze/include/uapi/asm/Kbuild     |  32 --
>  arch/mips/include/uapi/asm/Kbuild           |  37 ---
>  arch/mn10300/include/uapi/asm/Kbuild        |  32 --
>  arch/nios2/include/uapi/asm/Kbuild          |   4 +-
>  arch/openrisc/include/asm/Kbuild            |   3 -
>  arch/openrisc/include/uapi/asm/Kbuild       |   8 -
>  arch/parisc/include/uapi/asm/Kbuild         |  28 --
>  arch/powerpc/include/uapi/asm/Kbuild        |  45 ---
>  arch/s390/include/uapi/asm/Kbuild           |  52 ---
>  arch/score/include/asm/Kbuild               |   4 -
>  arch/score/include/uapi/asm/Kbuild          |  32 --
>  arch/sh/include/uapi/asm/Kbuild             |  23 --
>  arch/sparc/include/uapi/asm/Kbuild          |  48 ---
>  arch/tile/include/asm/Kbuild                |   3 -
>  arch/tile/include/uapi/arch/Kbuild          |  17 -
>  arch/tile/include/uapi/asm/Kbuild           |  19 +-
>  arch/unicore32/include/uapi/asm/Kbuild      |   6 -
>  arch/x86/include/uapi/asm/Kbuild            |  59 ----
>  arch/xtensa/include/uapi/asm/Kbuild         |  23 --
>  include/Kbuild                              |   2 -
>  include/asm-generic/Kbuild.asm              |   1 -
>  include/scsi/fc/Kbuild                      |   0
>  include/uapi/Kbuild                         |  15 -
>  include/uapi/asm-generic/Kbuild             |  36 ---
>  include/uapi/asm-generic/Kbuild.asm         |  62 ++--
>  include/uapi/drm/Kbuild                     |  22 --
>  include/uapi/linux/Kbuild                   | 482 ----------------------------
>  include/uapi/linux/android/Kbuild           |   2 -
>  include/uapi/linux/byteorder/Kbuild         |   3 -
>  include/uapi/linux/caif/Kbuild              |   3 -
>  include/uapi/linux/can/Kbuild               |   6 -
>  include/uapi/linux/dvb/Kbuild               |   9 -
>  include/uapi/linux/hdlc/Kbuild              |   2 -
>  include/uapi/linux/hsi/Kbuild               |   2 -
>  include/uapi/linux/iio/Kbuild               |   3 -
>  include/uapi/linux/isdn/Kbuild              |   2 -
>  include/uapi/linux/mmc/Kbuild               |   2 -
>  include/uapi/linux/netfilter/Kbuild         |  89 -----
>  include/uapi/linux/netfilter/ipset/Kbuild   |   5 -
>  include/uapi/linux/netfilter_arp/Kbuild     |   3 -
>  include/uapi/linux/netfilter_bridge/Kbuild  |  18 --
>  include/uapi/linux/netfilter_ipv4/Kbuild    |  10 -
>  include/uapi/linux/netfilter_ipv6/Kbuild    |  13 -
>  include/uapi/linux/nfsd/Kbuild              |   6 -
>  include/uapi/linux/raid/Kbuild              |   3 -
>  include/uapi/linux/spi/Kbuild               |   2 -
>  include/uapi/linux/sunrpc/Kbuild            |   2 -
>  include/uapi/linux/tc_act/Kbuild            |  15 -
>  include/uapi/linux/tc_ematch/Kbuild         |   5 -
>  include/uapi/linux/usb/Kbuild               |  12 -
>  include/uapi/linux/wimax/Kbuild             |   2 -
>  include/uapi/misc/Kbuild                    |   2 -
>  include/uapi/mtd/Kbuild                     |   6 -
>  include/uapi/rdma/Kbuild                    |  18 --
>  include/uapi/rdma/hfi/Kbuild                |   2 -
>  include/uapi/scsi/Kbuild                    |   6 -
>  include/uapi/scsi/fc/Kbuild                 |   5 -
>  include/uapi/sound/Kbuild                   |  16 -
>  include/uapi/video/Kbuild                   |   4 -
>  include/uapi/xen/Kbuild                     |   5 -
>  include/video/Kbuild                        |   0
>  scripts/Makefile.headersinst                |  39 +--
>  81 files changed, 73 insertions(+), 1745 deletions(-)
>  delete mode 100644 arch/cris/include/uapi/arch-v10/arch/Kbuild
>  delete mode 100644 arch/cris/include/uapi/arch-v32/arch/Kbuild
>  delete mode 100644 arch/tile/include/uapi/arch/Kbuild
>  delete mode 100644 include/Kbuild
>  delete mode 100644 include/asm-generic/Kbuild.asm
>  delete mode 100644 include/scsi/fc/Kbuild
>  delete mode 100644 include/uapi/Kbuild
>  delete mode 100644 include/uapi/asm-generic/Kbuild
>  delete mode 100644 include/uapi/drm/Kbuild
>  delete mode 100644 include/uapi/linux/Kbuild
>  delete mode 100644 include/uapi/linux/android/Kbuild
>  delete mode 100644 include/uapi/linux/byteorder/Kbuild
>  delete mode 100644 include/uapi/linux/caif/Kbuild
>  delete mode 100644 include/uapi/linux/can/Kbuild
>  delete mode 100644 include/uapi/linux/dvb/Kbuild
>  delete mode 100644 include/uapi/linux/hdlc/Kbuild
>  delete mode 100644 include/uapi/linux/hsi/Kbuild
>  delete mode 100644 include/uapi/linux/iio/Kbuild
>  delete mode 100644 include/uapi/linux/isdn/Kbuild
>  delete mode 100644 include/uapi/linux/mmc/Kbuild
>  delete mode 100644 include/uapi/linux/netfilter/Kbuild
>  delete mode 100644 include/uapi/linux/netfilter/ipset/Kbuild
>  delete mode 100644 include/uapi/linux/netfilter_arp/Kbuild
>  delete mode 100644 include/uapi/linux/netfilter_bridge/Kbuild
>  delete mode 100644 include/uapi/linux/netfilter_ipv4/Kbuild
>  delete mode 100644 include/uapi/linux/netfilter_ipv6/Kbuild
>  delete mode 100644 include/uapi/linux/nfsd/Kbuild
>  delete mode 100644 include/uapi/linux/raid/Kbuild
>  delete mode 100644 include/uapi/linux/spi/Kbuild
>  delete mode 100644 include/uapi/linux/sunrpc/Kbuild
>  delete mode 100644 include/uapi/linux/tc_act/Kbuild
>  delete mode 100644 include/uapi/linux/tc_ematch/Kbuild
>  delete mode 100644 include/uapi/linux/usb/Kbuild
>  delete mode 100644 include/uapi/linux/wimax/Kbuild
>  delete mode 100644 include/uapi/misc/Kbuild
>  delete mode 100644 include/uapi/mtd/Kbuild
>  delete mode 100644 include/uapi/rdma/Kbuild
>  delete mode 100644 include/uapi/rdma/hfi/Kbuild
>  delete mode 100644 include/uapi/scsi/Kbuild
>  delete mode 100644 include/uapi/scsi/fc/Kbuild
>  delete mode 100644 include/uapi/sound/Kbuild
>  delete mode 100644 include/uapi/video/Kbuild
>  delete mode 100644 include/uapi/xen/Kbuild
>  delete mode 100644 include/video/Kbuild
> 
> diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
> index 37b525d329ae..53e31061ff18 100644
> --- a/Documentation/kbuild/makefiles.txt
> +++ b/Documentation/kbuild/makefiles.txt
> @@ -44,7 +44,7 @@ This document describes the Linux kernel Makefiles.
>  	   --- 6.11 Post-link pass
>  
>  	=== 7 Kbuild syntax for exported headers
> -		--- 7.1 header-y
> +		--- 7.1 subdir-y
>  		--- 7.2 genhdr-y
>  		--- 7.3 generic-y
>  		--- 7.4 generated-y
> @@ -1235,7 +1235,7 @@ When kbuild executes, the following steps are followed (roughly):
>  	that may be shared between individual architectures.
>  	The recommended approach how to use a generic header file is
>  	to list the file in the Kbuild file.
> -	See "7.4 generic-y" for further info on syntax etc.
> +	See "7.3 generic-y" for further info on syntax etc.
>  
>  --- 6.11 Post-link pass
>  
> @@ -1262,37 +1262,36 @@ The pre-processing does:
>  - drop include of compiler.h
>  - drop all sections that are kernel internal (guarded by ifdef __KERNEL__)
>  
> -Each relevant directory contains a file name "Kbuild" which specifies the
> -headers to be exported.
> +All headers under include/uapi/, include/generated/uapi/,
> +arch/<arch>/include/uapi/asm/ and arch/<arch>/include/generated/uapi/asm/
> +are exported.
> +
> +A Kbuild file may be defined under arch/<arch>/include/uapi/asm/ and
> +arch/<arch>/include/asm/ to list asm files coming from asm-generic.
>  See subsequent chapter for the syntax of the Kbuild file.
>  
> -	--- 7.1 header-y
> +	--- 7.1 subdir-y
>  
> -	header-y specifies header files to be exported.
> +	subdir-y may be used to specify a subdirectory to be exported.
>  
>  		Example:
> -			#include/linux/Kbuild
> -			header-y += usb/
> -			header-y += aio_abi.h
> +			#arch/cris/include/uapi/asm/Kbuild
> +			subdir-y += ../arch-v10/arch/
> +			subdir-y += ../arch-v32/arch/
>  
> -	The convention is to list one file per line and
> +	The convention is to list one subdir per line and
>  	preferably in alphabetic order.
>  
> -	header-y also specifies which subdirectories to visit.
> -	A subdirectory is identified by a trailing '/' which
> -	can be seen in the example above for the usb subdirectory.
> -
> -	Subdirectories are visited before their parent directories.
> -
>  	--- 7.2 genhdr-y
>  
> -	genhdr-y specifies generated files to be exported.
> -	Generated files are special as they need to be looked
> -	up in another directory when doing 'make O=...' builds.
> +	genhdr-y specifies asm files to be generated.
>  
>  		Example:
> -			#include/linux/Kbuild
> -			genhdr-y += version.h
> +			#arch/x86/include/uapi/asm/Kbuild
> +			genhdr-y += unistd_32.h
> +			genhdr-y += unistd_64.h
> +			genhdr-y += unistd_x32.h
> +
>  
>  	--- 7.3 generic-y
>  
> diff --git a/arch/alpha/include/uapi/asm/Kbuild b/arch/alpha/include/uapi/asm/Kbuild
> index d96f2ef5b639..b15bf6bc0e94 100644
> --- a/arch/alpha/include/uapi/asm/Kbuild
> +++ b/arch/alpha/include/uapi/asm/Kbuild
> @@ -1,43 +1,2 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
> -
> -header-y += a.out.h
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += byteorder.h
> -header-y += compiler.h
> -header-y += console.h
> -header-y += errno.h
> -header-y += fcntl.h
> -header-y += fpu.h
> -header-y += gentrap.h
> -header-y += ioctl.h
> -header-y += ioctls.h
> -header-y += ipcbuf.h
> -header-y += kvm_para.h
> -header-y += mman.h
> -header-y += msgbuf.h
> -header-y += pal.h
> -header-y += param.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += reg.h
> -header-y += regdef.h
> -header-y += resource.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += sysinfo.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += types.h
> -header-y += unistd.h
> diff --git a/arch/arc/include/uapi/asm/Kbuild b/arch/arc/include/uapi/asm/Kbuild
> index f50d02df78d5..b15bf6bc0e94 100644
> --- a/arch/arc/include/uapi/asm/Kbuild
> +++ b/arch/arc/include/uapi/asm/Kbuild
> @@ -1,5 +1,2 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
> -header-y += elf.h
> -header-y += page.h
> -header-y += cachectl.h
> diff --git a/arch/arm/include/uapi/asm/Kbuild b/arch/arm/include/uapi/asm/Kbuild
> index 46a76cd6acb6..607f702c2d62 100644
> --- a/arch/arm/include/uapi/asm/Kbuild
> +++ b/arch/arm/include/uapi/asm/Kbuild
> @@ -1,23 +1,6 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
>  
> -header-y += auxvec.h
> -header-y += byteorder.h
> -header-y += fcntl.h
> -header-y += hwcap.h
> -header-y += ioctls.h
> -header-y += kvm_para.h
> -header-y += mman.h
> -header-y += perf_regs.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += setup.h
> -header-y += sigcontext.h
> -header-y += signal.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += unistd.h
>  genhdr-y += unistd-common.h
>  genhdr-y += unistd-oabi.h
>  genhdr-y += unistd-eabi.h
> diff --git a/arch/arm64/include/uapi/asm/Kbuild b/arch/arm64/include/uapi/asm/Kbuild
> index 825b0fe51c2b..13a97aa2285f 100644
> --- a/arch/arm64/include/uapi/asm/Kbuild
> +++ b/arch/arm64/include/uapi/asm/Kbuild
> @@ -2,21 +2,3 @@
>  include include/uapi/asm-generic/Kbuild.asm
>  
>  generic-y += kvm_para.h
> -
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += byteorder.h
> -header-y += fcntl.h
> -header-y += hwcap.h
> -header-y += kvm_para.h
> -header-y += perf_regs.h
> -header-y += param.h
> -header-y += ptrace.h
> -header-y += setup.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += ucontext.h
> -header-y += unistd.h
> diff --git a/arch/avr32/include/uapi/asm/Kbuild b/arch/avr32/include/uapi/asm/Kbuild
> index 08d8a3d76ea8..610395083364 100644
> --- a/arch/avr32/include/uapi/asm/Kbuild
> +++ b/arch/avr32/include/uapi/asm/Kbuild
> @@ -1,26 +1,6 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
>  
> -header-y += auxvec.h
> -header-y += byteorder.h
> -header-y += cachectl.h
> -header-y += msgbuf.h
> -header-y += param.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += sigcontext.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += swab.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += types.h
> -header-y += unistd.h
>  generic-y += bitsperlong.h
>  generic-y += errno.h
>  generic-y += fcntl.h
> diff --git a/arch/blackfin/include/uapi/asm/Kbuild b/arch/blackfin/include/uapi/asm/Kbuild
> index 0bd28f77abc3..b15bf6bc0e94 100644
> --- a/arch/blackfin/include/uapi/asm/Kbuild
> +++ b/arch/blackfin/include/uapi/asm/Kbuild
> @@ -1,19 +1,2 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
> -
> -header-y += bfin_sport.h
> -header-y += byteorder.h
> -header-y += cachectl.h
> -header-y += fcntl.h
> -header-y += fixed_code.h
> -header-y += ioctls.h
> -header-y += kvm_para.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += stat.h
> -header-y += swab.h
> -header-y += unistd.h
> diff --git a/arch/c6x/include/uapi/asm/Kbuild b/arch/c6x/include/uapi/asm/Kbuild
> index e9bc2b2b8147..13a97aa2285f 100644
> --- a/arch/c6x/include/uapi/asm/Kbuild
> +++ b/arch/c6x/include/uapi/asm/Kbuild
> @@ -2,11 +2,3 @@
>  include include/uapi/asm-generic/Kbuild.asm
>  
>  generic-y += kvm_para.h
> -
> -header-y += byteorder.h
> -header-y += kvm_para.h
> -header-y += ptrace.h
> -header-y += setup.h
> -header-y += sigcontext.h
> -header-y += swab.h
> -header-y += unistd.h
> diff --git a/arch/cris/include/uapi/arch-v10/arch/Kbuild b/arch/cris/include/uapi/arch-v10/arch/Kbuild
> deleted file mode 100644
> index 9048c87a782b..000000000000
> --- a/arch/cris/include/uapi/arch-v10/arch/Kbuild
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -# UAPI Header export list
> -header-y += sv_addr.agh
> -header-y += sv_addr_ag.h
> -header-y += svinto.h
> -header-y += user.h
> diff --git a/arch/cris/include/uapi/arch-v32/arch/Kbuild b/arch/cris/include/uapi/arch-v32/arch/Kbuild
> deleted file mode 100644
> index 59efffd16b61..000000000000
> --- a/arch/cris/include/uapi/arch-v32/arch/Kbuild
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -# UAPI Header export list
> -header-y += cryptocop.h
> -header-y += user.h
> diff --git a/arch/cris/include/uapi/asm/Kbuild b/arch/cris/include/uapi/asm/Kbuild
> index d5564a0ae66a..d0c5471856e0 100644
> --- a/arch/cris/include/uapi/asm/Kbuild
> +++ b/arch/cris/include/uapi/asm/Kbuild
> @@ -1,44 +1,5 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
>  
> -header-y += ../arch-v10/arch/
> -header-y += ../arch-v32/arch/
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += byteorder.h
> -header-y += elf.h
> -header-y += elf_v10.h
> -header-y += elf_v32.h
> -header-y += errno.h
> -header-y += ethernet.h
> -header-y += etraxgpio.h
> -header-y += fcntl.h
> -header-y += ioctl.h
> -header-y += ioctls.h
> -header-y += ipcbuf.h
> -header-y += mman.h
> -header-y += msgbuf.h
> -header-y += param.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += ptrace_v10.h
> -header-y += ptrace_v32.h
> -header-y += resource.h
> -header-y += rs485.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += sync_serial.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += types.h
> -header-y += unistd.h
> +subdir-y += ../arch-v10/arch/
> +subdir-y += ../arch-v32/arch/
> diff --git a/arch/frv/include/uapi/asm/Kbuild b/arch/frv/include/uapi/asm/Kbuild
> index 42a2b33461c0..b15bf6bc0e94 100644
> --- a/arch/frv/include/uapi/asm/Kbuild
> +++ b/arch/frv/include/uapi/asm/Kbuild
> @@ -1,35 +1,2 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
> -
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += byteorder.h
> -header-y += errno.h
> -header-y += fcntl.h
> -header-y += ioctl.h
> -header-y += ioctls.h
> -header-y += ipcbuf.h
> -header-y += kvm_para.h
> -header-y += mman.h
> -header-y += msgbuf.h
> -header-y += param.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += registers.h
> -header-y += resource.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += types.h
> -header-y += unistd.h
> diff --git a/arch/h8300/include/uapi/asm/Kbuild b/arch/h8300/include/uapi/asm/Kbuild
> index fb6101a5d4f1..b15bf6bc0e94 100644
> --- a/arch/h8300/include/uapi/asm/Kbuild
> +++ b/arch/h8300/include/uapi/asm/Kbuild
> @@ -1,30 +1,2 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
> -
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += errno.h
> -header-y += fcntl.h
> -header-y += ioctl.h
> -header-y += ioctls.h
> -header-y += ipcbuf.h
> -header-y += kvm_para.h
> -header-y += mman.h
> -header-y += msgbuf.h
> -header-y += param.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += resource.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += siginfo.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += types.h
> -header-y += unistd.h
> diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild
> index db8ddabc6bd2..f3b1ceb5c1e4 100644
> --- a/arch/hexagon/include/asm/Kbuild
> +++ b/arch/hexagon/include/asm/Kbuild
> @@ -1,6 +1,3 @@
> -
> -header-y += ucontext.h
> -
>  generic-y += auxvec.h
>  generic-y += barrier.h
>  generic-y += bug.h
> diff --git a/arch/hexagon/include/uapi/asm/Kbuild b/arch/hexagon/include/uapi/asm/Kbuild
> index c31706c38631..b15bf6bc0e94 100644
> --- a/arch/hexagon/include/uapi/asm/Kbuild
> +++ b/arch/hexagon/include/uapi/asm/Kbuild
> @@ -1,15 +1,2 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
> -
> -header-y += bitsperlong.h
> -header-y += byteorder.h
> -header-y += kvm_para.h
> -header-y += param.h
> -header-y += ptrace.h
> -header-y += registers.h
> -header-y += setup.h
> -header-y += sigcontext.h
> -header-y += signal.h
> -header-y += swab.h
> -header-y += unistd.h
> -header-y += user.h
> diff --git a/arch/ia64/include/uapi/asm/Kbuild b/arch/ia64/include/uapi/asm/Kbuild
> index 891002bbb995..13a97aa2285f 100644
> --- a/arch/ia64/include/uapi/asm/Kbuild
> +++ b/arch/ia64/include/uapi/asm/Kbuild
> @@ -2,48 +2,3 @@
>  include include/uapi/asm-generic/Kbuild.asm
>  
>  generic-y += kvm_para.h
> -
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += break.h
> -header-y += byteorder.h
> -header-y += cmpxchg.h
> -header-y += errno.h
> -header-y += fcntl.h
> -header-y += fpu.h
> -header-y += gcc_intrin.h
> -header-y += ia64regs.h
> -header-y += intel_intrin.h
> -header-y += intrinsics.h
> -header-y += ioctl.h
> -header-y += ioctls.h
> -header-y += ipcbuf.h
> -header-y += kvm_para.h
> -header-y += mman.h
> -header-y += msgbuf.h
> -header-y += param.h
> -header-y += perfmon.h
> -header-y += perfmon_default_smpl.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += ptrace_offsets.h
> -header-y += resource.h
> -header-y += rse.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += types.h
> -header-y += ucontext.h
> -header-y += unistd.h
> -header-y += ustack.h
> diff --git a/arch/m32r/include/uapi/asm/Kbuild b/arch/m32r/include/uapi/asm/Kbuild
> index 43937a61d6cf..b15bf6bc0e94 100644
> --- a/arch/m32r/include/uapi/asm/Kbuild
> +++ b/arch/m32r/include/uapi/asm/Kbuild
> @@ -1,33 +1,2 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
> -
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += byteorder.h
> -header-y += errno.h
> -header-y += fcntl.h
> -header-y += ioctl.h
> -header-y += ioctls.h
> -header-y += ipcbuf.h
> -header-y += mman.h
> -header-y += msgbuf.h
> -header-y += param.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += resource.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += types.h
> -header-y += unistd.h
> diff --git a/arch/m68k/include/uapi/asm/Kbuild b/arch/m68k/include/uapi/asm/Kbuild
> index 6a2d257bdfb2..64368077235a 100644
> --- a/arch/m68k/include/uapi/asm/Kbuild
> +++ b/arch/m68k/include/uapi/asm/Kbuild
> @@ -9,27 +9,3 @@ generic-y += socket.h
>  generic-y += sockios.h
>  generic-y += termbits.h
>  generic-y += termios.h
> -
> -header-y += a.out.h
> -header-y += bootinfo.h
> -header-y += bootinfo-amiga.h
> -header-y += bootinfo-apollo.h
> -header-y += bootinfo-atari.h
> -header-y += bootinfo-hp300.h
> -header-y += bootinfo-mac.h
> -header-y += bootinfo-q40.h
> -header-y += bootinfo-vme.h
> -header-y += byteorder.h
> -header-y += cachectl.h
> -header-y += fcntl.h
> -header-y += ioctls.h
> -header-y += param.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += setup.h
> -header-y += sigcontext.h
> -header-y += signal.h
> -header-y += stat.h
> -header-y += swab.h
> -header-y += unistd.h
> diff --git a/arch/metag/include/uapi/asm/Kbuild b/arch/metag/include/uapi/asm/Kbuild
> index ab78be2b6eb0..b29731ebd7a9 100644
> --- a/arch/metag/include/uapi/asm/Kbuild
> +++ b/arch/metag/include/uapi/asm/Kbuild
> @@ -1,14 +1,6 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
>  
> -header-y += byteorder.h
> -header-y += ech.h
> -header-y += ptrace.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += swab.h
> -header-y += unistd.h
> -
>  generic-y += mman.h
>  generic-y += resource.h
>  generic-y += setup.h
> diff --git a/arch/microblaze/include/uapi/asm/Kbuild b/arch/microblaze/include/uapi/asm/Kbuild
> index 1aac99f87df1..2178c78c7c1a 100644
> --- a/arch/microblaze/include/uapi/asm/Kbuild
> +++ b/arch/microblaze/include/uapi/asm/Kbuild
> @@ -2,35 +2,3 @@
>  include include/uapi/asm-generic/Kbuild.asm
>  
>  generic-y += types.h
> -
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += byteorder.h
> -header-y += elf.h
> -header-y += errno.h
> -header-y += fcntl.h
> -header-y += ioctl.h
> -header-y += ioctls.h
> -header-y += ipcbuf.h
> -header-y += kvm_para.h
> -header-y += mman.h
> -header-y += msgbuf.h
> -header-y += param.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += resource.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += unistd.h
> diff --git a/arch/mips/include/uapi/asm/Kbuild b/arch/mips/include/uapi/asm/Kbuild
> index f2cf41461146..a0266feba9e6 100644
> --- a/arch/mips/include/uapi/asm/Kbuild
> +++ b/arch/mips/include/uapi/asm/Kbuild
> @@ -2,40 +2,3 @@
>  include include/uapi/asm-generic/Kbuild.asm
>  
>  generic-y += ipcbuf.h
> -
> -header-y += auxvec.h
> -header-y += bitfield.h
> -header-y += bitsperlong.h
> -header-y += break.h
> -header-y += byteorder.h
> -header-y += cachectl.h
> -header-y += errno.h
> -header-y += fcntl.h
> -header-y += inst.h
> -header-y += ioctl.h
> -header-y += ioctls.h
> -header-y += kvm_para.h
> -header-y += mman.h
> -header-y += msgbuf.h
> -header-y += param.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += resource.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += sgidefs.h
> -header-y += shmbuf.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += sysmips.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += types.h
> -header-y += unistd.h
> diff --git a/arch/mn10300/include/uapi/asm/Kbuild b/arch/mn10300/include/uapi/asm/Kbuild
> index 040178cdb3eb..b15bf6bc0e94 100644
> --- a/arch/mn10300/include/uapi/asm/Kbuild
> +++ b/arch/mn10300/include/uapi/asm/Kbuild
> @@ -1,34 +1,2 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
> -
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += byteorder.h
> -header-y += errno.h
> -header-y += fcntl.h
> -header-y += ioctl.h
> -header-y += ioctls.h
> -header-y += ipcbuf.h
> -header-y += kvm_para.h
> -header-y += mman.h
> -header-y += msgbuf.h
> -header-y += param.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += resource.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += types.h
> -header-y += unistd.h
> diff --git a/arch/nios2/include/uapi/asm/Kbuild b/arch/nios2/include/uapi/asm/Kbuild
> index e0bb972a50d7..766455d0d291 100644
> --- a/arch/nios2/include/uapi/asm/Kbuild
> +++ b/arch/nios2/include/uapi/asm/Kbuild
> @@ -1,5 +1,3 @@
> +# UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
> -
> -header-y += elf.h
> -
>  generic-y += ucontext.h
> diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild
> index 2832f031fb11..561915716fd9 100644
> --- a/arch/openrisc/include/asm/Kbuild
> +++ b/arch/openrisc/include/asm/Kbuild
> @@ -1,6 +1,3 @@
> -
> -header-y += ucontext.h
> -
>  generic-y += atomic.h
>  generic-y += auxvec.h
>  generic-y += barrier.h
> diff --git a/arch/openrisc/include/uapi/asm/Kbuild b/arch/openrisc/include/uapi/asm/Kbuild
> index 80761eb82b5f..b15bf6bc0e94 100644
> --- a/arch/openrisc/include/uapi/asm/Kbuild
> +++ b/arch/openrisc/include/uapi/asm/Kbuild
> @@ -1,10 +1,2 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
> -
> -header-y += byteorder.h
> -header-y += elf.h
> -header-y += kvm_para.h
> -header-y += param.h
> -header-y += ptrace.h
> -header-y += sigcontext.h
> -header-y += unistd.h
> diff --git a/arch/parisc/include/uapi/asm/Kbuild b/arch/parisc/include/uapi/asm/Kbuild
> index 348356c99514..3971c60a7e7f 100644
> --- a/arch/parisc/include/uapi/asm/Kbuild
> +++ b/arch/parisc/include/uapi/asm/Kbuild
> @@ -2,31 +2,3 @@
>  include include/uapi/asm-generic/Kbuild.asm
>  
>  generic-y += resource.h
> -
> -header-y += bitsperlong.h
> -header-y += byteorder.h
> -header-y += errno.h
> -header-y += fcntl.h
> -header-y += ioctl.h
> -header-y += ioctls.h
> -header-y += ipcbuf.h
> -header-y += mman.h
> -header-y += msgbuf.h
> -header-y += pdc.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += types.h
> -header-y += unistd.h
> diff --git a/arch/powerpc/include/uapi/asm/Kbuild b/arch/powerpc/include/uapi/asm/Kbuild
> index dab3717e3ea0..b15bf6bc0e94 100644
> --- a/arch/powerpc/include/uapi/asm/Kbuild
> +++ b/arch/powerpc/include/uapi/asm/Kbuild
> @@ -1,47 +1,2 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
> -
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += bootx.h
> -header-y += byteorder.h
> -header-y += cputable.h
> -header-y += eeh.h
> -header-y += elf.h
> -header-y += epapr_hcalls.h
> -header-y += errno.h
> -header-y += fcntl.h
> -header-y += ioctl.h
> -header-y += ioctls.h
> -header-y += ipcbuf.h
> -header-y += kvm.h
> -header-y += kvm_para.h
> -header-y += mman.h
> -header-y += msgbuf.h
> -header-y += nvram.h
> -header-y += opal-prd.h
> -header-y += param.h
> -header-y += perf_event.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += ps3fb.h
> -header-y += ptrace.h
> -header-y += resource.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += spu_info.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += tm.h
> -header-y += types.h
> -header-y += ucontext.h
> -header-y += unistd.h
> diff --git a/arch/s390/include/uapi/asm/Kbuild b/arch/s390/include/uapi/asm/Kbuild
> index bf736e764cb4..b15bf6bc0e94 100644
> --- a/arch/s390/include/uapi/asm/Kbuild
> +++ b/arch/s390/include/uapi/asm/Kbuild
> @@ -1,54 +1,2 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
> -
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += byteorder.h
> -header-y += chpid.h
> -header-y += chsc.h
> -header-y += clp.h
> -header-y += cmb.h
> -header-y += dasd.h
> -header-y += debug.h
> -header-y += errno.h
> -header-y += fcntl.h
> -header-y += hypfs.h
> -header-y += ioctl.h
> -header-y += ioctls.h
> -header-y += ipcbuf.h
> -header-y += kvm.h
> -header-y += kvm_para.h
> -header-y += kvm_perf.h
> -header-y += kvm_virtio.h
> -header-y += mman.h
> -header-y += monwriter.h
> -header-y += msgbuf.h
> -header-y += param.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += qeth.h
> -header-y += resource.h
> -header-y += schid.h
> -header-y += sclp_ctl.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += sie.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += tape390.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += types.h
> -header-y += ucontext.h
> -header-y += unistd.h
> -header-y += virtio-ccw.h
> -header-y += vtoc.h
> -header-y += zcrypt.h
> diff --git a/arch/score/include/asm/Kbuild b/arch/score/include/asm/Kbuild
> index a05218ff3fe4..128ca7ec0220 100644
> --- a/arch/score/include/asm/Kbuild
> +++ b/arch/score/include/asm/Kbuild
> @@ -1,7 +1,3 @@
> -
> -header-y +=
> -
> -
>  generic-y += barrier.h
>  generic-y += clkdev.h
>  generic-y += cputime.h
> diff --git a/arch/score/include/uapi/asm/Kbuild b/arch/score/include/uapi/asm/Kbuild
> index 040178cdb3eb..b15bf6bc0e94 100644
> --- a/arch/score/include/uapi/asm/Kbuild
> +++ b/arch/score/include/uapi/asm/Kbuild
> @@ -1,34 +1,2 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
> -
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += byteorder.h
> -header-y += errno.h
> -header-y += fcntl.h
> -header-y += ioctl.h
> -header-y += ioctls.h
> -header-y += ipcbuf.h
> -header-y += kvm_para.h
> -header-y += mman.h
> -header-y += msgbuf.h
> -header-y += param.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += resource.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += types.h
> -header-y += unistd.h
> diff --git a/arch/sh/include/uapi/asm/Kbuild b/arch/sh/include/uapi/asm/Kbuild
> index 60613ae78513..b15bf6bc0e94 100644
> --- a/arch/sh/include/uapi/asm/Kbuild
> +++ b/arch/sh/include/uapi/asm/Kbuild
> @@ -1,25 +1,2 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
> -
> -header-y += auxvec.h
> -header-y += byteorder.h
> -header-y += cachectl.h
> -header-y += cpu-features.h
> -header-y += hw_breakpoint.h
> -header-y += ioctls.h
> -header-y += posix_types.h
> -header-y += posix_types_32.h
> -header-y += posix_types_64.h
> -header-y += ptrace.h
> -header-y += ptrace_32.h
> -header-y += ptrace_64.h
> -header-y += setup.h
> -header-y += sigcontext.h
> -header-y += signal.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += swab.h
> -header-y += types.h
> -header-y += unistd.h
> -header-y += unistd_32.h
> -header-y += unistd_64.h
> diff --git a/arch/sparc/include/uapi/asm/Kbuild b/arch/sparc/include/uapi/asm/Kbuild
> index b5843ee09fb5..b15bf6bc0e94 100644
> --- a/arch/sparc/include/uapi/asm/Kbuild
> +++ b/arch/sparc/include/uapi/asm/Kbuild
> @@ -1,50 +1,2 @@
>  # UAPI Header export list
> -# User exported sparc header files
> -
>  include include/uapi/asm-generic/Kbuild.asm
> -
> -header-y += apc.h
> -header-y += asi.h
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += byteorder.h
> -header-y += display7seg.h
> -header-y += envctrl.h
> -header-y += errno.h
> -header-y += fbio.h
> -header-y += fcntl.h
> -header-y += ioctl.h
> -header-y += ioctls.h
> -header-y += ipcbuf.h
> -header-y += jsflash.h
> -header-y += kvm_para.h
> -header-y += mman.h
> -header-y += msgbuf.h
> -header-y += openpromio.h
> -header-y += param.h
> -header-y += perfctr.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += psr.h
> -header-y += psrcompat.h
> -header-y += pstate.h
> -header-y += ptrace.h
> -header-y += resource.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += traps.h
> -header-y += uctx.h
> -header-y += unistd.h
> -header-y += utrap.h
> -header-y += watchdog.h
> diff --git a/arch/tile/include/asm/Kbuild b/arch/tile/include/asm/Kbuild
> index 2d1f5638974c..057eaa533877 100644
> --- a/arch/tile/include/asm/Kbuild
> +++ b/arch/tile/include/asm/Kbuild
> @@ -1,6 +1,3 @@
> -
> -header-y += ../arch/
> -
>  generic-y += bug.h
>  generic-y += bugs.h
>  generic-y += clkdev.h
> diff --git a/arch/tile/include/uapi/arch/Kbuild b/arch/tile/include/uapi/arch/Kbuild
> deleted file mode 100644
> index 97dfbecec6b6..000000000000
> --- a/arch/tile/include/uapi/arch/Kbuild
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -# UAPI Header export list
> -header-y += abi.h
> -header-y += chip.h
> -header-y += chip_tilegx.h
> -header-y += chip_tilepro.h
> -header-y += icache.h
> -header-y += interrupts.h
> -header-y += interrupts_32.h
> -header-y += interrupts_64.h
> -header-y += opcode.h
> -header-y += opcode_tilegx.h
> -header-y += opcode_tilepro.h
> -header-y += sim.h
> -header-y += sim_def.h
> -header-y += spr_def.h
> -header-y += spr_def_32.h
> -header-y += spr_def_64.h
> diff --git a/arch/tile/include/uapi/asm/Kbuild b/arch/tile/include/uapi/asm/Kbuild
> index c20db8e428bf..e0a50111e07f 100644
> --- a/arch/tile/include/uapi/asm/Kbuild
> +++ b/arch/tile/include/uapi/asm/Kbuild
> @@ -1,21 +1,6 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
>  
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += byteorder.h
> -header-y += cachectl.h
> -header-y += hardwall.h
> -header-y += kvm_para.h
> -header-y += mman.h
> -header-y += ptrace.h
> -header-y += setup.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += stat.h
> -header-y += swab.h
> -header-y += ucontext.h
> -header-y += unistd.h
> -
>  generic-y += ucontext.h
> +
> +subdir-y += ../arch
> diff --git a/arch/unicore32/include/uapi/asm/Kbuild b/arch/unicore32/include/uapi/asm/Kbuild
> index 0514d7ad6855..13a97aa2285f 100644
> --- a/arch/unicore32/include/uapi/asm/Kbuild
> +++ b/arch/unicore32/include/uapi/asm/Kbuild
> @@ -1,10 +1,4 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
>  
> -header-y += byteorder.h
> -header-y += kvm_para.h
> -header-y += ptrace.h
> -header-y += sigcontext.h
> -header-y += unistd.h
> -
>  generic-y += kvm_para.h
> diff --git a/arch/x86/include/uapi/asm/Kbuild b/arch/x86/include/uapi/asm/Kbuild
> index 3dec769cadf7..83b6e9a0dce4 100644
> --- a/arch/x86/include/uapi/asm/Kbuild
> +++ b/arch/x86/include/uapi/asm/Kbuild
> @@ -4,62 +4,3 @@ include include/uapi/asm-generic/Kbuild.asm
>  genhdr-y += unistd_32.h
>  genhdr-y += unistd_64.h
>  genhdr-y += unistd_x32.h
> -header-y += a.out.h
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += boot.h
> -header-y += bootparam.h
> -header-y += byteorder.h
> -header-y += debugreg.h
> -header-y += e820.h
> -header-y += errno.h
> -header-y += fcntl.h
> -header-y += hw_breakpoint.h
> -header-y += hyperv.h
> -header-y += ioctl.h
> -header-y += ioctls.h
> -header-y += ipcbuf.h
> -header-y += ist.h
> -header-y += kvm.h
> -header-y += kvm_para.h
> -header-y += kvm_perf.h
> -header-y += ldt.h
> -header-y += mce.h
> -header-y += mman.h
> -header-y += msgbuf.h
> -header-y += msr-index.h
> -header-y += msr.h
> -header-y += mtrr.h
> -header-y += param.h
> -header-y += perf_regs.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += posix_types_32.h
> -header-y += posix_types_64.h
> -header-y += posix_types_x32.h
> -header-y += prctl.h
> -header-y += processor-flags.h
> -header-y += ptrace-abi.h
> -header-y += ptrace.h
> -header-y += resource.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += sigcontext.h
> -header-y += sigcontext32.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += svm.h
> -header-y += swab.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += types.h
> -header-y += ucontext.h
> -header-y += unistd.h
> -header-y += vm86.h
> -header-y += vmx.h
> -header-y += vsyscall.h
> diff --git a/arch/xtensa/include/uapi/asm/Kbuild b/arch/xtensa/include/uapi/asm/Kbuild
> index 56aad54e7fb7..b15bf6bc0e94 100644
> --- a/arch/xtensa/include/uapi/asm/Kbuild
> +++ b/arch/xtensa/include/uapi/asm/Kbuild
> @@ -1,25 +1,2 @@
>  # UAPI Header export list
>  include include/uapi/asm-generic/Kbuild.asm
> -
> -header-y += auxvec.h
> -header-y += byteorder.h
> -header-y += ioctls.h
> -header-y += ipcbuf.h
> -header-y += mman.h
> -header-y += msgbuf.h
> -header-y += param.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += sigcontext.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += swab.h
> -header-y += termbits.h
> -header-y += types.h
> -header-y += unistd.h
> diff --git a/include/Kbuild b/include/Kbuild
> deleted file mode 100644
> index bab1145bc7a7..000000000000
> --- a/include/Kbuild
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# Top-level Makefile calls into asm-$(ARCH)
> -# List only non-arch directories below
> diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
> deleted file mode 100644
> index d2ee86b4c091..000000000000
> --- a/include/asm-generic/Kbuild.asm
> +++ /dev/null
> @@ -1 +0,0 @@
> -include include/uapi/asm-generic/Kbuild.asm
> diff --git a/include/scsi/fc/Kbuild b/include/scsi/fc/Kbuild
> deleted file mode 100644
> index e69de29bb2d1..000000000000
> diff --git a/include/uapi/Kbuild b/include/uapi/Kbuild
> deleted file mode 100644
> index 245aa6e05e6a..000000000000
> --- a/include/uapi/Kbuild
> +++ /dev/null
> @@ -1,15 +0,0 @@
> -# UAPI Header export list
> -# Top-level Makefile calls into asm-$(ARCH)
> -# List only non-arch directories below
> -
> -
> -header-y += asm-generic/
> -header-y += linux/
> -header-y += sound/
> -header-y += mtd/
> -header-y += rdma/
> -header-y += video/
> -header-y += drm/
> -header-y += xen/
> -header-y += scsi/
> -header-y += misc/
> diff --git a/include/uapi/asm-generic/Kbuild b/include/uapi/asm-generic/Kbuild
> deleted file mode 100644
> index b73de7bb7a62..000000000000
> --- a/include/uapi/asm-generic/Kbuild
> +++ /dev/null
> @@ -1,36 +0,0 @@
> -# UAPI Header export list
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += errno-base.h
> -header-y += errno.h
> -header-y += fcntl.h
> -header-y += int-l64.h
> -header-y += int-ll64.h
> -header-y += ioctl.h
> -header-y += ioctls.h
> -header-y += ipcbuf.h
> -header-y += kvm_para.h
> -header-y += mman-common.h
> -header-y += mman.h
> -header-y += msgbuf.h
> -header-y += param.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += resource.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += shmparam.h
> -header-y += siginfo.h
> -header-y += signal-defs.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += types.h
> -header-y += ucontext.h
> -header-y += unistd.h
> diff --git a/include/uapi/asm-generic/Kbuild.asm b/include/uapi/asm-generic/Kbuild.asm
> index fcd50b759217..c13805d5a2a0 100644
> --- a/include/uapi/asm-generic/Kbuild.asm
> +++ b/include/uapi/asm-generic/Kbuild.asm
> @@ -8,38 +8,38 @@ opt-header += a.out.h
>  #
>  # Headers that are mandatory in usr/include/asm/
>  #
> -header-y += auxvec.h
> -header-y += bitsperlong.h
> -header-y += byteorder.h
> -header-y += errno.h
> -header-y += fcntl.h
> -header-y += ioctl.h
> -header-y += ioctls.h
> -header-y += ipcbuf.h
> -header-y += mman.h
> -header-y += msgbuf.h
> -header-y += param.h
> -header-y += poll.h
> -header-y += posix_types.h
> -header-y += ptrace.h
> -header-y += resource.h
> -header-y += sembuf.h
> -header-y += setup.h
> -header-y += shmbuf.h
> -header-y += sigcontext.h
> -header-y += siginfo.h
> -header-y += signal.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += stat.h
> -header-y += statfs.h
> -header-y += swab.h
> -header-y += termbits.h
> -header-y += termios.h
> -header-y += types.h
> -header-y += unistd.h
> +generic-y += auxvec.h
> +generic-y += bitsperlong.h
> +generic-y += byteorder.h
> +generic-y += errno.h
> +generic-y += fcntl.h
> +generic-y += ioctl.h
> +generic-y += ioctls.h
> +generic-y += ipcbuf.h
> +generic-y += mman.h
> +generic-y += msgbuf.h
> +generic-y += param.h
> +generic-y += poll.h
> +generic-y += posix_types.h
> +generic-y += ptrace.h
> +generic-y += resource.h
> +generic-y += sembuf.h
> +generic-y += setup.h
> +generic-y += shmbuf.h
> +generic-y += sigcontext.h
> +generic-y += siginfo.h
> +generic-y += signal.h
> +generic-y += socket.h
> +generic-y += sockios.h
> +generic-y += stat.h
> +generic-y += statfs.h
> +generic-y += swab.h
> +generic-y += termbits.h
> +generic-y += termios.h
> +generic-y += types.h
> +generic-y += unistd.h
>  
> -header-y += $(foreach hdr,$(opt-header), \
> +generic-y += $(foreach hdr,$(opt-header), \
>  	      $(if \
>  		$(wildcard \
>  			$(srctree)/arch/$(SRCARCH)/include/uapi/asm/$(hdr) \
> diff --git a/include/uapi/drm/Kbuild b/include/uapi/drm/Kbuild
> deleted file mode 100644
> index 9355dd8eff3b..000000000000
> --- a/include/uapi/drm/Kbuild
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -# UAPI Header export list
> -header-y += drm.h
> -header-y += drm_fourcc.h
> -header-y += drm_mode.h
> -header-y += drm_sarea.h
> -header-y += amdgpu_drm.h
> -header-y += exynos_drm.h
> -header-y += i810_drm.h
> -header-y += i915_drm.h
> -header-y += mga_drm.h
> -header-y += nouveau_drm.h
> -header-y += qxl_drm.h
> -header-y += r128_drm.h
> -header-y += radeon_drm.h
> -header-y += savage_drm.h
> -header-y += sis_drm.h
> -header-y += tegra_drm.h
> -header-y += via_drm.h
> -header-y += vmwgfx_drm.h
> -header-y += msm_drm.h
> -header-y += vc4_drm.h
> -header-y += virtgpu_drm.h
> diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
> deleted file mode 100644
> index a8b93e685239..000000000000
> --- a/include/uapi/linux/Kbuild
> +++ /dev/null
> @@ -1,482 +0,0 @@
> -# UAPI Header export list
> -header-y += android/
> -header-y += byteorder/
> -header-y += can/
> -header-y += caif/
> -header-y += dvb/
> -header-y += hdlc/
> -header-y += hsi/
> -header-y += iio/
> -header-y += isdn/
> -header-y += mmc/
> -header-y += nfsd/
> -header-y += raid/
> -header-y += spi/
> -header-y += sunrpc/
> -header-y += tc_act/
> -header-y += tc_ematch/
> -header-y += netfilter/
> -header-y += netfilter_arp/
> -header-y += netfilter_bridge/
> -header-y += netfilter_ipv4/
> -header-y += netfilter_ipv6/
> -header-y += usb/
> -header-y += wimax/
> -
> -genhdr-y += version.h
> -
> -ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/a.out.h \
> -		  $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h),)
> -header-y += a.out.h
> -endif
> -
> -header-y += acct.h
> -header-y += adb.h
> -header-y += adfs_fs.h
> -header-y += affs_hardblocks.h
> -header-y += agpgart.h
> -header-y += aio_abi.h
> -header-y += am437x-vpfe.h
> -header-y += apm_bios.h
> -header-y += arcfb.h
> -header-y += atalk.h
> -header-y += atmapi.h
> -header-y += atmarp.h
> -header-y += atmbr2684.h
> -header-y += atmclip.h
> -header-y += atmdev.h
> -header-y += atm_eni.h
> -header-y += atm.h
> -header-y += atm_he.h
> -header-y += atm_idt77105.h
> -header-y += atmioc.h
> -header-y += atmlec.h
> -header-y += atmmpc.h
> -header-y += atm_nicstar.h
> -header-y += atmppp.h
> -header-y += atmsap.h
> -header-y += atmsvc.h
> -header-y += atm_tcp.h
> -header-y += atm_zatm.h
> -header-y += audit.h
> -header-y += auto_fs4.h
> -header-y += auto_fs.h
> -header-y += auxvec.h
> -header-y += ax25.h
> -header-y += b1lli.h
> -header-y += baycom.h
> -header-y += bcm933xx_hcs.h
> -header-y += bfs_fs.h
> -header-y += binfmts.h
> -header-y += blkpg.h
> -header-y += blktrace_api.h
> -header-y += blkzoned.h
> -header-y += bpf_common.h
> -header-y += bpf_perf_event.h
> -header-y += bpf.h
> -header-y += bpqether.h
> -header-y += bsg.h
> -header-y += bt-bmc.h
> -header-y += btrfs.h
> -header-y += can.h
> -header-y += capability.h
> -header-y += capi.h
> -header-y += cciss_defs.h
> -header-y += cciss_ioctl.h
> -header-y += cdrom.h
> -header-y += cec.h
> -header-y += cec-funcs.h
> -header-y += cgroupstats.h
> -header-y += chio.h
> -header-y += cm4000_cs.h
> -header-y += cn_proc.h
> -header-y += coda.h
> -header-y += coda_psdev.h
> -header-y += coff.h
> -header-y += connector.h
> -header-y += const.h
> -header-y += cramfs_fs.h
> -header-y += cuda.h
> -header-y += cyclades.h
> -header-y += cycx_cfm.h
> -header-y += dcbnl.h
> -header-y += dccp.h
> -header-y += devlink.h
> -header-y += dlmconstants.h
> -header-y += dlm_device.h
> -header-y += dlm.h
> -header-y += dlm_netlink.h
> -header-y += dlm_plock.h
> -header-y += dm-ioctl.h
> -header-y += dm-log-userspace.h
> -header-y += dn.h
> -header-y += dqblk_xfs.h
> -header-y += edd.h
> -header-y += efs_fs_sb.h
> -header-y += elfcore.h
> -header-y += elf-em.h
> -header-y += elf-fdpic.h
> -header-y += elf.h
> -header-y += errno.h
> -header-y += errqueue.h
> -header-y += ethtool.h
> -header-y += eventpoll.h
> -header-y += fadvise.h
> -header-y += falloc.h
> -header-y += fanotify.h
> -header-y += fb.h
> -header-y += fcntl.h
> -header-y += fd.h
> -header-y += fdreg.h
> -header-y += fib_rules.h
> -header-y += fiemap.h
> -header-y += filter.h
> -header-y += firewire-cdev.h
> -header-y += firewire-constants.h
> -header-y += flat.h
> -header-y += fou.h
> -header-y += fs.h
> -header-y += fsl_hypervisor.h
> -header-y += fuse.h
> -header-y += futex.h
> -header-y += gameport.h
> -header-y += genetlink.h
> -header-y += gen_stats.h
> -header-y += gfs2_ondisk.h
> -header-y += gigaset_dev.h
> -header-y += gpio.h
> -header-y += gsmmux.h
> -header-y += gtp.h
> -header-y += hdlcdrv.h
> -header-y += hdlc.h
> -header-y += hdreg.h
> -header-y += hiddev.h
> -header-y += hid.h
> -header-y += hidraw.h
> -header-y += hpet.h
> -header-y += hsr_netlink.h
> -header-y += hyperv.h
> -header-y += hysdn_if.h
> -header-y += i2c-dev.h
> -header-y += i2c.h
> -header-y += i2o-dev.h
> -header-y += i8k.h
> -header-y += icmp.h
> -header-y += icmpv6.h
> -header-y += if_addr.h
> -header-y += if_addrlabel.h
> -header-y += if_alg.h
> -header-y += if_arcnet.h
> -header-y += if_arp.h
> -header-y += if_bonding.h
> -header-y += if_bridge.h
> -header-y += if_cablemodem.h
> -header-y += if_eql.h
> -header-y += if_ether.h
> -header-y += if_fc.h
> -header-y += if_fddi.h
> -header-y += if_frad.h
> -header-y += if.h
> -header-y += if_hippi.h
> -header-y += if_infiniband.h
> -header-y += if_link.h
> -header-y += if_ltalk.h
> -header-y += if_macsec.h
> -header-y += if_packet.h
> -header-y += if_phonet.h
> -header-y += if_plip.h
> -header-y += if_ppp.h
> -header-y += if_pppol2tp.h
> -header-y += if_pppox.h
> -header-y += if_slip.h
> -header-y += if_team.h
> -header-y += if_tun.h
> -header-y += if_tunnel.h
> -header-y += if_vlan.h
> -header-y += if_x25.h
> -header-y += igmp.h
> -header-y += ila.h
> -header-y += in6.h
> -header-y += inet_diag.h
> -header-y += in.h
> -header-y += inotify.h
> -header-y += input.h
> -header-y += input-event-codes.h
> -header-y += in_route.h
> -header-y += ioctl.h
> -header-y += ip6_tunnel.h
> -header-y += ipc.h
> -header-y += ip.h
> -header-y += ipmi.h
> -header-y += ipmi_msgdefs.h
> -header-y += ipsec.h
> -header-y += ipv6.h
> -header-y += ipv6_route.h
> -header-y += ip_vs.h
> -header-y += ipx.h
> -header-y += irda.h
> -header-y += irqnr.h
> -header-y += isdn_divertif.h
> -header-y += isdn.h
> -header-y += isdnif.h
> -header-y += isdn_ppp.h
> -header-y += iso_fs.h
> -header-y += ivtvfb.h
> -header-y += ivtv.h
> -header-y += ixjuser.h
> -header-y += jffs2.h
> -header-y += joystick.h
> -header-y += kcmp.h
> -header-y += kdev_t.h
> -header-y += kd.h
> -header-y += kernelcapi.h
> -header-y += kernel.h
> -header-y += kernel-page-flags.h
> -header-y += kexec.h
> -header-y += keyboard.h
> -header-y += keyctl.h
> -
> -ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm.h \
> -		  $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h),)
> -header-y += kvm.h
> -endif
> -
> -
> -ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h \
> -		  $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h),)
> -header-y += kvm_para.h
> -endif
> -
> -header-y += hw_breakpoint.h
> -header-y += l2tp.h
> -header-y += libc-compat.h
> -header-y += lirc.h
> -header-y += limits.h
> -header-y += llc.h
> -header-y += loop.h
> -header-y += lp.h
> -header-y += lwtunnel.h
> -header-y += magic.h
> -header-y += major.h
> -header-y += map_to_7segment.h
> -header-y += matroxfb.h
> -header-y += mdio.h
> -header-y += media.h
> -header-y += media-bus-format.h
> -header-y += mei.h
> -header-y += membarrier.h
> -header-y += memfd.h
> -header-y += mempolicy.h
> -header-y += meye.h
> -header-y += mic_common.h
> -header-y += mic_ioctl.h
> -header-y += mii.h
> -header-y += minix_fs.h
> -header-y += mman.h
> -header-y += mmtimer.h
> -header-y += mpls.h
> -header-y += mpls_iptunnel.h
> -header-y += mqueue.h
> -header-y += mroute6.h
> -header-y += mroute.h
> -header-y += msdos_fs.h
> -header-y += msg.h
> -header-y += mtio.h
> -header-y += nbd.h
> -header-y += ncp_fs.h
> -header-y += ncp.h
> -header-y += ncp_mount.h
> -header-y += ncp_no.h
> -header-y += ndctl.h
> -header-y += neighbour.h
> -header-y += netconf.h
> -header-y += netdevice.h
> -header-y += net_dropmon.h
> -header-y += netfilter_arp.h
> -header-y += netfilter_bridge.h
> -header-y += netfilter_decnet.h
> -header-y += netfilter.h
> -header-y += netfilter_ipv4.h
> -header-y += netfilter_ipv6.h
> -header-y += net.h
> -header-y += netlink_diag.h
> -header-y += netlink.h
> -header-y += netrom.h
> -header-y += net_namespace.h
> -header-y += net_tstamp.h
> -header-y += nfc.h
> -header-y += nfs2.h
> -header-y += nfs3.h
> -header-y += nfs4.h
> -header-y += nfs4_mount.h
> -header-y += nfsacl.h
> -header-y += nfs_fs.h
> -header-y += nfs.h
> -header-y += nfs_idmap.h
> -header-y += nfs_mount.h
> -header-y += nl80211.h
> -header-y += n_r3964.h
> -header-y += nubus.h
> -header-y += nvme_ioctl.h
> -header-y += nvram.h
> -header-y += omap3isp.h
> -header-y += omapfb.h
> -header-y += oom.h
> -header-y += openvswitch.h
> -header-y += packet_diag.h
> -header-y += param.h
> -header-y += parport.h
> -header-y += patchkey.h
> -header-y += pci.h
> -header-y += pci_regs.h
> -header-y += perf_event.h
> -header-y += personality.h
> -header-y += pfkeyv2.h
> -header-y += pg.h
> -header-y += phantom.h
> -header-y += phonet.h
> -header-y += pktcdvd.h
> -header-y += pkt_cls.h
> -header-y += pkt_sched.h
> -header-y += pmu.h
> -header-y += poll.h
> -header-y += posix_acl.h
> -header-y += posix_acl_xattr.h
> -header-y += posix_types.h
> -header-y += ppdev.h
> -header-y += ppp-comp.h
> -header-y += ppp_defs.h
> -header-y += ppp-ioctl.h
> -header-y += pps.h
> -header-y += prctl.h
> -header-y += psci.h
> -header-y += ptp_clock.h
> -header-y += ptrace.h
> -header-y += qnx4_fs.h
> -header-y += qnxtypes.h
> -header-y += quota.h
> -header-y += radeonfb.h
> -header-y += random.h
> -header-y += raw.h
> -header-y += rds.h
> -header-y += reboot.h
> -header-y += reiserfs_fs.h
> -header-y += reiserfs_xattr.h
> -header-y += resource.h
> -header-y += rfkill.h
> -header-y += rio_cm_cdev.h
> -header-y += rio_mport_cdev.h
> -header-y += romfs_fs.h
> -header-y += rose.h
> -header-y += route.h
> -header-y += rtc.h
> -header-y += rtnetlink.h
> -header-y += scc.h
> -header-y += sched.h
> -header-y += scif_ioctl.h
> -header-y += screen_info.h
> -header-y += sctp.h
> -header-y += sdla.h
> -header-y += seccomp.h
> -header-y += securebits.h
> -header-y += selinux_netlink.h
> -header-y += sem.h
> -header-y += serial_core.h
> -header-y += serial.h
> -header-y += serial_reg.h
> -header-y += serio.h
> -header-y += shm.h
> -header-y += signalfd.h
> -header-y += signal.h
> -header-y += smiapp.h
> -header-y += snmp.h
> -header-y += sock_diag.h
> -header-y += socket.h
> -header-y += sockios.h
> -header-y += sonet.h
> -header-y += sonypi.h
> -header-y += soundcard.h
> -header-y += sound.h
> -header-y += stat.h
> -header-y += stddef.h
> -header-y += string.h
> -header-y += suspend_ioctls.h
> -header-y += swab.h
> -header-y += synclink.h
> -header-y += sync_file.h
> -header-y += sysctl.h
> -header-y += sysinfo.h
> -header-y += target_core_user.h
> -header-y += taskstats.h
> -header-y += tcp.h
> -header-y += tcp_metrics.h
> -header-y += telephony.h
> -header-y += termios.h
> -header-y += thermal.h
> -header-y += time.h
> -header-y += times.h
> -header-y += timex.h
> -header-y += tiocl.h
> -header-y += tipc_config.h
> -header-y += tipc_netlink.h
> -header-y += tipc.h
> -header-y += toshiba.h
> -header-y += tty_flags.h
> -header-y += tty.h
> -header-y += types.h
> -header-y += udf_fs_i.h
> -header-y += udp.h
> -header-y += uhid.h
> -header-y += uinput.h
> -header-y += uio.h
> -header-y += uleds.h
> -header-y += ultrasound.h
> -header-y += un.h
> -header-y += unistd.h
> -header-y += unix_diag.h
> -header-y += usbdevice_fs.h
> -header-y += usbip.h
> -header-y += utime.h
> -header-y += utsname.h
> -header-y += uuid.h
> -header-y += uvcvideo.h
> -header-y += v4l2-common.h
> -header-y += v4l2-controls.h
> -header-y += v4l2-dv-timings.h
> -header-y += v4l2-mediabus.h
> -header-y += v4l2-subdev.h
> -header-y += veth.h
> -header-y += vfio.h
> -header-y += vhost.h
> -header-y += videodev2.h
> -header-y += virtio_9p.h
> -header-y += virtio_balloon.h
> -header-y += virtio_blk.h
> -header-y += virtio_config.h
> -header-y += virtio_console.h
> -header-y += virtio_gpu.h
> -header-y += virtio_ids.h
> -header-y += virtio_input.h
> -header-y += virtio_net.h
> -header-y += virtio_pci.h
> -header-y += virtio_ring.h
> -header-y += virtio_rng.h
> -header-y += virtio_scsi.h
> -header-y += virtio_types.h
> -header-y += virtio_vsock.h
> -header-y += virtio_crypto.h
> -header-y += vm_sockets.h
> -header-y += vt.h
> -header-y += vtpm_proxy.h
> -header-y += wait.h
> -header-y += wanrouter.h
> -header-y += watchdog.h
> -header-y += wimax.h
> -header-y += wireless.h
> -header-y += x25.h
> -header-y += xattr.h
> -header-y += xfrm.h
> -header-y += xilinx-v4l2-controls.h
> -header-y += zorro.h
> -header-y += zorro_ids.h
> -header-y += userfaultfd.h
> diff --git a/include/uapi/linux/android/Kbuild b/include/uapi/linux/android/Kbuild
> deleted file mode 100644
> index ca011eec252a..000000000000
> --- a/include/uapi/linux/android/Kbuild
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# UAPI Header export list
> -header-y += binder.h
> diff --git a/include/uapi/linux/byteorder/Kbuild b/include/uapi/linux/byteorder/Kbuild
> deleted file mode 100644
> index 619225b9ff2e..000000000000
> --- a/include/uapi/linux/byteorder/Kbuild
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -# UAPI Header export list
> -header-y += big_endian.h
> -header-y += little_endian.h
> diff --git a/include/uapi/linux/caif/Kbuild b/include/uapi/linux/caif/Kbuild
> deleted file mode 100644
> index 43396612d3a3..000000000000
> --- a/include/uapi/linux/caif/Kbuild
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -# UAPI Header export list
> -header-y += caif_socket.h
> -header-y += if_caif.h
> diff --git a/include/uapi/linux/can/Kbuild b/include/uapi/linux/can/Kbuild
> deleted file mode 100644
> index 21c91bf25a29..000000000000
> --- a/include/uapi/linux/can/Kbuild
> +++ /dev/null
> @@ -1,6 +0,0 @@
> -# UAPI Header export list
> -header-y += bcm.h
> -header-y += error.h
> -header-y += gw.h
> -header-y += netlink.h
> -header-y += raw.h
> diff --git a/include/uapi/linux/dvb/Kbuild b/include/uapi/linux/dvb/Kbuild
> deleted file mode 100644
> index d40942cfc627..000000000000
> --- a/include/uapi/linux/dvb/Kbuild
> +++ /dev/null
> @@ -1,9 +0,0 @@
> -# UAPI Header export list
> -header-y += audio.h
> -header-y += ca.h
> -header-y += dmx.h
> -header-y += frontend.h
> -header-y += net.h
> -header-y += osd.h
> -header-y += version.h
> -header-y += video.h
> diff --git a/include/uapi/linux/hdlc/Kbuild b/include/uapi/linux/hdlc/Kbuild
> deleted file mode 100644
> index 8c1d2cb75e33..000000000000
> --- a/include/uapi/linux/hdlc/Kbuild
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# UAPI Header export list
> -header-y += ioctl.h
> diff --git a/include/uapi/linux/hsi/Kbuild b/include/uapi/linux/hsi/Kbuild
> deleted file mode 100644
> index a16a00544258..000000000000
> --- a/include/uapi/linux/hsi/Kbuild
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# UAPI Header export list
> -header-y += hsi_char.h cs-protocol.h
> diff --git a/include/uapi/linux/iio/Kbuild b/include/uapi/linux/iio/Kbuild
> deleted file mode 100644
> index 86f76d84c44f..000000000000
> --- a/include/uapi/linux/iio/Kbuild
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -# UAPI Header export list
> -header-y += events.h
> -header-y += types.h
> diff --git a/include/uapi/linux/isdn/Kbuild b/include/uapi/linux/isdn/Kbuild
> deleted file mode 100644
> index 89e52850bf29..000000000000
> --- a/include/uapi/linux/isdn/Kbuild
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# UAPI Header export list
> -header-y += capicmd.h
> diff --git a/include/uapi/linux/mmc/Kbuild b/include/uapi/linux/mmc/Kbuild
> deleted file mode 100644
> index 8c1d2cb75e33..000000000000
> --- a/include/uapi/linux/mmc/Kbuild
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# UAPI Header export list
> -header-y += ioctl.h
> diff --git a/include/uapi/linux/netfilter/Kbuild b/include/uapi/linux/netfilter/Kbuild
> deleted file mode 100644
> index 03f194aeadc5..000000000000
> --- a/include/uapi/linux/netfilter/Kbuild
> +++ /dev/null
> @@ -1,89 +0,0 @@
> -# UAPI Header export list
> -header-y += ipset/
> -header-y += nf_conntrack_common.h
> -header-y += nf_conntrack_ftp.h
> -header-y += nf_conntrack_sctp.h
> -header-y += nf_conntrack_tcp.h
> -header-y += nf_conntrack_tuple_common.h
> -header-y += nf_log.h
> -header-y += nf_tables.h
> -header-y += nf_tables_compat.h
> -header-y += nf_nat.h
> -header-y += nfnetlink.h
> -header-y += nfnetlink_acct.h
> -header-y += nfnetlink_compat.h
> -header-y += nfnetlink_conntrack.h
> -header-y += nfnetlink_cthelper.h
> -header-y += nfnetlink_cttimeout.h
> -header-y += nfnetlink_log.h
> -header-y += nfnetlink_queue.h
> -header-y += x_tables.h
> -header-y += xt_AUDIT.h
> -header-y += xt_CHECKSUM.h
> -header-y += xt_CLASSIFY.h
> -header-y += xt_CONNMARK.h
> -header-y += xt_CONNSECMARK.h
> -header-y += xt_CT.h
> -header-y += xt_DSCP.h
> -header-y += xt_HMARK.h
> -header-y += xt_IDLETIMER.h
> -header-y += xt_LED.h
> -header-y += xt_LOG.h
> -header-y += xt_MARK.h
> -header-y += xt_NFLOG.h
> -header-y += xt_NFQUEUE.h
> -header-y += xt_RATEEST.h
> -header-y += xt_SECMARK.h
> -header-y += xt_SYNPROXY.h
> -header-y += xt_TCPMSS.h
> -header-y += xt_TCPOPTSTRIP.h
> -header-y += xt_TEE.h
> -header-y += xt_TPROXY.h
> -header-y += xt_addrtype.h
> -header-y += xt_bpf.h
> -header-y += xt_cgroup.h
> -header-y += xt_cluster.h
> -header-y += xt_comment.h
> -header-y += xt_connbytes.h
> -header-y += xt_connlabel.h
> -header-y += xt_connlimit.h
> -header-y += xt_connmark.h
> -header-y += xt_conntrack.h
> -header-y += xt_cpu.h
> -header-y += xt_dccp.h
> -header-y += xt_devgroup.h
> -header-y += xt_dscp.h
> -header-y += xt_ecn.h
> -header-y += xt_esp.h
> -header-y += xt_hashlimit.h
> -header-y += xt_helper.h
> -header-y += xt_ipcomp.h
> -header-y += xt_iprange.h
> -header-y += xt_ipvs.h
> -header-y += xt_l2tp.h
> -header-y += xt_length.h
> -header-y += xt_limit.h
> -header-y += xt_mac.h
> -header-y += xt_mark.h
> -header-y += xt_multiport.h
> -header-y += xt_nfacct.h
> -header-y += xt_osf.h
> -header-y += xt_owner.h
> -header-y += xt_physdev.h
> -header-y += xt_pkttype.h
> -header-y += xt_policy.h
> -header-y += xt_quota.h
> -header-y += xt_rateest.h
> -header-y += xt_realm.h
> -header-y += xt_recent.h
> -header-y += xt_rpfilter.h
> -header-y += xt_sctp.h
> -header-y += xt_set.h
> -header-y += xt_socket.h
> -header-y += xt_state.h
> -header-y += xt_statistic.h
> -header-y += xt_string.h
> -header-y += xt_tcpmss.h
> -header-y += xt_tcpudp.h
> -header-y += xt_time.h
> -header-y += xt_u32.h
> diff --git a/include/uapi/linux/netfilter/ipset/Kbuild b/include/uapi/linux/netfilter/ipset/Kbuild
> deleted file mode 100644
> index d2680423d9ab..000000000000
> --- a/include/uapi/linux/netfilter/ipset/Kbuild
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -# UAPI Header export list
> -header-y += ip_set.h
> -header-y += ip_set_bitmap.h
> -header-y += ip_set_hash.h
> -header-y += ip_set_list.h
> diff --git a/include/uapi/linux/netfilter_arp/Kbuild b/include/uapi/linux/netfilter_arp/Kbuild
> deleted file mode 100644
> index 62d5637cc0ac..000000000000
> --- a/include/uapi/linux/netfilter_arp/Kbuild
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -# UAPI Header export list
> -header-y += arp_tables.h
> -header-y += arpt_mangle.h
> diff --git a/include/uapi/linux/netfilter_bridge/Kbuild b/include/uapi/linux/netfilter_bridge/Kbuild
> deleted file mode 100644
> index 0fbad8ef96de..000000000000
> --- a/include/uapi/linux/netfilter_bridge/Kbuild
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -# UAPI Header export list
> -header-y += ebt_802_3.h
> -header-y += ebt_among.h
> -header-y += ebt_arp.h
> -header-y += ebt_arpreply.h
> -header-y += ebt_ip.h
> -header-y += ebt_ip6.h
> -header-y += ebt_limit.h
> -header-y += ebt_log.h
> -header-y += ebt_mark_m.h
> -header-y += ebt_mark_t.h
> -header-y += ebt_nat.h
> -header-y += ebt_nflog.h
> -header-y += ebt_pkttype.h
> -header-y += ebt_redirect.h
> -header-y += ebt_stp.h
> -header-y += ebt_vlan.h
> -header-y += ebtables.h
> diff --git a/include/uapi/linux/netfilter_ipv4/Kbuild b/include/uapi/linux/netfilter_ipv4/Kbuild
> deleted file mode 100644
> index ecb291df390e..000000000000
> --- a/include/uapi/linux/netfilter_ipv4/Kbuild
> +++ /dev/null
> @@ -1,10 +0,0 @@
> -# UAPI Header export list
> -header-y += ip_tables.h
> -header-y += ipt_CLUSTERIP.h
> -header-y += ipt_ECN.h
> -header-y += ipt_LOG.h
> -header-y += ipt_REJECT.h
> -header-y += ipt_TTL.h
> -header-y += ipt_ah.h
> -header-y += ipt_ecn.h
> -header-y += ipt_ttl.h
> diff --git a/include/uapi/linux/netfilter_ipv6/Kbuild b/include/uapi/linux/netfilter_ipv6/Kbuild
> deleted file mode 100644
> index 75a668ca2353..000000000000
> --- a/include/uapi/linux/netfilter_ipv6/Kbuild
> +++ /dev/null
> @@ -1,13 +0,0 @@
> -# UAPI Header export list
> -header-y += ip6_tables.h
> -header-y += ip6t_HL.h
> -header-y += ip6t_LOG.h
> -header-y += ip6t_NPT.h
> -header-y += ip6t_REJECT.h
> -header-y += ip6t_ah.h
> -header-y += ip6t_frag.h
> -header-y += ip6t_hl.h
> -header-y += ip6t_ipv6header.h
> -header-y += ip6t_mh.h
> -header-y += ip6t_opts.h
> -header-y += ip6t_rt.h
> diff --git a/include/uapi/linux/nfsd/Kbuild b/include/uapi/linux/nfsd/Kbuild
> deleted file mode 100644
> index c11bc404053c..000000000000
> --- a/include/uapi/linux/nfsd/Kbuild
> +++ /dev/null
> @@ -1,6 +0,0 @@
> -# UAPI Header export list
> -header-y += cld.h
> -header-y += debug.h
> -header-y += export.h
> -header-y += nfsfh.h
> -header-y += stats.h
> diff --git a/include/uapi/linux/raid/Kbuild b/include/uapi/linux/raid/Kbuild
> deleted file mode 100644
> index e2c3d25405d7..000000000000
> --- a/include/uapi/linux/raid/Kbuild
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -# UAPI Header export list
> -header-y += md_p.h
> -header-y += md_u.h
> diff --git a/include/uapi/linux/spi/Kbuild b/include/uapi/linux/spi/Kbuild
> deleted file mode 100644
> index 0cc747eff165..000000000000
> --- a/include/uapi/linux/spi/Kbuild
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# UAPI Header export list
> -header-y += spidev.h
> diff --git a/include/uapi/linux/sunrpc/Kbuild b/include/uapi/linux/sunrpc/Kbuild
> deleted file mode 100644
> index 8e02e47c20fb..000000000000
> --- a/include/uapi/linux/sunrpc/Kbuild
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# UAPI Header export list
> -header-y += debug.h
> diff --git a/include/uapi/linux/tc_act/Kbuild b/include/uapi/linux/tc_act/Kbuild
> deleted file mode 100644
> index e3db7403296f..000000000000
> --- a/include/uapi/linux/tc_act/Kbuild
> +++ /dev/null
> @@ -1,15 +0,0 @@
> -# UAPI Header export list
> -header-y += tc_csum.h
> -header-y += tc_defact.h
> -header-y += tc_gact.h
> -header-y += tc_ipt.h
> -header-y += tc_mirred.h
> -header-y += tc_nat.h
> -header-y += tc_pedit.h
> -header-y += tc_skbedit.h
> -header-y += tc_vlan.h
> -header-y += tc_bpf.h
> -header-y += tc_connmark.h
> -header-y += tc_ife.h
> -header-y += tc_tunnel_key.h
> -header-y += tc_skbmod.h
> diff --git a/include/uapi/linux/tc_ematch/Kbuild b/include/uapi/linux/tc_ematch/Kbuild
> deleted file mode 100644
> index 53fca3925535..000000000000
> --- a/include/uapi/linux/tc_ematch/Kbuild
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -# UAPI Header export list
> -header-y += tc_em_cmp.h
> -header-y += tc_em_meta.h
> -header-y += tc_em_nbyte.h
> -header-y += tc_em_text.h
> diff --git a/include/uapi/linux/usb/Kbuild b/include/uapi/linux/usb/Kbuild
> deleted file mode 100644
> index 4cc4d6e7e523..000000000000
> --- a/include/uapi/linux/usb/Kbuild
> +++ /dev/null
> @@ -1,12 +0,0 @@
> -# UAPI Header export list
> -header-y += audio.h
> -header-y += cdc.h
> -header-y += cdc-wdm.h
> -header-y += ch11.h
> -header-y += ch9.h
> -header-y += functionfs.h
> -header-y += g_printer.h
> -header-y += gadgetfs.h
> -header-y += midi.h
> -header-y += tmc.h
> -header-y += video.h
> diff --git a/include/uapi/linux/wimax/Kbuild b/include/uapi/linux/wimax/Kbuild
> deleted file mode 100644
> index 1c97be49971f..000000000000
> --- a/include/uapi/linux/wimax/Kbuild
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# UAPI Header export list
> -header-y += i2400m.h
> diff --git a/include/uapi/misc/Kbuild b/include/uapi/misc/Kbuild
> deleted file mode 100644
> index e96cae7d58c9..000000000000
> --- a/include/uapi/misc/Kbuild
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# misc Header export list
> -header-y += cxl.h
> diff --git a/include/uapi/mtd/Kbuild b/include/uapi/mtd/Kbuild
> deleted file mode 100644
> index 5a691e10cd0e..000000000000
> --- a/include/uapi/mtd/Kbuild
> +++ /dev/null
> @@ -1,6 +0,0 @@
> -# UAPI Header export list
> -header-y += inftl-user.h
> -header-y += mtd-abi.h
> -header-y += mtd-user.h
> -header-y += nftl-user.h
> -header-y += ubi-user.h
> diff --git a/include/uapi/rdma/Kbuild b/include/uapi/rdma/Kbuild
> deleted file mode 100644
> index 82bdf5626859..000000000000
> --- a/include/uapi/rdma/Kbuild
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -# UAPI Header export list
> -header-y += ib_user_cm.h
> -header-y += ib_user_mad.h
> -header-y += ib_user_sa.h
> -header-y += ib_user_verbs.h
> -header-y += rdma_netlink.h
> -header-y += rdma_user_cm.h
> -header-y += hfi/
> -header-y += rdma_user_rxe.h
> -header-y += cxgb3-abi.h
> -header-y += cxgb4-abi.h
> -header-y += mlx4-abi.h
> -header-y += mlx5-abi.h
> -header-y += mthca-abi.h
> -header-y += nes-abi.h
> -header-y += ocrdma-abi.h
> -header-y += hns-abi.h
> -header-y += vmw_pvrdma-abi.h
> diff --git a/include/uapi/rdma/hfi/Kbuild b/include/uapi/rdma/hfi/Kbuild
> deleted file mode 100644
> index ef23c294fc71..000000000000
> --- a/include/uapi/rdma/hfi/Kbuild
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# UAPI Header export list
> -header-y += hfi1_user.h
> diff --git a/include/uapi/scsi/Kbuild b/include/uapi/scsi/Kbuild
> deleted file mode 100644
> index d791e0ad509d..000000000000
> --- a/include/uapi/scsi/Kbuild
> +++ /dev/null
> @@ -1,6 +0,0 @@
> -# UAPI Header export list
> -header-y += fc/
> -header-y += scsi_bsg_fc.h
> -header-y += scsi_netlink.h
> -header-y += scsi_netlink_fc.h
> -header-y += cxlflash_ioctl.h
> diff --git a/include/uapi/scsi/fc/Kbuild b/include/uapi/scsi/fc/Kbuild
> deleted file mode 100644
> index 5ead9fac265c..000000000000
> --- a/include/uapi/scsi/fc/Kbuild
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -# UAPI Header export list
> -header-y += fc_els.h
> -header-y += fc_fs.h
> -header-y += fc_gs.h
> -header-y += fc_ns.h
> diff --git a/include/uapi/sound/Kbuild b/include/uapi/sound/Kbuild
> deleted file mode 100644
> index 9578d8bdbf31..000000000000
> --- a/include/uapi/sound/Kbuild
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -# UAPI Header export list
> -header-y += asequencer.h
> -header-y += asoc.h
> -header-y += asound.h
> -header-y += asound_fm.h
> -header-y += compress_offload.h
> -header-y += compress_params.h
> -header-y += emu10k1.h
> -header-y += firewire.h
> -header-y += hdsp.h
> -header-y += hdspm.h
> -header-y += sb16_csp.h
> -header-y += sfnt_info.h
> -header-y += tlv.h
> -header-y += usb_stream.h
> -header-y += snd_sst_tokens.h
> diff --git a/include/uapi/video/Kbuild b/include/uapi/video/Kbuild
> deleted file mode 100644
> index ac7203bb32cc..000000000000
> --- a/include/uapi/video/Kbuild
> +++ /dev/null
> @@ -1,4 +0,0 @@
> -# UAPI Header export list
> -header-y += edid.h
> -header-y += sisfb.h
> -header-y += uvesafb.h
> diff --git a/include/uapi/xen/Kbuild b/include/uapi/xen/Kbuild
> deleted file mode 100644
> index 5c459628e8c7..000000000000
> --- a/include/uapi/xen/Kbuild
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -# UAPI Header export list
> -header-y += evtchn.h
> -header-y += gntalloc.h
> -header-y += gntdev.h
> -header-y += privcmd.h
> diff --git a/include/video/Kbuild b/include/video/Kbuild
> deleted file mode 100644
> index e69de29bb2d1..000000000000
> diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
> index 876b42cfede4..bb93f8466a35 100644
> --- a/scripts/Makefile.headersinst
> +++ b/scripts/Makefile.headersinst
> @@ -1,17 +1,18 @@
>  # ==========================================================================
>  # Installing headers
>  #
> -# header-y  - list files to be installed. They are preprocessed
> -#             to remove __KERNEL__ section of the file
> -# genhdr-y  - Same as header-y but in a generated/ directory
> +# All headers under include/uapi, include/generated/uapi,
> +# arch/<arch>/include/uapi/asm and /include/generated/uapi/asm are exported.
> +# They are preprocessed to remove __KERNEL__ section of the file.
>  #
>  # ==========================================================================
>  
>  # generated header directory
>  gen := $(if $(gen),$(gen),$(subst include/,include/generated/,$(obj)))
>  
> +# Kbuild file is optional
>  kbuild-file := $(srctree)/$(obj)/Kbuild
> -include $(kbuild-file)
> +-include $(kbuild-file)
>  
>  # called may set destination dir (when installing to asm/)
>  _dst := $(if $(dst),$(dst),$(obj))
> @@ -25,9 +26,12 @@ include scripts/Kbuild.include
>  
>  installdir    := $(INSTALL_HDR_PATH)/$(subst uapi/,,$(_dst))
>  
> -header-y      := $(sort $(header-y))
> -subdirs       := $(patsubst %/,%,$(filter %/, $(header-y)))
> -header-y      := $(filter-out %/, $(header-y))
> +subdirs       := $(patsubst $(srctree)/$(obj)/%/.,%,$(wildcard $(srctree)/$(obj)/*/.))
> +subdirs       += $(subdir-y)
> +header-files  := $(notdir $(wildcard $(srctree)/$(obj)/*.h))
> +header-files  += $(notdir $(wildcard $(srctree)/$(obj)/*.agh))
> +genhdr-files  := $(notdir $(wildcard $(srctree)/$(gen)/*.h))
> +genhdr-files  := $(filter-out $(header-files), $(genhdr-files))
>  
>  # files used to track state of install/check
>  install-file  := $(installdir)/.install
> @@ -35,26 +39,17 @@ check-file    := $(installdir)/.check
>  
>  # generic-y list all files an architecture uses from asm-generic
>  # Use this to build a list of headers which require a wrapper
> -wrapper-files := $(filter $(header-y), $(generic-y))
> +generic-files := $(notdir $(wildcard $(srctree)/include/uapi/asm-generic/*.h))
> +wrapper-files := $(filter $(generic-files), $(generic-y))
> +wrapper-files := $(filter-out $(header-files), $(wrapper-files))
>  
>  srcdir        := $(srctree)/$(obj)
>  gendir        := $(objtree)/$(gen)
>  
>  # all headers files for this dir
> -header-y      := $(filter-out $(generic-y), $(header-y))
> -all-files     := $(header-y) $(genhdr-y) $(wrapper-files)
> +all-files     := $(header-files) $(genhdr-files) $(wrapper-files)
>  output-files  := $(addprefix $(installdir)/, $(all-files))
>  
> -# Check that all expected files exist
> -$(foreach hdr, $(header-y), \
> -  $(if $(wildcard $(srcdir)/$(hdr)),, \
> -       $(error Missing UAPI file $(srcdir)/$(hdr)) \
> -   ))
> -$(foreach hdr, $(genhdr-y), \
> -  $(if	$(wildcard $(gendir)/$(hdr)),, \
> -       $(error Missing generated UAPI file $(gendir)/$(hdr)) \
> -  ))
> -
>  # Work out what needs to be removed
>  oldheaders    := $(patsubst $(installdir)/%,%,$(wildcard $(installdir)/*.h))
>  unwanted      := $(filter-out $(all-files),$(oldheaders))
> @@ -67,8 +62,8 @@ printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@))
>  quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\
>                              file$(if $(word 2, $(all-files)),s))
>        cmd_install = \
> -        $(CONFIG_SHELL) $< $(installdir) $(srcdir) $(header-y); \
> -        $(CONFIG_SHELL) $< $(installdir) $(gendir) $(genhdr-y); \
> +        $(CONFIG_SHELL) $< $(installdir) $(srcdir) $(header-files); \
> +        $(CONFIG_SHELL) $< $(installdir) $(gendir) $(genhdr-files); \
>          for F in $(wrapper-files); do                                   \
>                  echo "\#include <asm-generic/$$F>" > $(installdir)/$$F;    \
>          done;                                                           \
> -- 
> 2.8.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-doc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply

* Re: Interesting mdadm quirk ...
From: Wols Lists @ 2017-01-09  6:59 UTC (permalink / raw)
  To: NeilBrown, linux-raid; +Cc: jes.sorensen
In-Reply-To: <87mvf1jhnu.fsf@notabene.neil.brown.name>

On 08/01/17 22:44, NeilBrown wrote:
> On Sun, Jan 08 2017, Wols Lists wrote:
> 
>> Just been doing some raid testing, and this happened ...
>>
>> linux-lfqf:/dev # mdadm md/parity
>> md/parity: 31.97GiB raid5 3 devices, 0 spares. Use mdadm --detail for
>> more detail.
>> linux-lfqf:/dev # mdadm --stop md/parity
>> mdadm: Cannot open md/parity
>> linux-lfqf:/dev # mdadm --stop /dev/md/parity
>> mdadm: stopped /dev/md/parity
>>
>> Weird - why can it successfully stop it when passed an absolute path,
>> but not when passed a relative path? When I did the first variant, I
>> used tab completion, and then when I edited it I really did edit it, not
>> retype it, so I can't see any way the two arguments could refer to
>> different objects.
> 
> If you give mdadm a name of an array that start with "/", it is assumed
> to be a path name (usually in /dev).
> If it doesn't start with "/", then it is an array name.  The might mean
> different things in different contexts, I'm not 100% sure.
> However, for --stop, it a name like you would find is /sys/block or
> /proc/mdstat.
> So "mdadm --stop md0" or "mdadm --stop md_parity" might do what you
> want.
> Probably the error message could be more useful here.
> 
Does that mean an array name can contain a "/"?

Assuming it can't, surely it's better to alter the logic slightly...

if char[0] ne '/' then
  open array_name
end
if not successful then
  open path_name
  if error then go error_handler
end
carry on ...

That way naive users like me won't get a surprise. And it is rather
inconsistent for it to work with one sort of path but not another ...
and actually that logic will work fine even if the name does contain a
"/" :-)

Cheers,
Wol


^ permalink raw reply

* Re: using the raid6check report
From: Eyal Lebedinsky @ 2017-01-09  2:13 UTC (permalink / raw)
  To: list linux-raid
In-Reply-To: <87h959j8ss.fsf@notabene.neil.brown.name>

On 09/01/17 12:56, NeilBrown wrote:
> On Mon, Jan 09 2017, Eyal Lebedinsky wrote:
>
>>
>> I am aware of that discussion and agree with the sentiment (fix in user space).
>
> (I primarily provided for the information of others)
>
>> What I miss is a message from md when a 'check' mismatch is found. Not having
>> this means I have to run 'raid6check', then after looking at the situation
>> run 'raid6check autorepair' in the small sections reported as bad. This is time
>> consuming and risky.
>
> Something like this?
>
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 69b0a169e43d..f19c38baf2b2 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -2738,6 +2738,8 @@ static void handle_parity_checks5(raid5_conf_t *conf, struct stripe_head *sh,
>  			conf->mddev->resync_mismatches += STRIPE_SECTORS;
>  			if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery))
>  				/* don't try to repair!! */
> +				pr_debug("%s: \"check\" found inconsistency near sector %llu\n",
> +					 md_name(conf->mddev), sh->sector);
>  				set_bit(STRIPE_INSYNC, &sh->state);
>  			else {
>  				sh->check_state = check_state_compute_run;
>
>
> I chose pr_debug() because I didn't want to flood the logs if there are
> lots of inconsistencies.
> You can selectively enable pr_debug() messages by writing to
> /sys/kernel/debug/dynamic_debug/control
> providing you have dynamic debugging compiled in.

I run fedora and can see the dynamic debugging control file.

> Maybe use pr_info_ratelimited() instead??

Yes, rate limiting is probably a good idea when we have a really bad day.

> NeilBrown

-- 
Eyal Lebedinsky (eyal@eyal.emu.id.au)

^ permalink raw reply

* Re: using the raid6check report
From: NeilBrown @ 2017-01-09  1:56 UTC (permalink / raw)
  To: Eyal Lebedinsky, list linux-raid
In-Reply-To: <62f5d174-0aef-5a70-68c3-26f7763b5e61@eyal.emu.id.au>

[-- Attachment #1: Type: text/plain, Size: 1376 bytes --]

On Mon, Jan 09 2017, Eyal Lebedinsky wrote:

>
> I am aware of that discussion and agree with the sentiment (fix in user space).

(I primarily provided for the information of others)

> What I miss is a message from md when a 'check' mismatch is found. Not having
> this means I have to run 'raid6check', then after looking at the situation
> run 'raid6check autorepair' in the small sections reported as bad. This is time
> consuming and risky.

Something like this?

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 69b0a169e43d..f19c38baf2b2 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -2738,6 +2738,8 @@ static void handle_parity_checks5(raid5_conf_t *conf, struct stripe_head *sh,
 			conf->mddev->resync_mismatches += STRIPE_SECTORS;
 			if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery))
 				/* don't try to repair!! */
+				pr_debug("%s: \"check\" found inconsistency near sector %llu\n",
+					 md_name(conf->mddev), sh->sector);
 				set_bit(STRIPE_INSYNC, &sh->state);
 			else {
 				sh->check_state = check_state_compute_run;


I chose pr_debug() because I didn't want to flood the logs if there are
lots of inconsistencies.
You can selectively enable pr_debug() messages by writing to
/sys/kernel/debug/dynamic_debug/control
providing you have dynamic debugging compiled in.

Maybe use pr_info_ratelimited() instead??

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply related

* Re: using the raid6check report
From: Eyal Lebedinsky @ 2017-01-09  0:32 UTC (permalink / raw)
  To: list linux-raid
In-Reply-To: <87pojxjhwt.fsf@notabene.neil.brown.name>

On 09/01/17 09:39, NeilBrown wrote:
> On Mon, Jan 09 2017, Piergiorgio Sartor wrote:
>
[trim]
>>
>> There was a patch adding the write capability,
>> but likely only for the C code, not the man page.
>>
>>>
>>> I can add it to the wiki as a little programming project, but it would
>>> be nice to know the exact status of things - my raid-fu isn't good
>>> enough at present to read the code and work out what's going on.
>>>
>>> It would be nice to be able to write "parity-check" or somesuch to
>>> sync_action, and then for raid5 it would check and update parity, or
>>> raid6 it would check and correct data/parity.
>>
>> At that time, the agreement with Neil was to do
>> such things in user space and not inside the
>> md raid "driver" (so to speak) in kernal space.
>
> This is correct.
>
> With RAID6 it is possible to determine, with high reliability, if a
> single device is corrupt.  There is a mathematical function that can be
> calculated over a set of bytes, one from each device.  If the result is
> a number less than the number of devices in the array (including P and
> Q), then the device with that index number is corrupt (or at least, both
> P and Q can be made correct again by simply changing that one byte).  If
> we compute that function over all 512 (or 4096) bytes in a stripe and
> they all report the same device (or report that there are no errors for
> some bytes) then it is reasonable to assume the block on the identified
> device is corrupt.
>
> raid6check does this and provides very useful functionality for a
> sysadmin to determine which device is corrupt, and to then correct that
> if they wish.
>
> However, I am not comfortable with having that be done transparently
> without any confirmation from the sysadmin.  This is because I don't
> have a credible threat model for how the corruption could have happened
> in the first place.  I understand how hardware failure can make a whole
> device unaccessible, and how media errors can cause a single block to be
> unreadable.  But I don't see a "most likely way" that a single block can
> become corrupt.
>
> Without a clear model, I cannot determine what the correct response is.
> The corruption might have happened on the write path ... so re-writing
> the block could just cause more corruption.  It could have happened on
> the read path, so re-writing won't change anything.  It could have
> happened in memory, so nothing can be trusted.  It could have happened
> due to buggy code.  Without knowing the cause with high probability, it
> is not safe to try to fix anything.
>
> The most likely cause for incorrect P and Q is if the machine crashed
> which a stipe was being updated. In that case, simply updating P and Q
> is the correct response.  So that is the only response that the kernel
> performs.
>
> For more reading, see http://neil.brown.name/blog/20100211050355
>
> NeilBrown
[trim]

I am aware of that discussion and agree with the sentiment (fix in user space).
What I miss is a message from md when a 'check' mismatch is found. Not having
this means I have to run 'raid6check', then after looking at the situation
run 'raid6check autorepair' in the small sections reported as bad. This is time
consuming and risky.

What I resort to doing now is 'cat /proc/mdstat' repeatedly during md 'check'
and use the report as a clue to the location of problem stripes.

-- 
Eyal Lebedinsky (eyal@eyal.emu.id.au)

^ permalink raw reply

* Re: Interesting mdadm quirk ...
From: NeilBrown @ 2017-01-08 22:44 UTC (permalink / raw)
  To: Wols Lists, linux-raid
In-Reply-To: <5870EB3F.2060206@youngman.org.uk>

[-- Attachment #1: Type: text/plain, Size: 1468 bytes --]

On Sun, Jan 08 2017, Wols Lists wrote:

> Just been doing some raid testing, and this happened ...
>
> linux-lfqf:/dev # mdadm md/parity
> md/parity: 31.97GiB raid5 3 devices, 0 spares. Use mdadm --detail for
> more detail.
> linux-lfqf:/dev # mdadm --stop md/parity
> mdadm: Cannot open md/parity
> linux-lfqf:/dev # mdadm --stop /dev/md/parity
> mdadm: stopped /dev/md/parity
>
> Weird - why can it successfully stop it when passed an absolute path,
> but not when passed a relative path? When I did the first variant, I
> used tab completion, and then when I edited it I really did edit it, not
> retype it, so I can't see any way the two arguments could refer to
> different objects.

If you give mdadm a name of an array that start with "/", it is assumed
to be a path name (usually in /dev).
If it doesn't start with "/", then it is an array name.  The might mean
different things in different contexts, I'm not 100% sure.
However, for --stop, it a name like you would find is /sys/block or
/proc/mdstat.
So "mdadm --stop md0" or "mdadm --stop md_parity" might do what you
want.
Probably the error message could be more useful here.

NeilBrown


>
> Oh - and
>
> mdadm --version
> mdadm - v3.4 - 28th January 2016
>
> ie stock SuSE leap 42.2
>
> Cheers,
> Wol
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply

* Re: using the raid6check report
From: NeilBrown @ 2017-01-08 22:39 UTC (permalink / raw)
  To: Wols Lists; +Cc: Piergiorgio Sartor, Eyal Lebedinsky, list linux-raid
In-Reply-To: <20170108214111.GA7933@lazy.lzy>

[-- Attachment #1: Type: text/plain, Size: 5096 bytes --]

On Mon, Jan 09 2017, Piergiorgio Sartor wrote:

> On Sun, Jan 08, 2017 at 08:52:40PM +0000, Wols Lists wrote:
>> On 08/01/17 17:40, Piergiorgio Sartor wrote:
>> > On Fri, Dec 23, 2016 at 11:56:34AM +1100, Eyal Lebedinsky wrote:
>> >> > From time to time I get non-zero mismatch_count in the weekly scrub. The way I handle
>> >> > it is to run a check around the stripe (I have a background job printing the mismatch
>> >> > count and /proc/mdstat regularly) which should report the same count.
>> >> > 
>> >> > I now drill into the fs to find which files use this area, deal with them and delete
>> >> > the bad ones. I then run a repair on that small area.
>> >> > 
>> >> > I now found about raid6check which can actually tell me which disk holds the bad data.
>> >> > This is something raid6 should be able to do assuming a single error.
>> >> > Hoping it is one bad disk, the simple solution now is to recover the bad stripe on
>> >> > that disk.
>> >> > 
>> >> > Will a 'repair' rewrite the bad disk or just create fresh P+Q which may just make the
>> >> > bad data invisible to a 'check'? I recall this being the case in the past.
>> > "repair" should fix the data which is assumed
>> > to be wrong.
>> > It should not simply correct P+Q, but really
>> > find out which disk is not OK and fix it.
>> > 
>> Having just looked at the man page and the source to raid6check as found
>> online ...
>> 
>> "man raid6check" says that it does not write to the disk. Looking at the
>> source, it appears to have code that is intended to write to the disk
>> and repair the stripe. So what's going on?
>
> There was a patch adding the write capability,
> but likely only for the C code, not the man page.
>
>> 
>> I can add it to the wiki as a little programming project, but it would
>> be nice to know the exact status of things - my raid-fu isn't good
>> enough at present to read the code and work out what's going on.
>> 
>> It would be nice to be able to write "parity-check" or somesuch to
>> sync_action, and then for raid5 it would check and update parity, or
>> raid6 it would check and correct data/parity.
>
> At that time, the agreement with Neil was to do
> such things in user space and not inside the
> md raid "driver" (so to speak) in kernal space.

This is correct.

With RAID6 it is possible to determine, with high reliability, if a
single device is corrupt.  There is a mathematical function that can be
calculated over a set of bytes, one from each device.  If the result is
a number less than the number of devices in the array (including P and
Q), then the device with that index number is corrupt (or at least, both
P and Q can be made correct again by simply changing that one byte).  If
we compute that function over all 512 (or 4096) bytes in a stripe and
they all report the same device (or report that there are no errors for
some bytes) then it is reasonable to assume the block on the identified
device is corrupt.

raid6check does this and provides very useful functionality for a
sysadmin to determine which device is corrupt, and to then correct that
if they wish.

However, I am not comfortable with having that be done transparently
without any confirmation from the sysadmin.  This is because I don't
have a credible threat model for how the corruption could have happened
in the first place.  I understand how hardware failure can make a whole
device unaccessible, and how media errors can cause a single block to be
unreadable.  But I don't see a "most likely way" that a single block can
become corrupt.

Without a clear model, I cannot determine what the correct response is.
The corruption might have happened on the write path ... so re-writing
the block could just cause more corruption.  It could have happened on
the read path, so re-writing won't change anything.  It could have
happened in memory, so nothing can be trusted.  It could have happened
due to buggy code.  Without knowing the cause with high probability, it
is not safe to try to fix anything.

The most likely cause for incorrect P and Q is if the machine crashed
which a stipe was being updated. In that case, simply updating P and Q
is the correct response.  So that is the only response that the kernel
performs.

For more reading, see http://neil.brown.name/blog/20100211050355

NeilBrown


>
> So, as far as I know, the kernel md code can
> check the parity and, possibily, re-write.
>
> "raid6check" can detect errors *and*, if only one,
> where it is, so a "data repair" capability is possible.
>
> bye,
>
> pg
>  
>> Cheers,
>> Wol
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> -- 
>
> piergiorgio
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply

* Re: using the raid6check report
From: Piergiorgio Sartor @ 2017-01-08 21:43 UTC (permalink / raw)
  To: Wols Lists; +Cc: Piergiorgio Sartor, Eyal Lebedinsky, linux-raid
In-Reply-To: <5872A9C6.7010408@youngman.org.uk>

On Sun, Jan 08, 2017 at 09:06:14PM +0000, Wols Lists wrote:
> On 08/01/17 20:46, Piergiorgio Sartor wrote:
> > "should" as in "it is supposed to do it".
> > 
> > So, as far as I know, "raid6check" with "repair" will
> > check the parity and try to find errors.
> > If possible, it will find where the error is, then
> > re-compute the value and write the corrected data.
> > 
> > Now, this was somehow tested and *should* work.
> > 
> > An other option is just to check for the errors and
> > see if one drive is constantly at fault.
> > This will not write anything, so it is safer, but
> > it will help to see if there are strange things,
> > before writing to the disk(s).
> 
> Hmmm ...
> 
> I've now been thinking about it, and actually I'm not sure it's possible
> even with raid6, to correct a corrupt read. The thing is, raid protects
> against a failure to read - if a sector fails, the parity will re-create
> it. But if a data sector is corrupted, how is raid to know WHICH sector?

Here all you need to know:

http://ftp.nluug.nl/ftp/ftp/os/Linux/system/kernel/people/hpa/raid6.pdf

bye,

pg

> 
> If one of the parity sectors is corrupted, it's easy. Calculate parity
> from the data, and either P or Q will be wrong, so fix it. But if it's a
> *data* sector that's corrupted, both P and Q will be wrong. How easy is
> it to work back from that, and work out *which* data sector is wrong? My
> fu makes me think you can't, though I could quite easily be wrong :-)
> 
> But should that even happen, unless a disk is on its way out, anyway? I
> remember years ago, back in the 80s, our minicomputers had
> error-correction in the drive. I don't remember the algorithm, but it
> wrote 16-bit words to disk - each an 8-bit data byte. The first half was
> the original data, and the second half was some parity pattern such that
> for any single-bit corruption you knew which half was corrupt, and you
> could throw away the corrupt parity, or recreate the correct data from
> the parity. Even with a 2-bit error I think it was >90% detection and
> recreation. I can't imagine something like that not being in drive
> hardware today.
> 
> Cheers,
> Wol

-- 

piergiorgio

^ permalink raw reply

* Re: using the raid6check report
From: Piergiorgio Sartor @ 2017-01-08 21:41 UTC (permalink / raw)
  To: Wols Lists; +Cc: Piergiorgio Sartor, Eyal Lebedinsky, list linux-raid
In-Reply-To: <5872A698.7000009@youngman.org.uk>

On Sun, Jan 08, 2017 at 08:52:40PM +0000, Wols Lists wrote:
> On 08/01/17 17:40, Piergiorgio Sartor wrote:
> > On Fri, Dec 23, 2016 at 11:56:34AM +1100, Eyal Lebedinsky wrote:
> >> > From time to time I get non-zero mismatch_count in the weekly scrub. The way I handle
> >> > it is to run a check around the stripe (I have a background job printing the mismatch
> >> > count and /proc/mdstat regularly) which should report the same count.
> >> > 
> >> > I now drill into the fs to find which files use this area, deal with them and delete
> >> > the bad ones. I then run a repair on that small area.
> >> > 
> >> > I now found about raid6check which can actually tell me which disk holds the bad data.
> >> > This is something raid6 should be able to do assuming a single error.
> >> > Hoping it is one bad disk, the simple solution now is to recover the bad stripe on
> >> > that disk.
> >> > 
> >> > Will a 'repair' rewrite the bad disk or just create fresh P+Q which may just make the
> >> > bad data invisible to a 'check'? I recall this being the case in the past.
> > "repair" should fix the data which is assumed
> > to be wrong.
> > It should not simply correct P+Q, but really
> > find out which disk is not OK and fix it.
> > 
> Having just looked at the man page and the source to raid6check as found
> online ...
> 
> "man raid6check" says that it does not write to the disk. Looking at the
> source, it appears to have code that is intended to write to the disk
> and repair the stripe. So what's going on?

There was a patch adding the write capability,
but likely only for the C code, not the man page.

> 
> I can add it to the wiki as a little programming project, but it would
> be nice to know the exact status of things - my raid-fu isn't good
> enough at present to read the code and work out what's going on.
> 
> It would be nice to be able to write "parity-check" or somesuch to
> sync_action, and then for raid5 it would check and update parity, or
> raid6 it would check and correct data/parity.

At that time, the agreement with Neil was to do
such things in user space and not inside the
md raid "driver" (so to speak) in kernal space.

So, as far as I know, the kernel md code can
check the parity and, possibily, re-write.

"raid6check" can detect errors *and*, if only one,
where it is, so a "data repair" capability is possible.

bye,

pg
 
> Cheers,
> Wol
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 

piergiorgio

^ permalink raw reply

* Re: using the raid6check report
From: Eyal Lebedinsky @ 2017-01-08 21:20 UTC (permalink / raw)
  To: linux-raid
In-Reply-To: <5872A9C6.7010408@youngman.org.uk>

On 09/01/17 08:06, Wols Lists wrote:
> On 08/01/17 20:46, Piergiorgio Sartor wrote:
[trim]

> If one of the parity sectors is corrupted, it's easy. Calculate parity
> from the data, and either P or Q will be wrong, so fix it. But if it's a
> *data* sector that's corrupted, both P and Q will be wrong. How easy is
> it to work back from that, and work out *which* data sector is wrong? My
> fu makes me think you can't, though I could quite easily be wrong :-)

My understanding of RAID6 is that you CAN say which of the data/P/Q is
wrong if one assumes only one is wrong.

Is this not what raid6check claims to do?
	"In case of parity mismatches, "raid6check" reports, if possible,
	"which component drive could be responsible"

> But should that even happen, unless a disk is on its way out, anyway?

Not so. I get, from time to time, non zero mismatch where I saw no disk
errors of any sort in kernel messages or in smart status.

> I remember years ago, back in the 80s, our minicomputers had
> error-correction in the drive. I don't remember the algorithm, but it
> wrote 16-bit words to disk - each an 8-bit data byte. The first half was
> the original data, and the second half was some parity pattern such that
> for any single-bit corruption you knew which half was corrupt, and you
> could throw away the corrupt parity, or recreate the correct data from
> the parity. Even with a 2-bit error I think it was >90% detection and
> recreation. I can't imagine something like that not being in drive
> hardware today.

The disk thinks it has good data but md thinks not. Maybe bad data was
written due to some other bug? A corner case when the system rebooted
unexpectedly? Maybe the controller corrupted the data?

> Cheers,
> Wol

-- 
Eyal Lebedinsky (eyal@eyal.emu.id.au)

^ permalink raw reply

* Re: using the raid6check report
From: Wols Lists @ 2017-01-08 21:06 UTC (permalink / raw)
  To: Piergiorgio Sartor, Eyal Lebedinsky; +Cc: linux-raid
In-Reply-To: <20170108204659.GB7057@lazy.lzy>

On 08/01/17 20:46, Piergiorgio Sartor wrote:
> "should" as in "it is supposed to do it".
> 
> So, as far as I know, "raid6check" with "repair" will
> check the parity and try to find errors.
> If possible, it will find where the error is, then
> re-compute the value and write the corrected data.
> 
> Now, this was somehow tested and *should* work.
> 
> An other option is just to check for the errors and
> see if one drive is constantly at fault.
> This will not write anything, so it is safer, but
> it will help to see if there are strange things,
> before writing to the disk(s).

Hmmm ...

I've now been thinking about it, and actually I'm not sure it's possible
even with raid6, to correct a corrupt read. The thing is, raid protects
against a failure to read - if a sector fails, the parity will re-create
it. But if a data sector is corrupted, how is raid to know WHICH sector?

If one of the parity sectors is corrupted, it's easy. Calculate parity
from the data, and either P or Q will be wrong, so fix it. But if it's a
*data* sector that's corrupted, both P and Q will be wrong. How easy is
it to work back from that, and work out *which* data sector is wrong? My
fu makes me think you can't, though I could quite easily be wrong :-)

But should that even happen, unless a disk is on its way out, anyway? I
remember years ago, back in the 80s, our minicomputers had
error-correction in the drive. I don't remember the algorithm, but it
wrote 16-bit words to disk - each an 8-bit data byte. The first half was
the original data, and the second half was some parity pattern such that
for any single-bit corruption you knew which half was corrupt, and you
could throw away the corrupt parity, or recreate the correct data from
the parity. Even with a 2-bit error I think it was >90% detection and
recreation. I can't imagine something like that not being in drive
hardware today.

Cheers,
Wol

^ permalink raw reply

* Re: using the raid6check report
From: Wols Lists @ 2017-01-08 20:52 UTC (permalink / raw)
  To: Piergiorgio Sartor, Eyal Lebedinsky; +Cc: list linux-raid
In-Reply-To: <20170108174010.GA3699@lazy.lzy>

On 08/01/17 17:40, Piergiorgio Sartor wrote:
> On Fri, Dec 23, 2016 at 11:56:34AM +1100, Eyal Lebedinsky wrote:
>> > From time to time I get non-zero mismatch_count in the weekly scrub. The way I handle
>> > it is to run a check around the stripe (I have a background job printing the mismatch
>> > count and /proc/mdstat regularly) which should report the same count.
>> > 
>> > I now drill into the fs to find which files use this area, deal with them and delete
>> > the bad ones. I then run a repair on that small area.
>> > 
>> > I now found about raid6check which can actually tell me which disk holds the bad data.
>> > This is something raid6 should be able to do assuming a single error.
>> > Hoping it is one bad disk, the simple solution now is to recover the bad stripe on
>> > that disk.
>> > 
>> > Will a 'repair' rewrite the bad disk or just create fresh P+Q which may just make the
>> > bad data invisible to a 'check'? I recall this being the case in the past.
> "repair" should fix the data which is assumed
> to be wrong.
> It should not simply correct P+Q, but really
> find out which disk is not OK and fix it.
> 
Having just looked at the man page and the source to raid6check as found
online ...

"man raid6check" says that it does not write to the disk. Looking at the
source, it appears to have code that is intended to write to the disk
and repair the stripe. So what's going on?

I can add it to the wiki as a little programming project, but it would
be nice to know the exact status of things - my raid-fu isn't good
enough at present to read the code and work out what's going on.

It would be nice to be able to write "parity-check" or somesuch to
sync_action, and then for raid5 it would check and update parity, or
raid6 it would check and correct data/parity.

Cheers,
Wol

^ permalink raw reply

* Re: mdadm hangs during raid5 grow
From: Sebastian Reichel @ 2017-01-08 20:50 UTC (permalink / raw)
  To: linux-raid
In-Reply-To: <20170104064210.4exlw2rdbe2fcal2@earth>

[-- Attachment #1: Type: text/plain, Size: 10928 bytes --]

Hi,

On Wed, Jan 04, 2017 at 07:42:11AM +0100, Sebastian Reichel wrote:
> I have a problem with hanging mdadm reshape task at 100% CPU load
> (kernel thread "md2_raid5"). Any operation on the raid (i.e. mdadm
> -S) is also hanging.  Rebooting worked, but after triggering the
> reshape (mdadm --readwrite /dev/md2) I get the same behaviour.
> 
> dmesg has this stacktrace:
> 
> [ 1813.500745] INFO: task md2_resync:3377 blocked for more than 120 seconds.
> [ 1813.500778]       Not tainted 4.8.0-2-amd64 #1
> [ 1813.500795] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> [ 1813.500822] md2_resync      D ffff93207bc98180     0  3377      2 0x00000000
> [ 1813.500827]  ffff93206f46d000 ffff93207642a1c0 0000000000000246 ffff932059607bf0
> [ 1813.500829]  ffff932059608000 ffff93206effc400 ffff93206effc688 ffff932059607d24
> [ 1813.500830]  ffff932059607bf0 ffff93206e0a3000 ffffffffbc7eb6d1 ffff93206e0a3000
> [ 1813.500832] Call Trace:
> [ 1813.500841]  [<ffffffffbc7eb6d1>] ? schedule+0x31/0x80
> [ 1813.500847]  [<ffffffffc0356924>] ? reshape_request+0x7b4/0x910 [raid456]
> [ 1813.500851]  [<ffffffffbc2bce80>] ? wake_atomic_t_function+0x60/0x60
> [ 1813.500854]  [<ffffffffc0356da3>] ? raid5_sync_request+0x323/0x3a0 [raid456]
> [ 1813.500862]  [<ffffffffc0271b50>] ? is_mddev_idle+0x98/0xf3 [md_mod]
> [ 1813.500866]  [<ffffffffc02649a9>] ? md_do_sync+0x959/0xed0 [md_mod]
> [ 1813.500868]  [<ffffffffbc2bce80>] ? wake_atomic_t_function+0x60/0x60
> [ 1813.500872]  [<ffffffffc0261363>] ? md_thread+0x133/0x140 [md_mod]
> [ 1813.500873]  [<ffffffffbc7eb1c9>] ? __schedule+0x289/0x760
> [ 1813.500877]  [<ffffffffc0261230>] ? find_pers+0x70/0x70 [md_mod]
> [ 1813.500879]  [<ffffffffbc29aecd>] ? kthread+0xcd/0xf0
> [ 1813.500881]  [<ffffffffbc7efcaf>] ? ret_from_fork+0x1f/0x40
> [ 1813.500883]  [<ffffffffbc29ae00>] ? kthread_create_on_node+0x190/0x190
> 
> Is this a known bug / some patch available?

I also tried 4.9.0-rc8, which was easily available without trying to
find a working kernel config for the system and the error persists.
I have some more information:

mars# gdb /usr/lib/debug/lib/modules/4.9.0-rc8-amd64/kernel/drivers/md/raid456.ko
(gdb) info line *reshape_request+0x6dd
Line 5481 of "./drivers/md/raid5.c" starts at address 0xe8e4 <reshape_request+1748> and ends at 0xe8fd <reshape_request+1773>.

=> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/md/raid5.c?h=v4.9-rc8#n5481
=> wait_event(conf->wait_for_overlap, atomic_read(&conf->reshape_stripes) == 0 || test_bit(MD_RECOVERY_INTR, &mddev->recovery));

Also if I enable debug messages in raid5.c I get this from from
[md2_raid5], which is running at 100% cpu on one of the cores (Note
regarding the failed state: I'm pretty sure the disks are ok and I
can use the raid, if I mount it read-only).

# echo "file raid5.c +p" > /sys/kernel/debug/dynamic_debug/control
# dmesg | grep-random-sample
[41658.396897] locked=1 uptodate=4 to_read=0 to_write=0 failed=2 failed_num=2,1
[41658.396904] check 3: state 0x13 read           (null) write           (null) written           (null)
[41658.397113] check 0: state 0x811 read           (null) write           (null) written           (null)
[41658.397139] check 0: state 0x811 read           (null) write           (null) written           (null)
[41658.397163] check 1: state 0xa01 read           (null) write           (null) written           (null)
[41658.397192] handling stripe 20206728, state=0x1401 cnt=1, pd_idx=2, qd_idx=-1
, check:0, reconstruct:6
[41658.397222] schedule_reconstruction: stripe 20206728 locked: 2 ops_request: 10
[41658.397251] check 1: state 0xa01 read           (null) write           (null) written           (null)
[41658.397277] ops_complete_reconstruct: stripe 20206736
[41658.397296] check 1: state 0xa01 read           (null) write           (null) written           (null)
[41658.397328] check 0: state 0x811 read           (null) write           (null) written           (null)
[41658.397351] check 3: state 0x13 read           (null) write           (null) written           (null)
[41658.397368] locked=1 uptodate=4 to_read=0 to_write=0 failed=2 failed_num=2,1
[41658.397387] ops_complete_reconstruct: stripe 20206112
[41658.397395] __get_priority_stripe: handle: busy hold: empty full_writes: 0 bypass_count: 0
[41658.397417] check 1: state 0xa01 read           (null) write           (null) written           (null)
[41658.397476] check 1: state 0xa01 read           (null) write           (null) written           (null)
[41658.397560] check 2: state 0xa01 read           (null) write           (null) written           (null)
[41658.397592] check 3: state 0x13 read           (null) write           (null) written           (null)
[41658.397606] __get_priority_stripe: handle: busy hold: empty full_writes: 0 bypass_count: 0
[41658.397614] handling stripe 20206792, state=0x1401 cnt=1, pd_idx=2, qd_idx=-1
, check:0, reconstruct:6
[41658.397621] schedule_reconstruction: stripe 20206792 locked: 2 ops_request: 10
[41658.397630] check 1: state 0xa01 read           (null) write           (null) written           (null)
[41658.397638] ops_complete_reconstruct: stripe 20206800
[41658.397840] locked=1 uptodate=4 to_read=0 to_write=0 failed=2 failed_num=2,1
[41658.397863] check 1: state 0xa01 read           (null) write           (null) written           (null)
[41658.397869] ops_complete_reconstruct: stripe 20206976
[41658.397874] check 1: state 0xa01 read           (null) write           (null) written           (null)
[41658.397883] ops_complete_reconstruct: stripe 20206984
[41658.397890] check 0: state 0x13 read           (null) write           (null) written           (null)
[41658.397899] check 3: state 0x811 read           (null) write           (null) written           (null)
[41658.397907] schedule_reconstruction: stripe 20207000 locked: 2 ops_request: 10
[41658.397952] check 1: state 0xa01 read           (null) write           (null) written           (null)
[41658.398030] check 2: state 0xa01 read           (null) write           (null) written           (null)
[41658.398079] check 1: state 0x203 read           (null) write           (null) written           (null)
[41658.398105] check 2: state 0xa01 read           (null) write           (null) written           (null)
[41658.398118] check 3: state 0x811 read           (null) write           (null) written           (null)
[41658.398124] locked=1 uptodate=4 to_read=0 to_write=0 failed=2 failed_num=2,1
[41658.398130] check 3: state 0x811 read           (null) write           (null) written           (null)
[41658.398136] schedule_reconstruction: stripe 20206904 locked: 2 ops_request: 10
[41658.398145] check 3: state 0x811 read           (null) write           (null) written           (null)
[41658.398162] __get_priority_stripe: handle: busy hold: empty full_writes: 0 bypass_count: 0
[41658.398226] check 2: state 0xa01 read           (null) write           (null) written           (null)
[41658.398294] ops_run_reconstruct5: stripe 20206936
[41658.398308] check 0: state 0x811 read           (null) write           (null) written           (null)
[41658.398318] check 1: state 0x203 read           (null) write           (null) written           (null)
[41658.398342] check 2: state 0xa01 read           (null) write           (null) written           (null)
[41658.398367] __get_priority_stripe: handle: busy hold: empty full_writes: 0 bypass_count: 0
[41658.398389] ops_complete_reconstruct: stripe 20206184
[41658.398415] check 1: state 0xa01 read           (null) write           (null) written           (null)
[41658.398469] locked=1 uptodate=4 to_read=0 to_write=0 failed=2 failed_num=2,1
[41658.398494] check 3: state 0x811 read           (null) write           (null) written           (null)
[41658.398519] schedule_reconstruction: stripe 20206216 locked: 2 ops_request: 10
[41658.398542] check 2: state 0x203 read           (null) write           (null) written           (null)
[41658.398554] ops_run_reconstruct5: stripe 20206224
[41658.398560] check 2: state 0x203 read           (null) write           (null) written           (null)
[41658.398582] ops_run_reconstruct5: stripe 20206240
[41658.398600] check 2: state 0x203 read           (null) write           (null) written           (null)
[41658.398627] check 3: state 0x811 read           (null) write           (null) written           (null)
[41658.398659] check 3: state 0x811 read           (null) write           (null) written           (null)
[41658.398733] ops_run_reconstruct5: stripe 20206288
[41658.398754] check 2: state 0x203 read           (null) write           (null) written           (null)
[41658.398785] ops_complete_reconstruct: stripe 20206296
[41658.398792] check 1: state 0xa01 read           (null) write           (null) written           (null)
[41658.398799] ops_complete_reconstruct: stripe 20206304
[41658.398807] __get_priority_stripe: handle: busy hold: empty full_writes: 0 bypass_count: 0
[41658.398813] handling stripe 20206312, state=0x1401 cnt=1, pd_idx=2, qd_idx=-1
, check:0, reconstruct:6
[41658.398845] check 0: state 0x13 read           (null) write           (null) written           (null)
[41658.398870] check 1: state 0xa01 read           (null) write           (null) written           (null)
[41658.398901] check 3: state 0x811 read           (null) write           (null) written           (null)
[41658.398990] __get_priority_stripe: handle: busy hold: empty full_writes: 0 bypass_count: 0
[41658.399008] __get_priority_stripe: handle: busy hold: empty full_writes: 0 bypass_count: 0
[41658.399035] check 2: state 0xa01 read           (null) write           (null) written           (null)
[41658.399039] schedule_reconstruction: stripe 20206040 locked: 2 ops_request: 10
[41658.399048] check 1: state 0x203 read           (null) write           (null) written           (null)
[41658.399057] ops_complete_reconstruct: stripe 20206336
[41658.399063] check 1: state 0x203 read           (null) write           (null) written           (null)
[41658.399090] check 1: state 0x203 read           (null) write           (null) written           (null)
[41658.399117] check 1: state 0xa01 read           (null) write           (null) written           (null)
[41658.399142] __get_priority_stripe: handle: busy hold: empty full_writes: 0 bypass_count: 0
[41658.399220] check 3: state 0x13 read           (null) write           (null) written           (null)

Also I have an idea about the problem: Usually I added zero'd disks
to mdadm. This time I only zero'd out the first few MB, so that mdadm
does not complain about the header and thought it would take care of
the rest. Is it safe to remove the new disk, zero it out and re-add
it?

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* Re: using the raid6check report
From: Piergiorgio Sartor @ 2017-01-08 20:46 UTC (permalink / raw)
  To: Eyal Lebedinsky; +Cc: linux-raid
In-Reply-To: <a33dbf5c-465d-b5af-a9a9-a00664816489@eyal.emu.id.au>

On Mon, Jan 09, 2017 at 07:36:59AM +1100, Eyal Lebedinsky wrote:
> On 09/01/17 04:40, Piergiorgio Sartor wrote:
> > On Fri, Dec 23, 2016 at 11:56:34AM +1100, Eyal Lebedinsky wrote:
> > > From time to time I get non-zero mismatch_count in the weekly scrub. The way I handle
> > > it is to run a check around the stripe (I have a background job printing the mismatch
> > > count and /proc/mdstat regularly) which should report the same count.
> > > 
> > > I now drill into the fs to find which files use this area, deal with them and delete
> > > the bad ones. I then run a repair on that small area.
> > > 
> > > I now found about raid6check which can actually tell me which disk holds the bad data.
> > > This is something raid6 should be able to do assuming a single error.
> > > Hoping it is one bad disk, the simple solution now is to recover the bad stripe on
> > > that disk.
> > > 
> > > Will a 'repair' rewrite the bad disk or just create fresh P+Q which may just make the
> > > bad data invisible to a 'check'? I recall this being the case in the past.
> > 
> > "repair" should fix the data which is assumed
> 
> You say "should", as in "it does today" or as in "need to change to do" this?
> As I noted originally, the man pages says it does the simple thing - should the
> man page be fixed?

"should" as in "it is supposed to do it".

So, as far as I know, "raid6check" with "repair" will
check the parity and try to find errors.
If possible, it will find where the error is, then
re-compute the value and write the corrected data.

Now, this was somehow tested and *should* work.

An other option is just to check for the errors and
see if one drive is constantly at fault.
This will not write anything, so it is safer, but
it will help to see if there are strange things,
before writing to the disk(s).

bye,

pg
 
> > to be wrong.
> > It should not simply correct P+Q, but really
> > find out which disk is not OK and fix it.
> > 
> > > 
> > > 'man md' still says
> > > 	For RAID5/RAID6 new parity blocks are written
> > > I think RAID6 can do better.
> > > 
> > > TIA
> > > 
> > > --
> > > Eyal Lebedinsky (eyal@eyal.emu.id.au)
> 
> -- 
> Eyal Lebedinsky (eyal@eyal.emu.id.au)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 

piergiorgio

^ permalink raw reply

* Re: using the raid6check report
From: Eyal Lebedinsky @ 2017-01-08 20:36 UTC (permalink / raw)
  Cc: list linux-raid
In-Reply-To: <20170108174010.GA3699@lazy.lzy>

On 09/01/17 04:40, Piergiorgio Sartor wrote:
> On Fri, Dec 23, 2016 at 11:56:34AM +1100, Eyal Lebedinsky wrote:
>> From time to time I get non-zero mismatch_count in the weekly scrub. The way I handle
>> it is to run a check around the stripe (I have a background job printing the mismatch
>> count and /proc/mdstat regularly) which should report the same count.
>>
>> I now drill into the fs to find which files use this area, deal with them and delete
>> the bad ones. I then run a repair on that small area.
>>
>> I now found about raid6check which can actually tell me which disk holds the bad data.
>> This is something raid6 should be able to do assuming a single error.
>> Hoping it is one bad disk, the simple solution now is to recover the bad stripe on
>> that disk.
>>
>> Will a 'repair' rewrite the bad disk or just create fresh P+Q which may just make the
>> bad data invisible to a 'check'? I recall this being the case in the past.
>
> "repair" should fix the data which is assumed

You say "should", as in "it does today" or as in "need to change to do" this?
As I noted originally, the man pages says it does the simple thing - should the
man page be fixed?

> to be wrong.
> It should not simply correct P+Q, but really
> find out which disk is not OK and fix it.
>
>>
>> 'man md' still says
>> 	For RAID5/RAID6 new parity blocks are written
>> I think RAID6 can do better.
>>
>> TIA
>>
>> --
>> Eyal Lebedinsky (eyal@eyal.emu.id.au)

-- 
Eyal Lebedinsky (eyal@eyal.emu.id.au)

^ permalink raw reply

* Re: using the raid6check report
From: Piergiorgio Sartor @ 2017-01-08 17:40 UTC (permalink / raw)
  To: Eyal Lebedinsky; +Cc: list linux-raid
In-Reply-To: <14e8ec23-de4a-e90b-4b67-155e5e3cc228@eyal.emu.id.au>

On Fri, Dec 23, 2016 at 11:56:34AM +1100, Eyal Lebedinsky wrote:
> From time to time I get non-zero mismatch_count in the weekly scrub. The way I handle
> it is to run a check around the stripe (I have a background job printing the mismatch
> count and /proc/mdstat regularly) which should report the same count.
> 
> I now drill into the fs to find which files use this area, deal with them and delete
> the bad ones. I then run a repair on that small area.
> 
> I now found about raid6check which can actually tell me which disk holds the bad data.
> This is something raid6 should be able to do assuming a single error.
> Hoping it is one bad disk, the simple solution now is to recover the bad stripe on
> that disk.
> 
> Will a 'repair' rewrite the bad disk or just create fresh P+Q which may just make the
> bad data invisible to a 'check'? I recall this being the case in the past.

"repair" should fix the data which is assumed
to be wrong.
It should not simply correct P+Q, but really
find out which disk is not OK and fix it.

> 
> 'man md' still says
> 	For RAID5/RAID6 new parity blocks are written
> I think RAID6 can do better.
> 
> TIA
> 
> -- 
> Eyal Lebedinsky (eyal@eyal.emu.id.au)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 

piergiorgio

^ permalink raw reply

* Re: PROBLEM: Kernel BUG with raid5 soft + Xen + DRBD - invalid opcode
From: MasterPrenium @ 2017-01-08 13:31 UTC (permalink / raw)
  To: Shaohua Li
  Cc: linux-kernel, xen-users, linux-raid, MasterPrenium@gmail.com,
	xen-devel
In-Reply-To: <20170105193745.qnmqsussxy7nasdn@kernel.org>

Hello,

Replies below + :
- I don't know if this can help but after the crash, when the system 
reboots, the Raid 5 stack is re-synchronizing
[   37.028239] md10: Warning: Device sdc1 is misaligned
[   37.028541] created bitmap (15 pages) for device md10
[   37.030433] md10: bitmap initialized from disk: read 1 pages, set 59 
of 29807 bits

- Sometimes the kernel completely crash (lost serial + network 
connection), sometimes only got the "BUG" dump, but still have network 
access (but a reboot is impossible, need to reset the system).

- You can find blktrace here (while running fio), I hope it's complete 
since the end of the file is when the kernel crashed : 
https://goo.gl/X9jZ50

Thanks,
MasterPrenium

Le 05/01/2017 à 20:37, Shaohua Li a écrit :
> On Thu, Jan 05, 2017 at 03:16:53PM +0100, MasterPrenium wrote:
>> Hi Shaohua,
>>
>> Thanks for your reply.
>>
>> Let me explain my "huge". For example, if I'm making a low rate i/o stream,
>> I don't get a crash (<1MB written / sec) with random i/o, but if I'm making
>> a random I/O of about 20MB/sec, the kernel crashes in a few minutes (for
>> example, making an rsync, or even synchronising my DRBD stack is causing the
>> crash).
>> I don't know if this can help, but in most of case, when the kernel crashes,
>> after a reboot, my raid 5 stack is re-synchronizing.
>>
>> I'm not able to reproduce the crash with a raw RAID5 stack (with dd/fio
>> ...).
>>
>> It seems I need to stack filesystems to help reproduce it:
>>
>> Here is a configuration test, command lines to explain (the way I'm able to
>> reproduce the crash). Everything is done in dom0.
>> - mdadm --create /dev/md10 --raid-devices=3 --level=5 /dev/sdc1 /dev/sdd1
>> /dev/sde1
>> - mkfs.btrfs /dev/md10
>> - mkdir /tmp/btrfs /mnt/XenVM /tmp/ext4
>> - mount /dev/md10 /tmp/btrfs
>> - btrfs subvolume create /tmp/btrfs/XenVM
>> - umount /tmp/btrfs
>> - mount /dev/md10 /mnt/XenVM -osubvol=XenVM
>> - truncate /mnt/XenVM/VMTestFile.dat -s 800G
>> - mkfs.ext4 /mnt/XenVM/VMTestFile.dat
>> - mount /mnt/XenVM/VMTestFile.dat /tmp/ext4
>>
>> -> Doing this, doesn't seem to crash the kernel :
>> fio --name=randwrite --ioengine=libaio --iodepth=1 --rw=randwrite
>> --rwmixwrite=95 --bs=1M --direct=1 --size=80G --numjobs=8 --runtime=600
>> --group_reporting --filename=/mnt/XenVM/Fio.dat
>>
>> -> Doing this, is crashing the kernel in a few minutes :
>> fio --name=randwrite --ioengine=libaio --iodepth=1 --rw=randwrite
>> --rwmixwrite=95 --bs=1M --direct=1 --size=80G --numjobs=8 --runtime=600
>> --group_reporting --filename=/tmp/ext4/ext4.dat
>>
>> Note : --direct=1 or --direct=0 doesn't seem to change the behaviour. Also
>> having the raid 5 stack re-synchronizing or already synchronized, doesn't
>> change the behaviour.
>>
>> Here another "crash" : http://pastebin.com/uqLzL4fn
> I'm trying to reproduce, but no success. So
> ext4->btrfs->raid5, crash
> btrfs->raid5, no crash
> right? does subvolume matter? When you create the raid5 array, does adding
> '--assume-clean' option change the behavior? I'd like to narrow down the issue.
> If you can capture the blktrace to the raid5 array, it would be great to hint
> us what kind of IO it is.
>   
Yes Correct.
The subvolume doesn't matter.
-- assume-clean doesn't change the behaviour.
Don't forget that the system needs to be running on xen to crash, 
without (on native kernel) it doesn't crash (or at least, I was not able 
to make it crash).
>> Regarding your patch, I can't find it. Is it the one sent by Konstantin
>> Khlebnikov ?
> Right.
It doesn't help :(. Maybe the crash is happening a little bit later.
>
>> Do you want the "ext4.dat" fio file ? It will be really difficult for me to
>> provide it to you as I've only a poor ADSL network connection.
> Not necessary.
>
> Thanks,
> Shaohua
>
>> Thanks for your help,
>>
>> MasterPrenium
>>
>> Le 04/01/2017 à 23:30, Shaohua Li a écrit :
>>> On Fri, Dec 23, 2016 at 07:25:56PM +0100, MasterPrenium wrote:
>>>> Hello Guys,
>>>>
>>>> I've having some trouble on a new system I'm setting up. I'm getting a kernel BUG message, seems to be related with the use of Xen (when I boot the system _without_ Xen, I don't get any crash).
>>>> Here is configuration :
>>>> - 3x Hard Drives running on RAID 5 Software raid created by mdadm
>>>> - On top of it, DRBD for replication over another node (Active/passive cluster)
>>>> - On top of it, a BTRFS FileSystem with a few subvolumes
>>>> - On top of it, XEN VMs running.
>>>>
>>>> The BUG is happening when I'm making "huge" I/O (20MB/s with a rsync for example) on the RAID5 stack.
>>>> I've to reset system to make it work again.
>>> what did you mean 'huge' I/O (20M/s)? Is it possible you can reproduce the
>>> issue with a raw raid5 raid? It would be even better if you can give me a fio
>>> job file with the issue, so I can easily debug it.
>>>
>>> also please check if upstream patch (e8d7c33 md/raid5: limit request size
>>> according to implementation limits) helps.
>>>
>>> Thanks,
>>> Shaohua


^ permalink raw reply

* Re: Recommendation on new system Arrays
From: Wols Lists @ 2017-01-08  9:07 UTC (permalink / raw)
  To: Stan Hoeppner, Benjammin2068, Linux-RAID
In-Reply-To: <db381235-8eb9-3efe-2346-110c13af48d7@hardwarefreak.org>

On 08/01/17 04:13, Stan Hoeppner wrote:
>>>
>>> This sounds like one of the few use cases where they might be a good
>>> idea. Worth considering, at least. Might even work well in your planned
>>> raid-6 config.
>>>

>> Yea, I thought about that too. So you're suggesting a RAID1 consisting
>> of (2) RAID6 arrays.

> That's not sane.  RAID 10, or more precisely, RAID 0 over many RAID 1
> pairs, will yield more usable capacity and without the parity penalty or
> RMW cycles.

I was actually thinking pure raid-6. Which was Benjammin's original
idea. The thing to bear in mind is that for these drives, rewrite
performance is going to be abysmal, but in this particular scenario
rewriting is going to be unusual, anyway. What we *don't* want with
these drives is RMW.

It's just struck me, this might be where it's worth sticking a small SSD
in front of the array as a journal, and flagging these drives as "write
mostly". But I'm not sure whether this functionality is yet standard or
are the devs still working on it?

Cheers,
Wol

^ permalink raw reply

* Re: Recommendation on new system Arrays
From: Stan Hoeppner @ 2017-01-08  4:13 UTC (permalink / raw)
  To: Benjammin2068, Linux-RAID
In-Reply-To: <6017e35e-6328-bf8b-fb25-eb8afbf163ba@gmail.com>



On 01/07/2017 10:04 PM, Benjammin2068 wrote:
> On 01/07/2017 04:04 AM, Wols Lists wrote:
>> On 06/01/17 16:14, Benjammin2068 wrote:
>>>      * the other as a data drive for use with surveillance software (from Milestone probably) running in a VM as a secondary storage vault for company cameras/NVRs that are remote. (like a backup system)
>> If you were planning on a raid-6, how about a mirror for this drive? I
>> believe it is not a good choice for a general raid, but if you're only
>> writing *NEW* stuff for the most part, and streaming big files to disk,
>> how about these new WD shingled disks (Purples, I believe).
>>
>> This sounds like one of the few use cases where they might be a good
>> idea. Worth considering, at least. Might even work well in your planned
>> raid-6 config.
>>
> Yea, I thought about that too. So you're suggesting a RAID1 consisting of (2) RAID6 arrays.
That's not sane.  RAID 10, or more precisely, RAID 0 over many RAID 1 
pairs, will yield more usable capacity and without the parity penalty or 
RMW cycles.

>
> Will mdadm do that?
>
> Also in other news.... (maybe someone from this list can help since they've run into it before)
>
> The motherboard of the computer has its own SATA controller as usual... as well as this Avago SAS controller.
>
> When CentOS 7 boots up, it enumerates the external SAS drives starting at /dev/sda instead of the motherboard's drives.
>
> The OCD in me wants the MB's SATA drives as /dev/sda-sdd.
>
> Where does one even control that enumeration order? udev? Eeks.
>
> (I'm not finding a query that google makes sense out of to give me a decent set of suggested links.)
>
>   -Ben
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox