Merge branch 'akpm' (second patch-bomb from Andrew)
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 13 Dec 2014 21:00:36 +0000 (13:00 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 13 Dec 2014 21:00:36 +0000 (13:00 -0800)
Merge second patchbomb from Andrew Morton:
 - the rest of MM
 - misc fs fixes
 - add execveat() syscall
 - new ratelimit feature for fault-injection
 - decompressor updates
 - ipc/ updates
 - fallocate feature creep
 - fsnotify cleanups
 - a few other misc things

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (99 commits)
  cgroups: Documentation: fix trivial typos and wrong paragraph numberings
  parisc: percpu: update comments referring to __get_cpu_var
  percpu: update local_ops.txt to reflect this_cpu operations
  percpu: remove __get_cpu_var and __raw_get_cpu_var macros
  fsnotify: remove destroy_list from fsnotify_mark
  fsnotify: unify inode and mount marks handling
  fallocate: create FAN_MODIFY and IN_MODIFY events
  mm/cma: make kmemleak ignore CMA regions
  slub: fix cpuset check in get_any_partial
  slab: fix cpuset check in fallback_alloc
  shmdt: use i_size_read() instead of ->i_size
  ipc/shm.c: fix overly aggressive shmdt() when calls span multiple segments
  ipc/msg: increase MSGMNI, remove scaling
  ipc/sem.c: increase SEMMSL, SEMMNI, SEMOPM
  ipc/sem.c: change memory barrier in sem_lock() to smp_rmb()
  lib/decompress.c: consistency of compress formats for kernel image
  decompress_bunzip2: off by one in get_next_block()
  usr/Kconfig: make initrd compression algorithm selection not expert
  fault-inject: add ratelimit option
  ratelimit: add initialization macro
  ...

1  2 
Documentation/kernel-parameters.txt
MAINTAINERS
arch/arm/Kconfig
drivers/iommu/amd_iommu_v2.c

@@@ -829,6 -829,15 +829,15 @@@ bytes respectively. Such letter suffixe
                        CONFIG_DEBUG_PAGEALLOC, hence this option will not help
                        tracking down these problems.
  
+       debug_pagealloc=
+                       [KNL] When CONFIG_DEBUG_PAGEALLOC is set, this
+                       parameter enables the feature at boot time. In
+                       default, it is disabled. We can avoid allocating huge
+                       chunk of memory for debug pagealloc if we don't enable
+                       it at boot time and the system will work mostly same
+                       with the kernel built without CONFIG_DEBUG_PAGEALLOC.
+                       on: enable the feature
        debugpat        [X86] Enable PAT debugging
  
        decnet.addr=    [HW,NET]
                        multiple times interleaved with hugepages= to reserve
                        huge pages of different sizes. Valid pages sizes on
                        x86-64 are 2M (when the CPU supports "pse") and 1G
-                       (when the CPU supports the "pdpe1gb" cpuinfo flag)
-                       Note that 1GB pages can only be allocated at boot time
-                       using hugepages= and not freed afterwards.
+                       (when the CPU supports the "pdpe1gb" cpuinfo flag).
  
        hvc_iucv=       [S390] Number of z/VM IUCV hypervisor console (HVC)
                               terminal devices. Valid values: 0..8
        OSS             [HW,OSS]
                        See Documentation/sound/oss/oss-parameters.txt
  
+       page_owner=     [KNL] Boot-time page_owner enabling option.
+                       Storage of the information about who allocated
+                       each page is disabled in default. With this switch,
+                       we can turn it on.
+                       on: enable the feature
        panic=          [KNL] Kernel behaviour on panic: delay <timeout>
                        timeout > 0: seconds before rebooting
                        timeout = 0: wait forever
                        neutralize any effect of /proc/sys/kernel/sysrq.
                        Useful for debugging.
  
 +      tcpmhash_entries= [KNL,NET]
 +                      Set the number of tcp_metrics_hash slots.
 +                      Default value is 8192 or 16384 depending on total
 +                      ram pages. This is used to specify the TCP metrics
 +                      cache size. See Documentation/networking/ip-sysctl.txt
 +                      "tcp_no_metrics_save" section for more details.
 +
        tdfx=           [HW,DRM]
  
        test_suspend=   [SUSPEND][,N]
diff --combined MAINTAINERS
@@@ -1722,13 -1722,6 +1722,13 @@@ F:    drivers/dma/at_hdmac.
  F:    drivers/dma/at_hdmac_regs.h
  F:    include/linux/platform_data/dma-atmel.h
  
 +ATMEL XDMA DRIVER
 +M:    Ludovic Desroches <ludovic.desroches@atmel.com>
 +L:    linux-arm-kernel@lists.infradead.org
 +L:    dmaengine@vger.kernel.org
 +S:    Supported
 +F:    drivers/dma/at_xdmac.c
 +
  ATMEL I2C DRIVER
  M:    Ludovic Desroches <ludovic.desroches@atmel.com>
  L:    linux-i2c@vger.kernel.org
@@@ -3169,8 -3162,7 +3169,8 @@@ Q:      https://patchwork.kernel.org/project
  S:    Maintained
  F:    drivers/dma/
  F:    include/linux/dma*
 -T:    git git://git.infradead.org/users/vkoul/slave-dma.git (slave-dma)
 +F:    Documentation/dmaengine/
 +T:    git git://git.infradead.org/users/vkoul/slave-dma.git
  
  DME1737 HARDWARE MONITOR DRIVER
  M:    Juerg Haefliger <juergh@gmail.com>
@@@ -4045,7 -4037,7 +4045,7 @@@ F:      drivers/tty/serial/ucc_uart.
  FREESCALE SOC SOUND DRIVERS
  M:    Timur Tabi <timur@tabi.org>
  M:    Nicolin Chen <nicoleotsuka@gmail.com>
- M:    Xiubo Li <Li.Xiubo@freescale.com>
+ M:    Xiubo Li <Xiubo.Lee@gmail.com>
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
  L:    linuxppc-dev@lists.ozlabs.org
  S:    Maintained
diff --combined arch/arm/Kconfig
@@@ -5,6 -5,7 +5,7 @@@ config AR
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_HAVE_CUSTOM_GPIO_H
+       select ARCH_HAS_GCOV_PROFILE_ALL
        select ARCH_MIGHT_HAVE_PC_PARPORT
        select ARCH_SUPPORTS_ATOMIC_RMW
        select ARCH_USE_BUILTIN_BSWAP
@@@ -687,9 -688,7 +688,9 @@@ config ARCH_SA110
        select CPU_SA1100
        select GENERIC_CLOCKEVENTS
        select HAVE_IDE
 +      select IRQ_DOMAIN
        select ISA
 +      select MULTI_IRQ_HANDLER
        select NEED_MACH_MEMORY_H
        select SPARSE_IRQ
        help
@@@ -279,8 -279,10 +279,8 @@@ static void free_pasid_state(struct pas
  
  static void put_pasid_state(struct pasid_state *pasid_state)
  {
 -      if (atomic_dec_and_test(&pasid_state->count)) {
 -              put_device_state(pasid_state->device_state);
 +      if (atomic_dec_and_test(&pasid_state->count))
                wake_up(&pasid_state->wq);
 -      }
  }
  
  static void put_pasid_state_wait(struct pasid_state *pasid_state)
  
        prepare_to_wait(&pasid_state->wq, &wait, TASK_UNINTERRUPTIBLE);
  
 -      if (atomic_dec_and_test(&pasid_state->count))
 -              put_device_state(pasid_state->device_state);
 -      else
 +      if (!atomic_dec_and_test(&pasid_state->count))
                schedule();
  
        finish_wait(&pasid_state->wq, &wait);
@@@ -509,45 -513,67 +509,67 @@@ static void finish_pri_tag(struct devic
        spin_unlock_irqrestore(&pasid_state->lock, flags);
  }
  
+ static void handle_fault_error(struct fault *fault)
+ {
+       int status;
+       if (!fault->dev_state->inv_ppr_cb) {
+               set_pri_tag_status(fault->state, fault->tag, PPR_INVALID);
+               return;
+       }
+       status = fault->dev_state->inv_ppr_cb(fault->dev_state->pdev,
+                                             fault->pasid,
+                                             fault->address,
+                                             fault->flags);
+       switch (status) {
+       case AMD_IOMMU_INV_PRI_RSP_SUCCESS:
+               set_pri_tag_status(fault->state, fault->tag, PPR_SUCCESS);
+               break;
+       case AMD_IOMMU_INV_PRI_RSP_INVALID:
+               set_pri_tag_status(fault->state, fault->tag, PPR_INVALID);
+               break;
+       case AMD_IOMMU_INV_PRI_RSP_FAIL:
+               set_pri_tag_status(fault->state, fault->tag, PPR_FAILURE);
+               break;
+       default:
+               BUG();
+       }
+ }
  static void do_fault(struct work_struct *work)
  {
        struct fault *fault = container_of(work, struct fault, work);
-       int npages, write;
-       struct page *page;
+       struct mm_struct *mm;
+       struct vm_area_struct *vma;
+       u64 address;
+       int ret, write;
  
        write = !!(fault->flags & PPR_FAULT_WRITE);
  
-       down_read(&fault->state->mm->mmap_sem);
-       npages = get_user_pages(NULL, fault->state->mm,
-                               fault->address, 1, write, 0, &page, NULL);
-       up_read(&fault->state->mm->mmap_sem);
-       if (npages == 1) {
-               put_page(page);
-       } else if (fault->dev_state->inv_ppr_cb) {
-               int status;
-               status = fault->dev_state->inv_ppr_cb(fault->dev_state->pdev,
-                                                     fault->pasid,
-                                                     fault->address,
-                                                     fault->flags);
-               switch (status) {
-               case AMD_IOMMU_INV_PRI_RSP_SUCCESS:
-                       set_pri_tag_status(fault->state, fault->tag, PPR_SUCCESS);
-                       break;
-               case AMD_IOMMU_INV_PRI_RSP_INVALID:
-                       set_pri_tag_status(fault->state, fault->tag, PPR_INVALID);
-                       break;
-               case AMD_IOMMU_INV_PRI_RSP_FAIL:
-                       set_pri_tag_status(fault->state, fault->tag, PPR_FAILURE);
-                       break;
-               default:
-                       BUG();
-               }
-       } else {
-               set_pri_tag_status(fault->state, fault->tag, PPR_INVALID);
+       mm = fault->state->mm;
+       address = fault->address;
+       down_read(&mm->mmap_sem);
+       vma = find_extend_vma(mm, address);
+       if (!vma || address < vma->vm_start) {
+               /* failed to get a vma in the right range */
+               up_read(&mm->mmap_sem);
+               handle_fault_error(fault);
+               goto out;
        }
  
+       ret = handle_mm_fault(mm, vma, address, write);
+       if (ret & VM_FAULT_ERROR) {
+               /* failed to service fault */
+               up_read(&mm->mmap_sem);
+               handle_fault_error(fault);
+               goto out;
+       }
+       up_read(&mm->mmap_sem);
+ out:
        finish_pri_tag(fault->dev_state, fault->state, fault->tag);
  
        put_pasid_state(fault->state);