projects/linux·commit 7eec11d3

Merge branch 'akpm' (patches from Andrew)

7eec11d3 · Linus Torvalds <[email protected]> · 2020-01-31 12:16:36 -08:00

Pull updates from Andrew Morton:
 "Most of -mm and quite a number of other subsystems: hotfixes, scripts,
  ocfs2, misc, lib, binfmt, init, reiserfs, exec, dma-mapping, kcov.

  MM is fairly quiet this time.  Holidays, I assume"

* emailed patches from Andrew Morton <[email protected]>: (118 commits)
  kcov: ignore fault-inject and stacktrace
  include/linux/io-mapping.h-mapping: use PHYS_PFN() macro in io_mapping_map_atomic_wc()
  execve: warn if process starts with executable stack
  reiserfs: prevent NULL pointer dereference in reiserfs_insert_item()
  init/main.c: fix misleading "This architecture does not have kernel memory protection" message
  init/main.c: fix quoted value handling in unknown_bootoption
  init/main.c: remove unnecessary repair_env_string in do_initcall_level
  init/main.c: log arguments and environment passed to init
  fs/binfmt_elf.c: coredump: allow process with empty address space to coredump
  fs/binfmt_elf.c: coredump: delete duplicated overflow check
  fs/binfmt_elf.c: coredump: allocate core ELF header on stack
  fs/binfmt_elf.c: make BAD_ADDR() unlikely
  fs/binfmt_elf.c: better codegen around current->mm
  fs/binfmt_elf.c: don't copy ELF header around
  fs/binfmt_elf.c: fix ->start_code calculation
  fs/binfmt_elf.c: smaller code generation around auxv vector fill
  lib/find_bit.c: uninline helper _find_next_bit()
  lib/find_bit.c: join _find_next_bit{_le}
  uapi: rename ext2_swab() to swab() and share globally in swab.h
  lib/scatterlist.c: adjust indentation in __sg_alloc_table
  ...
Commit
7eec11d3a784a283f916590e5aa30b855c2ccfd7
Parents
ddaefe89 · 43e76af8

Merge commit. Changes below are compared with the first parent: ddaefe89.

Changes

136 files changed · +2724 −1293

FileStatusAddDelContent
Documentation/admin-guide/kernel-parameters.txtmodified+12−0View file
Documentation/core-api/index.rstmodified+1−0View file
Documentation/core-api/pin_user_pages.rstadded+232−0View file
Documentation/vm/zswap.rstmodified+13−0View file
arch/powerpc/mm/book3s64/iommu_api.cmodified+5−5View file
arch/s390/boot/compressed/decompressor.cmodified+4−4View file
arch/s390/boot/ipl_parm.cmodified+14−0View file
arch/s390/include/asm/setup.hmodified+7−0View file
arch/s390/kernel/setup.cmodified+5−9View file
drivers/acpi/thermal.cmodified+18−16View file
drivers/base/memory.cmodified+3−22View file
drivers/block/zram/zram_drv.cmodified+6−4View file
drivers/gpu/drm/via/via_dmablit.cmodified+3−3View file
drivers/iio/adc/qcom-vadc-common.cmodified+3−3View file
drivers/iio/adc/qcom-vadc-common.hmodified+0−1View file
drivers/infiniband/core/umem.cmodified+7−12View file
drivers/infiniband/core/umem_odp.cmodified+6−7View file
drivers/infiniband/hw/hfi1/user_pages.cmodified+2−2View file
drivers/infiniband/hw/mthca/mthca_memfree.cmodified+4−4View file
drivers/infiniband/hw/qib/qib_user_pages.cmodified+2−2View file
drivers/infiniband/hw/qib/qib_user_sdma.cmodified+4−4View file
drivers/infiniband/hw/usnic/usnic_uiom.cmodified+2−2View file
drivers/infiniband/sw/siw/siw_mem.cmodified+2−2View file
drivers/media/v4l2-core/videobuf-dma-sg.cmodified+4−4View file
drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.hmodified+0−1View file
drivers/net/wireless/intel/iwlegacy/4965-mac.cmodified+2−1View file
drivers/net/wireless/intel/iwlegacy/4965.cmodified+9−8View file
drivers/net/wireless/intel/iwlegacy/common.hmodified+0−3View file
drivers/net/wireless/intel/iwlwifi/dvm/dev.hmodified+0−5View file
drivers/net/wireless/intel/iwlwifi/dvm/devices.cmodified+4−2View file
drivers/nvdimm/pmem.cmodified+0−6View file
drivers/nvme/host/hwmon.cmodified+5−8View file
drivers/platform/goldfish/goldfish_pipe.cmodified+12−23View file
drivers/platform/x86/asus-wmi.cmodified+3−4View file
drivers/platform/x86/intel_menlow.cmodified+6−3View file
drivers/thermal/armada_thermal.cmodified+0−2View file
drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.cmodified+4−3View file
drivers/thermal/intel/intel_pch_thermal.cmodified+2−1View file
drivers/vfio/vfio_iommu_type1.cmodified+7−28View file
fs/binfmt_elf.cmodified+74−70View file
fs/btrfs/compression.cmodified+1−1View file
fs/btrfs/zlib.cmodified+100−35View file
fs/exec.cmodified+5−0View file
fs/fs-writeback.cmodified+1−1View file
fs/io_uring.cmodified+3−3View file
fs/ocfs2/cluster/quorum.cmodified+1−1View file
fs/ocfs2/dlm/Makefilemodified+0−2View file
fs/ocfs2/dlm/dlmast.cmodified+4−4View file
fs/ocfs2/dlm/dlmcommon.hmodified+0−4View file
fs/ocfs2/dlm/dlmconvert.cmodified+4−4View file
fs/ocfs2/dlm/dlmdebug.cmodified+4−4View file
fs/ocfs2/dlm/dlmdomain.cmodified+4−4View file
fs/ocfs2/dlm/dlmlock.cmodified+4−4View file
fs/ocfs2/dlm/dlmmaster.cmodified+4−6View file
fs/ocfs2/dlm/dlmrecovery.cmodified+5−5View file
fs/ocfs2/dlm/dlmthread.cmodified+4−4View file
fs/ocfs2/dlm/dlmunlock.cmodified+4−4View file
fs/ocfs2/dlmfs/Makefilemodified+0−2View file
fs/ocfs2/dlmfs/dlmfs.cmodified+2−2View file
fs/ocfs2/dlmfs/userdlm.cmodified+3−3View file
fs/ocfs2/dlmglue.cmodified+1−1View file
fs/ocfs2/journal.hmodified+5−3View file
fs/ocfs2/namei.cmodified+1−2View file
fs/reiserfs/stree.cmodified+2−1View file
include/linux/backing-dev.hmodified+10−0View file
include/linux/bitops.hmodified+1−0View file
include/linux/fs.hmodified+5−1View file
include/linux/io-mapping.hmodified+2−3View file
include/linux/memblock.hmodified+3−4View file
include/linux/memory.hmodified+0−29View file
include/linux/memory_hotplug.hmodified+2−1View file
include/linux/mm.hmodified+70−34View file
include/linux/mmzone.hmodified+1−1View file
include/linux/page-isolation.hmodified+2−2View file
include/linux/swab.hmodified+1−0View file
include/linux/thermal.hmodified+0−11View file
include/linux/units.hadded+84−0View file
include/linux/zlib.hmodified+6−0View file
include/trace/events/kmem.hmodified+2−2View file
include/trace/events/writeback.hmodified+17−20View file
include/uapi/linux/swab.hmodified+10−0View file
include/uapi/linux/sysctl.hmodified+1−1View file
init/main.cmodified+27−9View file
kernel/Makefilemodified+1−0View file
lib/Kconfigmodified+7−0View file
lib/Makefilemodified+2−0View file
lib/decompress_inflate.cmodified+13−0View file
lib/find_bit.cmodified+20−58View file
lib/scatterlist.cmodified+1−1View file
lib/test_bitmap.cmodified+5−4View file
lib/test_kasan.cmodified+1−0View file
lib/zlib_deflate/deflate.cmodified+47−38View file
lib/zlib_deflate/deflate_syms.cmodified+1−0View file
lib/zlib_deflate/deftree.cmodified+0−54View file
lib/zlib_deflate/defutil.hmodified+124−10View file
lib/zlib_dfltcc/Makefileadded+11−0View file
lib/zlib_dfltcc/dfltcc.cadded+55−0View file
lib/zlib_dfltcc/dfltcc.hadded+155−0View file
lib/zlib_dfltcc/dfltcc_deflate.cadded+279−0View file
lib/zlib_dfltcc/dfltcc_inflate.cadded+149−0View file
lib/zlib_dfltcc/dfltcc_syms.cadded+17−0View file
lib/zlib_dfltcc/dfltcc_util.hadded+103−0View file
lib/zlib_inflate/inflate.cmodified+24−8View file
lib/zlib_inflate/inflate.hmodified+8−0View file
lib/zlib_inflate/infutil.hmodified+16−2View file
mm/Makefilemodified+1−0View file
mm/backing-dev.cmodified+1−0View file
mm/debug.cmodified+13−3View file
mm/early_ioremap.cmodified+4−4View file
mm/filemap.cmodified+6−28View file
mm/gup.cmodified+310−191View file
mm/gup_benchmark.cmodified+6−3View file
mm/huge_memory.cmodified+18−26View file
mm/kmemleak.cmodified+56−56View file
mm/memblock.cmodified+17−5View file
mm/memcontrol.cmodified+3−22View file
mm/memory_hotplug.cmodified+9−15View file
mm/mempolicy.cmodified+3−3View file
mm/memremap.cmodified+35−40View file
mm/migrate.cmodified+51−26View file
mm/mmap.cmodified+16−20View file
mm/oom_kill.cmodified+2−0View file
mm/page_alloc.cmodified+44−31View file
mm/page_isolation.cmodified+18−35View file
mm/page_vma_mapped.cmodified+8−4View file
mm/process_vm_access.cmodified+15−13View file
mm/slub.cmodified+47−41View file
mm/sparse.cmodified+1−1View file
mm/swap.cmodified+26−1View file
mm/swapfile.cmodified+1−1View file
mm/vmscan.cmodified+3−21View file
mm/zswap.cmodified+55−31View file
net/xdp/xdp_umem.cmodified+2−2View file
scripts/spelling.txtmodified+14−0View file
tools/testing/selftests/vm/gup_benchmark.cmodified+5−1View file
tools/vm/slabinfo.cmodified+2−2View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/admin-guide/kernel-parameters.txt

View file
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index ec92120..ddc5ccd 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -834,6 +834,18 @@
dump out devices still on the deferred probe list after
retrying.
+ dfltcc= [HW,S390]
+ Format: { on | off | def_only | inf_only | always }
+ on: s390 zlib hardware support for compression on
+ level 1 and decompression (default)
+ off: No s390 zlib hardware support
+ def_only: s390 zlib hardware support for deflate
+ only (compression on level 1)
+ inf_only: s390 zlib hardware support for inflate
+ only (decompression)
+ always: Same as 'on' but ignores the selected compression
+ level always using hardware support (used for debugging)
+
dhash_entries= [KNL]
Set number of hash buckets for dentry cache.

Documentation/core-api/index.rst

View file
diff --git a/Documentation/core-api/index.rst b/Documentation/core-api/index.rst
index bc0c727..a501dc1 100644
--- a/Documentation/core-api/index.rst
+++ b/Documentation/core-api/index.rst
@@ -31,6 +31,7 @@ Core utilities
generic-radix-tree
memory-allocation
mm-api
+ pin_user_pages
gfp_mask-from-fs-io
timekeeping
boot-time-mm

Documentation/core-api/pin_user_pages.rst

View file
diff --git a/Documentation/core-api/pin_user_pages.rst b/Documentation/core-api/pin_user_pages.rst
new file mode 100644
index 0000000..1d49015
--- /dev/null
+++ b/Documentation/core-api/pin_user_pages.rst
@@ -0,0 +1,232 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+====================================================
+pin_user_pages() and related calls
+====================================================
+
+.. contents:: :local:
+
+Overview
+========
+
+This document describes the following functions::
+
+ pin_user_pages()
+ pin_user_pages_fast()
+ pin_user_pages_remote()
+
+Basic description of FOLL_PIN
+=============================
+
+FOLL_PIN and FOLL_LONGTERM are flags that can be passed to the get_user_pages*()
+("gup") family of functions. FOLL_PIN has significant interactions and
+interdependencies with FOLL_LONGTERM, so both are covered here.
+
+FOLL_PIN is internal to gup, meaning that it should not appear at the gup call
+sites. This allows the associated wrapper functions (pin_user_pages*() and
+others) to set the correct combination of these flags, and to check for problems
+as well.
+
+FOLL_LONGTERM, on the other hand, *is* allowed to be set at the gup call sites.
+This is in order to avoid creating a large number of wrapper functions to cover
+all combinations of get*(), pin*(), FOLL_LONGTERM, and more. Also, the
+pin_user_pages*() APIs are clearly distinct from the get_user_pages*() APIs, so
+that's a natural dividing line, and a good point to make separate wrapper calls.
+In other words, use pin_user_pages*() for DMA-pinned pages, and
+get_user_pages*() for other cases. There are four cases described later on in
+this document, to further clarify that concept.
+
+FOLL_PIN and FOLL_GET are mutually exclusive for a given gup call. However,
+multiple threads and call sites are free to pin the same struct pages, via both
+FOLL_PIN and FOLL_GET. It's just the call site that needs to choose one or the
+other, not the struct page(s).
+
+The FOLL_PIN implementation is nearly the same as FOLL_GET, except that FOLL_PIN
+uses a different reference counting technique.
+
+FOLL_PIN is a prerequisite to FOLL_LONGTERM. Another way of saying that is,
+FOLL_LONGTERM is a specific case, more restrictive case of FOLL_PIN.
+
+Which flags are set by each wrapper
+===================================
+
+For these pin_user_pages*() functions, FOLL_PIN is OR'd in with whatever gup
+flags the caller provides. The caller is required to pass in a non-null struct
+pages* array, and the function then pin pages by incrementing each by a special
+value. For now, that value is +1, just like get_user_pages*().::
+
+ Function
+ --------
+ pin_user_pages FOLL_PIN is always set internally by this function.
+ pin_user_pages_fast FOLL_PIN is always set internally by this function.
+ pin_user_pages_remote FOLL_PIN is always set internally by this function.
+
+For these get_user_pages*() functions, FOLL_GET might not even be specified.
+Behavior is a little more complex than above. If FOLL_GET was *not* specified,
+but the caller passed in a non-null struct pages* array, then the function
+sets FOLL_GET for you, and proceeds to pin pages by incrementing the refcount
+of each page by +1.::
+
+ Function
+ --------
+ get_user_pages FOLL_GET is sometimes set internally by this function.
+ get_user_pages_fast FOLL_GET is sometimes set internally by this function.
+ get_user_pages_remote FOLL_GET is sometimes set internally by this function.
+
+Tracking dma-pinned pages
+=========================
+
+Some of the key design constraints, and solutions, for tracking dma-pinned
+pages:
+
+* An actual reference count, per struct page, is required. This is because
+ multiple processes may pin and unpin a page.
+
+* False positives (reporting that a page is dma-pinned, when in fact it is not)
+ are acceptable, but false negatives are not.
+
+* struct page may not be increased in size for this, and all fields are already
+ used.
+
+* Given the above, we can overload the page->_refcount field by using, sort of,
+ the upper bits in that field for a dma-pinned count. "Sort of", means that,
+ rather than dividing page->_refcount into bit fields, we simple add a medium-
+ large value (GUP_PIN_COUNTING_BIAS, initially chosen to be 1024: 10 bits) to
+ page->_refcount. This provides fuzzy behavior: if a page has get_page() called
+ on it 1024 times, then it will appear to have a single dma-pinned count.
+ And again, that's acceptable.
+
+This also leads to limitations: there are only 31-10==21 bits available for a
+counter that increments 10 bits at a time.
+
+TODO: for 1GB and larger huge pages, this is cutting it close. That's because
+when pin_user_pages() follows such pages, it increments the head page by "1"
+(where "1" used to mean "+1" for get_user_pages(), but now means "+1024" for
+pin_user_pages()) for each tail page. So if you have a 1GB huge page:
+
+* There are 256K (18 bits) worth of 4 KB tail pages.
+* There are 21 bits available to count up via GUP_PIN_COUNTING_BIAS (that is,
+ 10 bits at a time)
+* There are 21 - 18 == 3 bits available to count. Except that there aren't,
+ because you need to allow for a few normal get_page() calls on the head page,
+ as well. Fortunately, the approach of using addition, rather than "hard"
+ bitfields, within page->_refcount, allows for sharing these bits gracefully.
+ But we're still looking at about 8 references.
+
+This, however, is a missing feature more than anything else, because it's easily
+solved by addressing an obvious inefficiency in the original get_user_pages()
+approach of retrieving pages: stop treating all the pages as if they were
+PAGE_SIZE. Retrieve huge pages as huge pages. The callers need to be aware of
+this, so some work is required. Once that's in place, this limitation mostly
+disappears from view, because there will be ample refcounting range available.
+
+* Callers must specifically request "dma-pinned tracking of pages". In other
+ words, just calling get_user_pages() will not suffice; a new set of functions,
+ pin_user_page() and related, must be used.
+
+FOLL_PIN, FOLL_GET, FOLL_LONGTERM: when to use which flags
+==========================================================
+
+Thanks to Jan Kara, Vlastimil Babka and several other -mm people, for describing
+these categories:
+
+CASE 1: Direct IO (DIO)
+-----------------------
+There are GUP references to pages that are serving
+as DIO buffers. These buffers are needed for a relatively short time (so they
+are not "long term"). No special synchronization with page_mkclean() or
+munmap() is provided. Therefore, flags to set at the call site are: ::
+
+ FOLL_PIN
+
+...but rather than setting FOLL_PIN directly, call sites should use one of
+the pin_user_pages*() routines that set FOLL_PIN.
+
+CASE 2: RDMA
+------------
+There are GUP references to pages that are serving as DMA
+buffers. These buffers are needed for a long time ("long term"). No special
+synchronization with page_mkclean() or munmap() is provided. Therefore, flags
+to set at the call site are: ::
+
+ FOLL_PIN | FOLL_LONGTERM
+
+NOTE: Some pages, such as DAX pages, cannot be pinned with longterm pins. That's
+because DAX pages do not have a separate page cache, and so "pinning" implies
+locking down file system blocks, which is not (yet) supported in that way.
+
+CASE 3: Hardware with page faulting support
+-------------------------------------------
+Here, a well-written driver doesn't normally need to pin pages at all. However,
+if the driver does choose to do so, it can register MMU notifiers for the range,
+and will be called back upon invalidation. Either way (avoiding page pinning, or
+using MMU notifiers to unpin upon request), there is proper synchronization with
+both filesystem and mm (page_mkclean(), munmap(), etc).
+
+Therefore, neither flag needs to be set.
+
+In this case, ideally, neither get_user_pages() nor pin_user_pages() should be
+called. Instead, the software should be written so that it does not pin pages.
+This allows mm and filesystems to operate more efficiently and reliably.
+
+CASE 4: Pinning for struct page manipulation only
+-------------------------------------------------
+Here, normal GUP calls are sufficient, so neither flag needs to be set.
+
+page_dma_pinned(): the whole point of pinning
+=============================================
+
+The whole point of marking pages as "DMA-pinned" or "gup-pinned" is to be able
+to query, "is this page DMA-pinned?" That allows code such as page_mkclean()
+(and file system writeback code in general) to make informed decisions about
+what to do when a page cannot be unmapped due to such pins.
+
+What to do in those cases is the subject of a years-long series of discussions
+and debates (see the References at the end of this document). It's a TODO item
+here: fill in the details once that's worked out. Meanwhile, it's safe to say
+that having this available: ::
+
+ static inline bool page_dma_pinned(struct page *page)
+
+...is a prerequisite to solving the long-running gup+DMA problem.
+
+Another way of thinking about FOLL_GET, FOLL_PIN, and FOLL_LONGTERM
+===================================================================
+
+Another way of thinking about these flags is as a progression of restrictions:
+FOLL_GET is for struct page manipulation, without affecting the data that the
+struct page refers to. FOLL_PIN is a *replacement* for FOLL_GET, and is for
+short term pins on pages whose data *will* get accessed. As such, FOLL_PIN is
+a "more severe" form of pinning. And finally, FOLL_LONGTERM is an even more
+restrictive case that has FOLL_PIN as a prerequisite: this is for pages that
+will be pinned longterm, and whose data will be accessed.
+
+Unit testing
+============
+This file::
+
+ tools/testing/selftests/vm/gup_benchmark.c
+
+has the following new calls to exercise the new pin*() wrapper functions:
+
+* PIN_FAST_BENCHMARK (./gup_benchmark -a)
+* PIN_BENCHMARK (./gup_benchmark -b)
+
+You can monitor how many total dma-pinned pages have been acquired and released
+since the system was booted, via two new /proc/vmstat entries: ::
+
+ /proc/vmstat/nr_foll_pin_requested
+ /proc/vmstat/nr_foll_pin_requested
+
+Those are both going to show zero, unless CONFIG_DEBUG_VM is set. This is
+because there is a noticeable performance drop in unpin_user_page(), when they
+are activated.
+
+References
+==========
+
+* `Some slow progress on get_user_pages() (Apr 2, 2019) <https://lwn.net/Articles/784574/>`_
+* `DMA and get_user_pages() (LPC: Dec 12, 2018) <https://lwn.net/Articles/774411/>`_
+* `The trouble with get_user_pages() (Apr 30, 2018) <https://lwn.net/Articles/753027/>`_
+
+John Hubbard, October, 2019

Documentation/vm/zswap.rst

View file
diff --git a/Documentation/vm/zswap.rst b/Documentation/vm/zswap.rst
index 1444ecd..61f6185 100644
--- a/Documentation/vm/zswap.rst
+++ b/Documentation/vm/zswap.rst
@@ -130,6 +130,19 @@ checking for the same-value filled pages during store operation. However, the
existing pages which are marked as same-value filled pages remain stored
unchanged in zswap until they are either loaded or invalidated.
+To prevent zswap from shrinking pool when zswap is full and there's a high
+pressure on swap (this will result in flipping pages in and out zswap pool
+without any real benefit but with a performance drop for the system), a
+special parameter has been introduced to implement a sort of hysteresis to
+refuse taking pages into zswap pool until it has sufficient space if the limit
+has been hit. To set the threshold at which zswap would start accepting pages
+again after it became full, use the sysfs ``accept_threhsold_percent``
+attribute, e. g.::
+
+ echo 80 > /sys/module/zswap/parameters/accept_threhsold_percent
+
+Setting this parameter to 100 will disable the hysteresis.
+
A debugfs interface is provided for various statistic about pool size, number
of pages stored, same-value filled pages and various counters for the reasons
pages are rejected.

arch/powerpc/mm/book3s64/iommu_api.c

View file
diff --git a/arch/powerpc/mm/book3s64/iommu_api.c b/arch/powerpc/mm/book3s64/iommu_api.c
index 56cc845..eba73eb 100644
--- a/arch/powerpc/mm/book3s64/iommu_api.c
+++ b/arch/powerpc/mm/book3s64/iommu_api.c
@@ -103,7 +103,7 @@ static long mm_iommu_do_alloc(struct mm_struct *mm, unsigned long ua,
for (entry = 0; entry < entries; entry += chunk) {
unsigned long n = min(entries - entry, chunk);
- ret = get_user_pages(ua + (entry << PAGE_SHIFT), n,
+ ret = pin_user_pages(ua + (entry << PAGE_SHIFT), n,
FOLL_WRITE | FOLL_LONGTERM,
mem->hpages + entry, NULL);
if (ret == n) {
@@ -167,9 +167,8 @@ good_exit:
return 0;
free_exit:
- /* free the reference taken */
- for (i = 0; i < pinned; i++)
- put_page(mem->hpages[i]);
+ /* free the references taken */
+ unpin_user_pages(mem->hpages, pinned);
vfree(mem->hpas);
kfree(mem);
@@ -215,7 +214,8 @@ static void mm_iommu_unpin(struct mm_iommu_table_group_mem_t *mem)
if (mem->hpas[i] & MM_IOMMU_TABLE_GROUP_PAGE_DIRTY)
SetPageDirty(page);
- put_page(page);
+ unpin_user_page(page);
+
mem->hpas[i] = 0;
}
}

arch/s390/boot/compressed/decompressor.c

View file
diff --git a/arch/s390/boot/compressed/decompressor.c b/arch/s390/boot/compressed/decompressor.c
index 4504663..368fd37 100644
--- a/arch/s390/boot/compressed/decompressor.c
+++ b/arch/s390/boot/compressed/decompressor.c
@@ -30,13 +30,13 @@ extern unsigned char _compressed_start[];
extern unsigned char _compressed_end[];
#ifdef CONFIG_HAVE_KERNEL_BZIP2
-#define HEAP_SIZE 0x400000
+#define BOOT_HEAP_SIZE 0x400000
#else
-#define HEAP_SIZE 0x10000
+#define BOOT_HEAP_SIZE 0x10000
#endif
static unsigned long free_mem_ptr = (unsigned long) _end;
-static unsigned long free_mem_end_ptr = (unsigned long) _end + HEAP_SIZE;
+static unsigned long free_mem_end_ptr = (unsigned long) _end + BOOT_HEAP_SIZE;
#ifdef CONFIG_KERNEL_GZIP
#include "../../../../lib/decompress_inflate.c"
@@ -62,7 +62,7 @@ static unsigned long free_mem_end_ptr = (unsigned long) _end + HEAP_SIZE;
#include "../../../../lib/decompress_unxz.c"
#endif
-#define decompress_offset ALIGN((unsigned long)_end + HEAP_SIZE, PAGE_SIZE)
+#define decompress_offset ALIGN((unsigned long)_end + BOOT_HEAP_SIZE, PAGE_SIZE)
unsigned long mem_safe_offset(void)
{

arch/s390/boot/ipl_parm.c

View file
diff --git a/arch/s390/boot/ipl_parm.c b/arch/s390/boot/ipl_parm.c
index 24ef67e..357adad 100644
--- a/arch/s390/boot/ipl_parm.c
+++ b/arch/s390/boot/ipl_parm.c
@@ -14,6 +14,7 @@
char __bootdata(early_command_line)[COMMAND_LINE_SIZE];
struct ipl_parameter_block __bootdata_preserved(ipl_block);
int __bootdata_preserved(ipl_block_valid);
+unsigned int __bootdata_preserved(zlib_dfltcc_support) = ZLIB_DFLTCC_FULL;
unsigned long __bootdata(vmalloc_size) = VMALLOC_DEFAULT_SIZE;
unsigned long __bootdata(memory_end);
@@ -229,6 +230,19 @@ void parse_boot_command_line(void)
if (!strcmp(param, "vmalloc") && val)
vmalloc_size = round_up(memparse(val, NULL), PAGE_SIZE);
+ if (!strcmp(param, "dfltcc")) {
+ if (!strcmp(val, "off"))
+ zlib_dfltcc_support = ZLIB_DFLTCC_DISABLED;
+ else if (!strcmp(val, "on"))
+ zlib_dfltcc_support = ZLIB_DFLTCC_FULL;
+ else if (!strcmp(val, "def_only"))
+ zlib_dfltcc_support = ZLIB_DFLTCC_DEFLATE_ONLY;
+ else if (!strcmp(val, "inf_only"))
+ zlib_dfltcc_support = ZLIB_DFLTCC_INFLATE_ONLY;
+ else if (!strcmp(val, "always"))
+ zlib_dfltcc_support = ZLIB_DFLTCC_FULL_DEBUG;
+ }
+
if (!strcmp(param, "noexec")) {
rc = kstrtobool(val, &enabled);
if (!rc && !enabled)

arch/s390/include/asm/setup.h

View file
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h
index 69289e9..b241ddb 100644
--- a/arch/s390/include/asm/setup.h
+++ b/arch/s390/include/asm/setup.h
@@ -79,6 +79,13 @@ struct parmarea {
char command_line[ARCH_COMMAND_LINE_SIZE]; /* 0x10480 */
};
+extern unsigned int zlib_dfltcc_support;
+#define ZLIB_DFLTCC_DISABLED 0
+#define ZLIB_DFLTCC_FULL 1
+#define ZLIB_DFLTCC_DEFLATE_ONLY 2
+#define ZLIB_DFLTCC_INFLATE_ONLY 3
+#define ZLIB_DFLTCC_FULL_DEBUG 4
+
extern int noexec_disabled;
extern int memory_end_set;
extern unsigned long memory_end;

arch/s390/kernel/setup.c

View file
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 87a467d..b2c2f75 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -111,6 +111,8 @@ unsigned long __bootdata_preserved(__etext_dma);
unsigned long __bootdata_preserved(__sdma);
unsigned long __bootdata_preserved(__edma);
unsigned long __bootdata_preserved(__kaslr_offset);
+unsigned int __bootdata_preserved(zlib_dfltcc_support);
+EXPORT_SYMBOL(zlib_dfltcc_support);
unsigned long VMALLOC_START;
EXPORT_SYMBOL(VMALLOC_START);
@@ -759,14 +761,6 @@ static void __init free_mem_detect_info(void)
memblock_free(start, size);
}
-static void __init memblock_physmem_add(phys_addr_t start, phys_addr_t size)
-{
- memblock_dbg("memblock_physmem_add: [%#016llx-%#016llx]\n",
- start, start + size - 1);
- memblock_add_range(&memblock.memory, start, size, 0, 0);
- memblock_add_range(&memblock.physmem, start, size, 0, 0);
-}
-
static const char * __init get_mem_info_source(void)
{
switch (mem_detect.info_source) {
@@ -791,8 +785,10 @@ static void __init memblock_add_mem_detect_info(void)
get_mem_info_source(), mem_detect.info_source);
/* keep memblock lists close to the kernel */
memblock_set_bottom_up(true);
- for_each_mem_detect_block(i, &start, &end)
+ for_each_mem_detect_block(i, &start, &end) {
+ memblock_add(start, end - start);
memblock_physmem_add(start, end - start);
+ }
memblock_set_bottom_up(false);
memblock_dump_all();
}

drivers/acpi/thermal.c

View file
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index d831a61..19067a5 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -27,6 +27,7 @@
#include <linux/acpi.h>
#include <linux/workqueue.h>
#include <linux/uaccess.h>
+#include <linux/units.h>
#define PREFIX "ACPI: "
@@ -172,7 +173,7 @@ struct acpi_thermal {
struct acpi_handle_list devices;
struct thermal_zone_device *thermal_zone;
int tz_enabled;
- int kelvin_offset;
+ int kelvin_offset; /* in millidegrees */
struct work_struct thermal_check_work;
};
@@ -297,7 +298,8 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
if (crt == -1) {
tz->trips.critical.flags.valid = 0;
} else if (crt > 0) {
- unsigned long crt_k = CELSIUS_TO_DECI_KELVIN(crt);
+ unsigned long crt_k = celsius_to_deci_kelvin(crt);
+
/*
* Allow override critical threshold
*/
@@ -333,7 +335,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
if (psv == -1) {
status = AE_SUPPORT;
} else if (psv > 0) {
- tmp = CELSIUS_TO_DECI_KELVIN(psv);
+ tmp = celsius_to_deci_kelvin(psv);
status = AE_OK;
} else {
status = acpi_evaluate_integer(tz->device->handle,
@@ -413,7 +415,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
break;
if (i == 1)
tz->trips.active[0].temperature =
- CELSIUS_TO_DECI_KELVIN(act);
+ celsius_to_deci_kelvin(act);
else
/*
* Don't allow override higher than
@@ -421,9 +423,9 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
*/
tz->trips.active[i - 1].temperature =
(tz->trips.active[i - 2].temperature <
- CELSIUS_TO_DECI_KELVIN(act) ?
+ celsius_to_deci_kelvin(act) ?
tz->trips.active[i - 2].temperature :
- CELSIUS_TO_DECI_KELVIN(act));
+ celsius_to_deci_kelvin(act));
break;
} else {
tz->trips.active[i].temperature = tmp;
@@ -519,7 +521,7 @@ static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
if (result)
return result;
- *temp = DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(tz->temperature,
+ *temp = deci_kelvin_to_millicelsius_with_offset(tz->temperature,
tz->kelvin_offset);
return 0;
}
@@ -624,7 +626,7 @@ static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
if (tz->trips.critical.flags.valid) {
if (!trip) {
- *temp = DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(
+ *temp = deci_kelvin_to_millicelsius_with_offset(
tz->trips.critical.temperature,
tz->kelvin_offset);
return 0;
@@ -634,7 +636,7 @@ static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
if (tz->trips.hot.flags.valid) {
if (!trip) {
- *temp = DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(
+ *temp = deci_kelvin_to_millicelsius_with_offset(
tz->trips.hot.temperature,
tz->kelvin_offset);
return 0;
@@ -644,7 +646,7 @@ static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
if (tz->trips.passive.flags.valid) {
if (!trip) {
- *temp = DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(
+ *temp = deci_kelvin_to_millicelsius_with_offset(
tz->trips.passive.temperature,
tz->kelvin_offset);
return 0;
@@ -655,7 +657,7 @@ static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
tz->trips.active[i].flags.valid; i++) {
if (!trip) {
- *temp = DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(
+ *temp = deci_kelvin_to_millicelsius_with_offset(
tz->trips.active[i].temperature,
tz->kelvin_offset);
return 0;
@@ -672,7 +674,7 @@ static int thermal_get_crit_temp(struct thermal_zone_device *thermal,
struct acpi_thermal *tz = thermal->devdata;
if (tz->trips.critical.flags.valid) {
- *temperature = DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(
+ *temperature = deci_kelvin_to_millicelsius_with_offset(
tz->trips.critical.temperature,
tz->kelvin_offset);
return 0;
@@ -692,7 +694,7 @@ static int thermal_get_trend(struct thermal_zone_device *thermal,
if (type == THERMAL_TRIP_ACTIVE) {
int trip_temp;
- int temp = DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(
+ int temp = deci_kelvin_to_millicelsius_with_offset(
tz->temperature, tz->kelvin_offset);
if (thermal_get_trip_temp(thermal, trip, &trip_temp))
return -EINVAL;
@@ -1043,9 +1045,9 @@ static void acpi_thermal_guess_offset(struct acpi_thermal *tz)
{
if (tz->trips.critical.flags.valid &&
(tz->trips.critical.temperature % 5) == 1)
- tz->kelvin_offset = 2731;
+ tz->kelvin_offset = 273100;
else
- tz->kelvin_offset = 2732;
+ tz->kelvin_offset = 273200;
}
static void acpi_thermal_check_fn(struct work_struct *work)
@@ -1087,7 +1089,7 @@ static int acpi_thermal_add(struct acpi_device *device)
INIT_WORK(&tz->thermal_check_work, acpi_thermal_check_fn);
pr_info(PREFIX "%s [%s] (%ld C)\n", acpi_device_name(device),
- acpi_device_bid(device), DECI_KELVIN_TO_CELSIUS(tz->temperature));
+ acpi_device_bid(device), deci_kelvin_to_celsius(tz->temperature));
goto end;
free_memory:

drivers/base/memory.c

View file
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 799b431..1565930 100644
--- a/drivers/base/memory.c

This diff is incomplete. Download the complete patch.

drivers/block/zram/zram_drv.c

View file

This diff is incomplete. Download the complete patch.

drivers/gpu/drm/via/via_dmablit.c

View file

This diff is incomplete. Download the complete patch.

drivers/iio/adc/qcom-vadc-common.c

View file

This diff is incomplete. Download the complete patch.

drivers/iio/adc/qcom-vadc-common.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/core/umem.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/core/umem_odp.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/hfi1/user_pages.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mthca/mthca_memfree.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_user_pages.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_user_sdma.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/usnic/usnic_uiom.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/sw/siw/siw_mem.c

View file

This diff is incomplete. Download the complete patch.

drivers/media/v4l2-core/videobuf-dma-sg.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlegacy/4965-mac.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlegacy/4965.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlegacy/common.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlwifi/dvm/dev.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlwifi/dvm/devices.c

View file

This diff is incomplete. Download the complete patch.

drivers/nvdimm/pmem.c

View file

This diff is incomplete. Download the complete patch.

drivers/nvme/host/hwmon.c

View file

This diff is incomplete. Download the complete patch.

drivers/platform/goldfish/goldfish_pipe.c

View file

This diff is incomplete. Download the complete patch.

drivers/platform/x86/asus-wmi.c

View file

This diff is incomplete. Download the complete patch.

drivers/platform/x86/intel_menlow.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/armada_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/intel/intel_pch_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/vfio/vfio_iommu_type1.c

View file

This diff is incomplete. Download the complete patch.

fs/binfmt_elf.c

View file

This diff is incomplete. Download the complete patch.

fs/btrfs/compression.c

View file

This diff is incomplete. Download the complete patch.

fs/btrfs/zlib.c

View file

This diff is incomplete. Download the complete patch.

fs/exec.c

View file

This diff is incomplete. Download the complete patch.

fs/fs-writeback.c

View file

This diff is incomplete. Download the complete patch.

fs/io_uring.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/cluster/quorum.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlm/Makefile

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlm/dlmast.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlm/dlmcommon.h

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlm/dlmconvert.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlm/dlmdebug.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlm/dlmdomain.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlm/dlmlock.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlm/dlmmaster.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlm/dlmrecovery.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlm/dlmthread.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlm/dlmunlock.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlmfs/Makefile

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlmfs/dlmfs.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlmfs/userdlm.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlmglue.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/journal.h

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/namei.c

View file

This diff is incomplete. Download the complete patch.

fs/reiserfs/stree.c

View file

This diff is incomplete. Download the complete patch.

include/linux/backing-dev.h

View file

This diff is incomplete. Download the complete patch.

include/linux/bitops.h

View file

This diff is incomplete. Download the complete patch.

include/linux/fs.h

View file

This diff is incomplete. Download the complete patch.

include/linux/io-mapping.h

View file

This diff is incomplete. Download the complete patch.

include/linux/memblock.h

View file

This diff is incomplete. Download the complete patch.

include/linux/memory.h

View file

This diff is incomplete. Download the complete patch.

include/linux/memory_hotplug.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mm.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mmzone.h

View file

This diff is incomplete. Download the complete patch.

include/linux/page-isolation.h

View file

This diff is incomplete. Download the complete patch.

include/linux/swab.h

View file

This diff is incomplete. Download the complete patch.

include/linux/thermal.h

View file

This diff is incomplete. Download the complete patch.

include/linux/units.h

View file

This diff is incomplete. Download the complete patch.

include/linux/zlib.h

View file

This diff is incomplete. Download the complete patch.

include/trace/events/kmem.h

View file

This diff is incomplete. Download the complete patch.

include/trace/events/writeback.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/linux/swab.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/linux/sysctl.h

View file

This diff is incomplete. Download the complete patch.

init/main.c

View file

This diff is incomplete. Download the complete patch.

kernel/Makefile

View file

This diff is incomplete. Download the complete patch.

lib/Kconfig

View file

This diff is incomplete. Download the complete patch.

lib/Makefile

View file

This diff is incomplete. Download the complete patch.

lib/decompress_inflate.c

View file

This diff is incomplete. Download the complete patch.

lib/find_bit.c

View file

This diff is incomplete. Download the complete patch.

lib/scatterlist.c

View file

This diff is incomplete. Download the complete patch.

lib/test_bitmap.c

View file

This diff is incomplete. Download the complete patch.

lib/test_kasan.c

View file

This diff is incomplete. Download the complete patch.

lib/zlib_deflate/deflate.c

View file

This diff is incomplete. Download the complete patch.

lib/zlib_deflate/deflate_syms.c

View file

This diff is incomplete. Download the complete patch.

lib/zlib_deflate/deftree.c

View file

This diff is incomplete. Download the complete patch.

lib/zlib_deflate/defutil.h

View file

This diff is incomplete. Download the complete patch.

lib/zlib_dfltcc/Makefile

View file

This diff is incomplete. Download the complete patch.

lib/zlib_dfltcc/dfltcc.c

View file

This diff is incomplete. Download the complete patch.

lib/zlib_dfltcc/dfltcc.h

View file

This diff is incomplete. Download the complete patch.

lib/zlib_dfltcc/dfltcc_deflate.c

View file

This diff is incomplete. Download the complete patch.

lib/zlib_dfltcc/dfltcc_inflate.c

View file

This diff is incomplete. Download the complete patch.

lib/zlib_dfltcc/dfltcc_syms.c

View file

This diff is incomplete. Download the complete patch.

lib/zlib_dfltcc/dfltcc_util.h

View file

This diff is incomplete. Download the complete patch.

lib/zlib_inflate/inflate.c

View file

This diff is incomplete. Download the complete patch.

lib/zlib_inflate/inflate.h

View file

This diff is incomplete. Download the complete patch.

lib/zlib_inflate/infutil.h

View file

This diff is incomplete. Download the complete patch.

mm/Makefile

View file

This diff is incomplete. Download the complete patch.

mm/backing-dev.c

View file

This diff is incomplete. Download the complete patch.

mm/debug.c

View file

This diff is incomplete. Download the complete patch.

mm/early_ioremap.c

View file

This diff is incomplete. Download the complete patch.

mm/filemap.c

View file

This diff is incomplete. Download the complete patch.

mm/gup.c

View file

This diff is incomplete. Download the complete patch.

mm/gup_benchmark.c

View file

This diff is incomplete. Download the complete patch.

mm/huge_memory.c

View file

This diff is incomplete. Download the complete patch.

mm/kmemleak.c

View file

This diff is incomplete. Download the complete patch.

mm/memblock.c

View file

This diff is incomplete. Download the complete patch.

mm/memcontrol.c

View file

This diff is incomplete. Download the complete patch.

mm/memory_hotplug.c

View file

This diff is incomplete. Download the complete patch.

mm/mempolicy.c

View file

This diff is incomplete. Download the complete patch.

mm/memremap.c

View file

This diff is incomplete. Download the complete patch.

mm/migrate.c

View file

This diff is incomplete. Download the complete patch.

mm/mmap.c

View file

This diff is incomplete. Download the complete patch.

mm/oom_kill.c

View file

This diff is incomplete. Download the complete patch.

mm/page_alloc.c

View file

This diff is incomplete. Download the complete patch.

mm/page_isolation.c

View file

This diff is incomplete. Download the complete patch.

mm/page_vma_mapped.c

View file

This diff is incomplete. Download the complete patch.

mm/process_vm_access.c

View file

This diff is incomplete. Download the complete patch.

mm/slub.c

View file

This diff is incomplete. Download the complete patch.

mm/sparse.c

View file

This diff is incomplete. Download the complete patch.

mm/swap.c

View file

This diff is incomplete. Download the complete patch.

mm/swapfile.c

View file

This diff is incomplete. Download the complete patch.

mm/vmscan.c

View file

This diff is incomplete. Download the complete patch.

mm/zswap.c

View file

This diff is incomplete. Download the complete patch.

net/xdp/xdp_umem.c

View file

This diff is incomplete. Download the complete patch.

scripts/spelling.txt

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/vm/gup_benchmark.c

View file

This diff is incomplete. Download the complete patch.

tools/vm/slabinfo.c

View file

This diff is incomplete. Download the complete patch.