Revision e9c0a3f05477e18d2dae816cb61b62be1b7e90d3 authored by Dan Williams on 18 July 2019, 22:58:11 UTC, committed by Linus Torvalds on 19 July 2019, 00:08:07 UTC
Allow sub-section sized ranges to be added to the memmap.

populate_section_memmap() takes an explict pfn range rather than
assuming a full section, and those parameters are plumbed all the way
through to vmmemap_populate().  There should be no sub-section usage in
current deployments.  New warnings are added to clarify which memmap
allocation paths are sub-section capable.

Link: http://lkml.kernel.org/r/156092352058.979959.6551283472062305149.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Pavel Tatashin <pasha.tatashin@soleen.com>
Tested-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>	[ppc64]
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Cc: Michal Hocko <mhocko@suse.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Logan Gunthorpe <logang@deltatee.com>
Cc: Jane Chu <jane.chu@oracle.com>
Cc: Jeff Moyer <jmoyer@redhat.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Cc: Toshi Kani <toshi.kani@hpe.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Wei Yang <richardw.yang@linux.intel.com>
Cc: Jason Gunthorpe <jgg@mellanox.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 49ba3c6
Raw File
Makefile.headersinst
# SPDX-License-Identifier: GPL-2.0
# ==========================================================================
# Installing headers
#
# All headers under include/uapi, include/generated/uapi,
# arch/<arch>/include/uapi and arch/<arch>/include/generated/uapi are
# exported.
# They are preprocessed to remove __KERNEL__ section of the file.
#
# ==========================================================================

PHONY := __headers
__headers:

include scripts/Kbuild.include

src := $(srctree)/$(obj)
gen := $(objtree)/$(subst include/,include/generated/,$(obj))
dst := usr/include

-include $(src)/Kbuild

# $(filter %/, ...) is a workaround for GNU Make <= 4.2.1, where
# $(wildcard $(src)/*/) contains not only directories but also regular files.
src-subdirs := $(patsubst $(src)/%/,%,$(filter %/, $(wildcard $(src)/*/)))
gen-subdirs := $(patsubst $(gen)/%/,%,$(filter %/, $(wildcard $(gen)/*/)))
all-subdirs := $(sort $(src-subdirs) $(gen-subdirs))

src-headers := $(if $(src-subdirs), $(shell cd $(src) && find $(src-subdirs) -name '*.h'))
src-headers := $(filter-out $(no-export-headers), $(src-headers))
gen-headers := $(if $(gen-subdirs), $(shell cd $(gen) && find $(gen-subdirs) -name '*.h'))
gen-headers := $(filter-out $(no-export-headers), $(gen-headers))

# If the same header is exported from source and generated directories,
# the former takes precedence, but this should be warned.
duplicated := $(filter $(gen-headers), $(src-headers))
$(if $(duplicated), $(warning duplicated header export: $(duplicated)))

gen-headers := $(filter-out $(duplicated), $(gen-headers))

# Add dst path prefix
all-subdirs := $(addprefix $(dst)/, $(all-subdirs))
src-headers := $(addprefix $(dst)/, $(src-headers))
gen-headers := $(addprefix $(dst)/, $(gen-headers))
all-headers := $(src-headers) $(gen-headers)

# Work out what needs to be removed
old-subdirs := $(wildcard $(all-subdirs))
old-headers := $(if $(old-subdirs),$(shell find $(old-subdirs) -name '*.h'))
unwanted    := $(filter-out $(all-headers), $(old-headers))

# Create directories
existing-dirs := $(sort $(dir $(old-headers)))
wanted-dirs   := $(sort $(dir $(all-headers)))
new-dirs      := $(filter-out $(existing-dirs), $(wanted-dirs))
$(if $(new-dirs), $(shell mkdir -p $(new-dirs)))

# Rules

ifndef HDRCHECK

quiet_cmd_install = HDRINST $@
      cmd_install = $(CONFIG_SHELL) $(srctree)/scripts/headers_install.sh $< $@

$(src-headers): $(dst)/%.h: $(src)/%.h $(srctree)/scripts/headers_install.sh FORCE
	$(call if_changed,install)

$(gen-headers): $(dst)/%.h: $(gen)/%.h $(srctree)/scripts/headers_install.sh FORCE
	$(call if_changed,install)

quiet_cmd_remove = REMOVE  $(unwanted)
      cmd_remove = rm -f $(unwanted)

__headers: $(all-headers)
ifneq ($(unwanted),)
	$(call cmd,remove)
endif
	@:

existing-headers := $(filter $(old-headers), $(all-headers))

-include $(foreach f,$(existing-headers),$(dir $(f)).$(notdir $(f)).cmd)

else

quiet_cmd_check = HDRCHK  $<
      cmd_check = $(PERL) $(srctree)/scripts/headers_check.pl $(dst) $(SRCARCH) $<; touch $@

check-files := $(addsuffix .chk, $(all-headers))

$(check-files): $(dst)/%.chk : $(dst)/% $(srctree)/scripts/headers_check.pl
	$(call cmd,check)

__headers: $(check-files)
	@:

endif

PHONY += FORCE
FORCE:

.PHONY: $(PHONY)
back to top