1. 03 6月, 2019 35 次提交
  2. 02 6月, 2019 5 次提交
    • L
      Merge branch 'akpm' (patches from Andrew) · 7b3064f0
      Linus Torvalds 提交于
      Merge misc fixes from Andrew Morton:
       "Various fixes and followups"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mm, compaction: make sure we isolate a valid PFN
        include/linux/generic-radix-tree.h: fix kerneldoc comment
        kernel/signal.c: trace_signal_deliver when signal_group_exit
        drivers/iommu/intel-iommu.c: fix variable 'iommu' set but not used
        spdxcheck.py: fix directory structures
        kasan: initialize tag to 0xff in __kasan_kmalloc
        z3fold: fix sheduling while atomic
        scripts/gdb: fix invocation when CONFIG_COMMON_CLK is not set
        mm/gup: continue VM_FAULT_RETRY processing even for pre-faults
        ocfs2: fix error path kobject memory leak
        memcg: make it work on sparse non-0-node systems
        mm, memcg: consider subtrees in memory.events
        prctl_set_mm: downgrade mmap_sem to read lock
        prctl_set_mm: refactor checks from validate_prctl_map
        kernel/fork.c: make max_threads symbol static
        arch/arm/boot/compressed/decompress.c: fix build error due to lz4 changes
        arch/parisc/configs/c8000_defconfig: remove obsoleted CONFIG_DEBUG_SLAB_LEAK
        mm/vmalloc.c: fix typo in comment
        lib/sort.c: fix kernel-doc notation warnings
        mm: fix Documentation/vm/hmm.rst Sphinx warnings
      7b3064f0
    • S
      mm, compaction: make sure we isolate a valid PFN · e577c8b6
      Suzuki K Poulose 提交于
      When we have holes in a normal memory zone, we could endup having
      cached_migrate_pfns which may not necessarily be valid, under heavy memory
      pressure with swapping enabled ( via __reset_isolation_suitable(),
      triggered by kswapd).
      
      Later if we fail to find a page via fast_isolate_freepages(), we may end
      up using the migrate_pfn we started the search with, as valid page.  This
      could lead to accessing NULL pointer derefernces like below, due to an
      invalid mem_section pointer.
      
      Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 [47/1825]
       Mem abort info:
         ESR = 0x96000004
         Exception class = DABT (current EL), IL = 32 bits
         SET = 0, FnV = 0
         EA = 0, S1PTW = 0
       Data abort info:
         ISV = 0, ISS = 0x00000004
         CM = 0, WnR = 0
       user pgtable: 4k pages, 48-bit VAs, pgdp = 0000000082f94ae9
       [0000000000000008] pgd=0000000000000000
       Internal error: Oops: 96000004 [#1] SMP
       ...
       CPU: 10 PID: 6080 Comm: qemu-system-aar Not tainted 510-rc1+ #6
       Hardware name: AmpereComputing(R) OSPREY EV-883832-X3-0001/OSPREY, BIOS 4819 09/25/2018
       pstate: 60000005 (nZCv daif -PAN -UAO)
       pc : set_pfnblock_flags_mask+0x58/0xe8
       lr : compaction_alloc+0x300/0x950
       [...]
       Process qemu-system-aar (pid: 6080, stack limit = 0x0000000095070da5)
       Call trace:
        set_pfnblock_flags_mask+0x58/0xe8
        compaction_alloc+0x300/0x950
        migrate_pages+0x1a4/0xbb0
        compact_zone+0x750/0xde8
        compact_zone_order+0xd8/0x118
        try_to_compact_pages+0xb4/0x290
        __alloc_pages_direct_compact+0x84/0x1e0
        __alloc_pages_nodemask+0x5e0/0xe18
        alloc_pages_vma+0x1cc/0x210
        do_huge_pmd_anonymous_page+0x108/0x7c8
        __handle_mm_fault+0xdd4/0x1190
        handle_mm_fault+0x114/0x1c0
        __get_user_pages+0x198/0x3c0
        get_user_pages_unlocked+0xb4/0x1d8
        __gfn_to_pfn_memslot+0x12c/0x3b8
        gfn_to_pfn_prot+0x4c/0x60
        kvm_handle_guest_abort+0x4b0/0xcd8
        handle_exit+0x140/0x1b8
        kvm_arch_vcpu_ioctl_run+0x260/0x768
        kvm_vcpu_ioctl+0x490/0x898
        do_vfs_ioctl+0xc4/0x898
        ksys_ioctl+0x8c/0xa0
        __arm64_sys_ioctl+0x28/0x38
        el0_svc_common+0x74/0x118
        el0_svc_handler+0x38/0x78
        el0_svc+0x8/0xc
       Code: f8607840 f100001f 8b011401 9a801020 (f9400400)
       ---[ end trace af6a35219325a9b6 ]---
      
      The issue was reported on an arm64 server with 128GB with holes in the
      zone (e.g, [32GB@4GB, 96GB@544GB]), with a swap device enabled, while
      running 100 KVM guest instances.
      
      This patch fixes the issue by ensuring that the page belongs to a valid
      PFN when we fallback to using the lower limit of the scan range upon
      failure in fast_isolate_freepages().
      
      Link: http://lkml.kernel.org/r/1558711908-15688-1-git-send-email-suzuki.poulose@arm.com
      Fixes: 5a811889 ("mm, compaction: use free lists to quickly locate a migration target")
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Reported-by: NMarc Zyngier <marc.zyngier@arm.com>
      Reviewed-by: NMel Gorman <mgorman@techsingularity.net>
      Reviewed-by: NAnshuman Khandual <anshuman.khandual@arm.com>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Qian Cai <cai@lca.pw>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e577c8b6
    • J
      include/linux/generic-radix-tree.h: fix kerneldoc comment · 590ba22b
      Jonathan Corbet 提交于
      The DOC comment block section in include/linux/generic-radix-tree.h
      contained a spurious colon, causing this warning in the documentation
      build:
      
        include/linux/generic-radix-tree.h:1: warning: no structured comments found
      
      Remove the colon and make the docs build happy.
      
      Link: http://lkml.kernel.org/r/20190524141933.74ae9050@lwn.netSigned-off-by: NJonathan Corbet <corbet@lwn.net>
      Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Kent Overstreet <kent.overstreet@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      590ba22b
    • Z
      kernel/signal.c: trace_signal_deliver when signal_group_exit · 98af37d6
      Zhenliang Wei 提交于
      In the fixes commit, removing SIGKILL from each thread signal mask and
      executing "goto fatal" directly will skip the call to
      "trace_signal_deliver".  At this point, the delivery tracking of the
      SIGKILL signal will be inaccurate.
      
      Therefore, we need to add trace_signal_deliver before "goto fatal" after
      executing sigdelset.
      
      Note: SEND_SIG_NOINFO matches the fact that SIGKILL doesn't have any info.
      
      Link: http://lkml.kernel.org/r/20190425025812.91424-1-weizhenliang@huawei.com
      Fixes: cf43a757 ("signal: Restore the stop PTRACE_EVENT_EXIT")
      Signed-off-by: NZhenliang Wei <weizhenliang@huawei.com>
      Reviewed-by: NChristian Brauner <christian@brauner.io>
      Reviewed-by: NOleg Nesterov <oleg@redhat.com>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: Ivan Delalande <colona@arista.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Deepa Dinamani <deepa.kernel@gmail.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      98af37d6
    • Q
      drivers/iommu/intel-iommu.c: fix variable 'iommu' set but not used · d3ed71e5
      Qian Cai 提交于
      Commit cf04eee8 ("iommu/vt-d: Include ACPI devices in iommu=pt")
      added for_each_active_iommu() in iommu_prepare_static_identity_mapping()
      but never used the each element, i.e, "drhd->iommu".
      
      drivers/iommu/intel-iommu.c: In function
      'iommu_prepare_static_identity_mapping':
      drivers/iommu/intel-iommu.c:3037:22: warning: variable 'iommu' set but
      not used [-Wunused-but-set-variable]
       struct intel_iommu *iommu;
      
      Fixed the warning by appending a compiler attribute __maybe_unused for it.
      
      Link: http://lkml.kernel.org/r/20190523013314.2732-1-cai@lca.pwSigned-off-by: NQian Cai <cai@lca.pw>
      Suggested-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Joerg Roedel <jroedel@suse.de>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d3ed71e5