All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

  1. 15 Apr, 2016 1 commit
  2. 07 Apr, 2016 1 commit
    • Alexander Duyck's avatar
      GRE: Disable segmentation offloads w/ CSUM and we are encapsulated via FOU · a0ca153f
      Alexander Duyck authored
      This patch fixes an issue I found in which we were dropping frames if we
      had enabled checksums on GRE headers that were encapsulated by either FOU
      or GUE.  Without this patch I was barely able to get 1 Gb/s of throughput.
      With this patch applied I am now at least getting around 6 Gb/s.
      The issue is due to the fact that with FOU or GUE applied we do not provide
      a transport offset pointing to the GRE header, nor do we offload it in
      software as the GRE header is completely skipped by GSO and treated like a
      VXLAN or GENEVE type header.  As such we need to prevent the stack from
      generating it and also prevent GRE from generating it via any interface we
      Fixes: c3483384 ("gro: Allow tunnel stacking in the case of FOU/GUE")
      Signed-off-by: default avatarAlexander Duyck <>
      Signed-off-by: default avatarDavid S. Miller <>
  3. 05 Apr, 2016 2 commits
    • Paolo Bonzini's avatar
      compiler-gcc: disable -ftracer for __noclone functions · 95272c29
      Paolo Bonzini authored
      -ftracer can duplicate asm blocks causing compilation to fail in
      noclone functions.  For example, KVM declares a global variable
      in an asm like
          asm("2: ... \n
               .pushsection data \n
               .global vmx_return \n
               vmx_return: .long 2b");
      and -ftracer causes a double declaration.
      Cc: Andrew Morton <>
      Cc: Michal Marek <>
      Reported-by: default avatarLinda Walsh <>
      Signed-off-by: default avatarPaolo Bonzini <>
    • Arnd Bergmann's avatar
      iommu: provide of_xlate pointer unconditionally · b70bb984
      Arnd Bergmann authored
      iommu drivers that support the standard DT bindings use a of_xlate
      callback pointer, but that is only part of struct iommu_ops when
      CONFIG_OF_IOMMU is enabled, leading to build errors in randconfig
      builds when that is not provided:
      drivers/iommu/mtk_iommu.c:497:2: error: unknown field 'of_xlate' specified in initializer
        .of_xlate = mtk_iommu_of_xlate,
      drivers/iommu/mtk_iommu.c:497:14: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
        .of_xlate = mtk_iommu_of_xlate,
      drivers/iommu/mtk_iommu.c:497:14: note: (near initialization for 'mtk_iommu_ops.domain_get_attr')
      We can work around it by adding more #ifdefs in each driver, but
      it seems nicer to just allow setting the pointer even if it is
      unused. This makes the driver code look nicer, and it gives better
      compile-time coverage when test building on other architectures.
      Signed-off-by: default avatarArnd Bergmann <>
      Fixes: 0df4fabe ("iommu/mediatek: Add mt8173 IOMMU driver")
      Reviewed-by: default avatarRobin Murphy <>
      Signed-off-by: default avatarJoerg Roedel <>
  4. 04 Apr, 2016 3 commits
  5. 01 Apr, 2016 4 commits
    • Chen Gang's avatar
      include/linux/huge_mm.h: return NULL instead of false for pmd_trans_huge_lock() · 969e8d7e
      Chen Gang authored
      The return value of pmd_trans_huge_lock() is a pointer, not a boolean
      value, so use NULL instead of false as the return value.
      Signed-off-by: default avatarChen Gang <>
      Acked-by: default avatarKirill A. Shutemov <>
      Signed-off-by: default avatarAndrew Morton <>
      Signed-off-by: default avatarLinus Torvalds <>
    • Giuseppe CAVALLARO's avatar
      stmmac: fix MDIO settings · a7657f12
      Giuseppe CAVALLARO authored
      Initially the phy_bus_name was added to manipulate the
      driver name but it was recently just used to manage the
      fixed-link and then to take some decision at run-time.
      So the patch uses the is_pseudo_fixed_link and removes
      the phy_bus_name variable not necessary anymore.
      The driver can manage the mdio registration by using phy-handle,
      dwmac-mdio and own parameter e.g. snps,phy-addr.
      This patch takes care about all these possible configurations
      and fixes the mdio registration in case of there is a real
      transceiver or a switch (that needs to be managed by using
      Signed-off-by: default avatarGiuseppe Cavallaro <>
      Reviewed-by: default avatarAndreas Färber <>
      Tested-by: default avatarFrank Schäfer <>
      Cc: Gabriel Fernandez <>
      Cc: Dinh Nguyen <>
      Cc: David S. Miller <>
      Cc: Phil Reid <>
      Signed-off-by: default avatarDavid S. Miller <>
    • Giuseppe CAVALLARO's avatar
      Revert "stmmac: Fix 'eth0: No PHY found' regression" · d7e944c8
      Giuseppe CAVALLARO authored
      This reverts commit 88f8b1bb.
      due to problems on GeekBox and Banana Pi M1 board when
      connected to a real transceiver instead of a switch via
      Signed-off-by: default avatarGiuseppe Cavallaro <>
      Cc: Gabriel Fernandez <>
      Cc: Andreas Färber <>
      Cc: Frank Schäfer <>
      Cc: Dinh Nguyen <>
      Cc: David S. Miller <>
      Signed-off-by: default avatarDavid S. Miller <>
    • Daniel Borkmann's avatar
      tun, bpf: fix suspicious RCU usage in tun_{attach, detach}_filter · 5a5abb1f
      Daniel Borkmann authored
      Sasha Levin reported a suspicious rcu_dereference_protected() warning
      found while fuzzing with trinity that is similar to this one:
        [   52.765684] net/core/filter.c:2262 suspicious rcu_dereference_protected() usage!
        [   52.765688] other info that might help us debug this:
        [   52.765695] rcu_scheduler_active = 1, debug_locks = 1
        [   52.765701] 1 lock held by a.out/1525:
        [   52.765704]  #0:  (rtnl_mutex){+.+.+.}, at: [<ffffffff816a64b7>] rtnl_lock+0x17/0x20
        [   52.765721] stack backtrace:
        [   52.765728] CPU: 1 PID: 1525 Comm: a.out Not tainted 4.5.0+ #264
        [   52.765768] Call Trace:
        [   52.765775]  [<ffffffff813e488d>] dump_stack+0x85/0xc8
        [   52.765784]  [<ffffffff810f2fa5>] lockdep_rcu_suspicious+0xd5/0x110
        [   52.765792]  [<ffffffff816afdc2>] sk_detach_filter+0x82/0x90
        [   52.765801]  [<ffffffffa0883425>] tun_detach_filter+0x35/0x90 [tun]
        [   52.765810]  [<ffffffffa0884ed4>] __tun_chr_ioctl+0x354/0x1130 [tun]
        [   52.765818]  [<ffffffff8136fed0>] ? selinux_file_ioctl+0x130/0x210
        [   52.765827]  [<ffffffffa0885ce3>] tun_chr_ioctl+0x13/0x20 [tun]
        [   52.765834]  [<ffffffff81260ea6>] do_vfs_ioctl+0x96/0x690
        [   52.765843]  [<ffffffff81364af3>] ? security_file_ioctl+0x43/0x60
        [   52.765850]  [<ffffffff81261519>] SyS_ioctl+0x79/0x90
        [   52.765858]  [<ffffffff81003ba2>] do_syscall_64+0x62/0x140
        [   52.765866]  [<ffffffff817d563f>] entry_SYSCALL64_slow_path+0x25/0x25
      Same can be triggered with PROVE_RCU (+ PROVE_RCU_REPEATEDLY) enabled
      from tun_attach_filter() when user space calls ioctl(tun_fd, TUN{ATTACH,
      DETACH}FILTER, ...) for adding/removing a BPF filter on tap devices.
      Since the fix in f91ff5b9 ("net: sk_{detach|attach}_filter() rcu
      fixes") sk_attach_filter()/sk_detach_filter() now dereferences the
      filter with rcu_dereference_protected(), checking whether socket lock
      is held in control path.
      Since its introduction in 99405162 ("tun: socket filter support"),
      tap filters are managed under RTNL lock from __tun_chr_ioctl(). Thus the
      sock_owned_by_user(sk) doesn't apply in this specific case and therefore
      triggers the false positive.
      Extend the BPF API with __sk_attach_filter()/__sk_detach_filter() pair
      that is used by tap filters and pass in lockdep_rtnl_is_held() for the
      rcu_dereference_protected() checks instead.
      Reported-by: default avatarSasha Levin <>
      Signed-off-by: default avatarDaniel Borkmann <>
      Signed-off-by: default avatarDavid S. Miller <>
  6. 29 Mar, 2016 3 commits
  7. 28 Mar, 2016 2 commits
    • Dan Williams's avatar
      x86, pmem: use memcpy_mcsafe() for memcpy_from_pmem() · fc0c2028
      Dan Williams authored
      Update the definition of memcpy_from_pmem() to return 0 or a negative
      error code.  Implement x86/arch_memcpy_from_pmem() with memcpy_mcsafe().
      Cc: Borislav Petkov <>
      Cc: Tony Luck <>
      Cc: Thomas Gleixner <>
      Cc: Andy Lutomirski <>
      Cc: Peter Zijlstra <>
      Cc: Andrew Morton <>
      Cc: Linus Torvalds <>
      Acked-by: default avatarIngo Molnar <>
      Reviewed-by: default avatarRoss Zwisler <>
      Signed-off-by: default avatarDan Williams <>
    • Vishwanath Pai's avatar
      netfilter: ipset: fix race condition in ipset save, swap and delete · 596cf3fe
      Vishwanath Pai authored
      This fix adds a new reference counter (ref_netlink) for the struct ip_set.
      The other reference counter (ref) can be swapped out by ip_set_swap and we
      need a separate counter to keep track of references for netlink events
      like dump. Using the same ref counter for dump causes a race condition
      which can be demonstrated by the following script:
      ipset create hash_ip1 hash:ip family inet hashsize 1024 maxelem 500000 \
      ipset create hash_ip2 hash:ip family inet hashsize 300000 maxelem 500000 \
      ipset create hash_ip3 hash:ip family inet hashsize 1024 maxelem 500000 \
      ipset save &
      ipset swap hash_ip3 hash_ip2
      ipset destroy hash_ip3 /* will crash the machine */
      Swap will exchange the values of ref so destroy will see ref = 0 instead of
      ref = 1. With this fix in place swap will not succeed because ipset save
      still has ref_netlink on the set (ip_set_swap doesn't swap ref_netlink).
      Both delete and swap will error out if ref_netlink != 0 on the set.
      Note: The changes to *_head functions is because previously we would
      increment ref whenever we called these functions, we don't do that
      Reviewed-by: default avatarJoshua Hunt <>
      Signed-off-by: default avatarVishwanath Pai <>
      Signed-off-by: default avatarJozsef Kadlecsik <>
      Signed-off-by: default avatarPablo Neira Ayuso <>
  8. 26 Mar, 2016 1 commit
    • Miklos Szeredi's avatar
      fs: add file_dentry() · d101a125
      Miklos Szeredi authored
      This series fixes bugs in nfs and ext4 due to 4bacc9c9 ("overlayfs:
      Make f_path always point to the overlay and f_inode to the underlay").
      Regular files opened on overlayfs will result in the file being opened on
      the underlying filesystem, while f_path points to the overlayfs
      This confuses filesystems which get the dentry from struct file and assume
      it's theirs.
      Add a new helper, file_dentry() [*], to get the filesystem's own dentry
      from the file.  This checks file->f_path.dentry->d_flags against
      DCACHE_OP_REAL, and returns file->f_path.dentry if DCACHE_OP_REAL is not
      set (this is the common, non-overlayfs case).
      In the uncommon case it will call into overlayfs's ->d_real() to get the
      underlying dentry, matching file_inode(file).
      The reason we need to check against the inode is that if the file is copied
      up while being open, d_real() would return the upper dentry, while the open
      file comes from the lower dentry.
      [*] If possible, it's better simply to use file_inode() instead.
      Signed-off-by: default avatarMiklos Szeredi <>
      Signed-off-by: default avatarTheodore Ts'o <>
      Tested-by: default avatarGoldwyn Rodrigues <>
      Reviewed-by: default avatarTrond Myklebust <>
      Cc: <> # v4.2
      Cc: David Howells <>
      Cc: Al Viro <>
      Cc: Daniel Axtens <>
  9. 25 Mar, 2016 22 commits
    • Alexander Potapenko's avatar
      mm, kasan: stackdepot implementation. Enable stackdepot for SLAB · cd11016e
      Alexander Potapenko authored
      Implement the stack depot and provide CONFIG_STACKDEPOT.  Stack depot
      will allow KASAN store allocation/deallocation stack traces for memory
      chunks.  The stack traces are stored in a hash table and referenced by
      handles which reside in the kasan_alloc_meta and kasan_free_meta
      structures in the allocated memory chunks.
      IRQ stack traces are cut below the IRQ entry point to avoid unnecessary
      Right now stackdepot support is only enabled in SLAB allocator.  Once
      KASAN features in SLAB are on par with those in SLUB we can switch SLUB
      to stackdepot as well, thus removing the dependency on SLUB stack
      bookkeeping, which wastes a lot of memory.
      This patch is based on the "mm: kasan: stack depots" patch originally
      prepared by Dmitry Chernenkov.
      Joonsoo has said that he plans to reuse the stackdepot code for the
      mm/page_owner.c debugging facility.
      [ s/depot_stack_handle/depot_stack_handle_t]
      [ comment style fixes]
      Signed-off-by: default avatarAlexander Potapenko <>
      Signed-off-by: default avatarAndrey Ryabinin <>
      Cc: Christoph Lameter <>
      Cc: Pekka Enberg <>
      Cc: David Rientjes <>
      Cc: Joonsoo Kim <>
      Cc: Andrey Konovalov <>
      Cc: Dmitry Vyukov <>
      Cc: Steven Rostedt <>
      Cc: Konstantin Serebryany <>
      Cc: Dmitry Chernenkov <>
      Signed-off-by: default avatarAndrew Morton <>
      Signed-off-by: default avatarLinus Torvalds <>
    • Alexander Potapenko's avatar
      arch, ftrace: for KASAN put hard/soft IRQ entries into separate sections · be7635e7
      Alexander Potapenko authored
      KASAN needs to know whether the allocation happens in an IRQ handler.
      This lets us strip everything below the IRQ entry point to reduce the
      number of unique stack traces needed to be stored.
      Move the definition of __irq_entry to <linux/interrupt.h> so that the
      users don't need to pull in <linux/ftrace.h>.  Also introduce the
      __softirq_entry macro which is similar to __irq_entry, but puts the
      corresponding functions to the .softirqentry.text section.
      Signed-off-by: default avatarAlexander Potapenko <>
      Acked-by: default avatarSteven Rostedt <>
      Cc: Christoph Lameter <>
      Cc: Pekka Enberg <>
      Cc: David Rientjes <>
      Cc: Joonsoo Kim <>
      Cc: Andrey Konovalov <>
      Cc: Dmitry Vyukov <>
      Cc: Andrey Ryabinin <>
      Cc: Konstantin Serebryany <>
      Cc: Dmitry Chernenkov <>
      Signed-off-by: default avatarAndrew Morton <>
      Signed-off-by: default avatarLinus Torvalds <>
    • Alexander Potapenko's avatar
      mm, kasan: add GFP flags to KASAN API · 505f5dcb
      Alexander Potapenko authored
      Add GFP flags to KASAN hooks for future patches to use.
      This patch is based on the "mm: kasan: unified support for SLUB and SLAB
      allocators" patch originally prepared by Dmitry Chernenkov.
      Signed-off-by: default avatarAlexander Potapenko <>
      Cc: Christoph Lameter <>
      Cc: Pekka Enberg <>
      Cc: David Rientjes <>
      Cc: Joonsoo Kim <>
      Cc: Andrey Konovalov <>
      Cc: Dmitry Vyukov <>
      Cc: Andrey Ryabinin <>
      Cc: Steven Rostedt <>
      Cc: Konstantin Serebryany <>
      Cc: Dmitry Chernenkov <>
      Signed-off-by: default avatarAndrew Morton <>
      Signed-off-by: default avatarLinus Torvalds <>
    • Alexander Potapenko's avatar
      mm, kasan: SLAB support · 7ed2f9e6
      Alexander Potapenko authored
      Add KASAN hooks to SLAB allocator.
      This patch is based on the "mm: kasan: unified support for SLUB and SLAB
      allocators" patch originally prepared by Dmitry Chernenkov.
      Signed-off-by: default avatarAlexander Potapenko <>
      Cc: Christoph Lameter <>
      Cc: Pekka Enberg <>
      Cc: David Rientjes <>
      Cc: Joonsoo Kim <>
      Cc: Andrey Konovalov <>
      Cc: Dmitry Vyukov <>
      Cc: Andrey Ryabinin <>
      Cc: Steven Rostedt <>
      Cc: Konstantin Serebryany <>
      Cc: Dmitry Chernenkov <>
      Signed-off-by: default avatarAndrew Morton <>
      Signed-off-by: default avatarLinus Torvalds <>
    • Tetsuo Handa's avatar
      include/linux/oom.h: remove undefined oom_kills_count()/note_oom_kill() · aaf4fb71
      Tetsuo Handa authored
      A leftover from commit c32b3cbe ("oom, PM: make OOM detection in the
      freezer path raceless").
      Signed-off-by: default avatarTetsuo Handa <>
      Acked-by: default avatarMichal Hocko <>
      Signed-off-by: default avatarAndrew Morton <>
      Signed-off-by: default avatarLinus Torvalds <>
    • Tetsuo Handa's avatar
      oom, oom_reaper: protect oom_reaper_list using simpler way · bb29902a
      Tetsuo Handa authored
      "oom, oom_reaper: disable oom_reaper for oom_kill_allocating_task" tried
      to protect oom_reaper_list using MMF_OOM_KILLED flag.  But we can do it
      by simply checking tsk->oom_reaper_list != NULL.
      Signed-off-by: default avatarTetsuo Handa <>
      Signed-off-by: default avatarMichal Hocko <>
      Signed-off-by: default avatarAndrew Morton <>
      Signed-off-by: default avatarLinus Torvalds <>
    • Vladimir Davydov's avatar
      oom: make oom_reaper_list single linked · 29c696e1
      Vladimir Davydov authored
      Entries are only added/removed from oom_reaper_list at head so we can
      use a single linked list and hence save a word in task_struct.
      Signed-off-by: default avatarVladimir Davydov <>
      Signed-off-by: default avatarMichal Hocko <>
      Cc: Tetsuo Handa <>
      Cc: David Rientjes <>
      Signed-off-by: default avatarAndrew Morton <>
      Signed-off-by: default avatarLinus Torvalds <>
    • Michal Hocko's avatar
      oom, oom_reaper: disable oom_reaper for oom_kill_allocating_task · 855b0183
      Michal Hocko authored
      Tetsuo has reported that oom_kill_allocating_task=1 will cause
      oom_reaper_list corruption because oom_kill_process doesn't follow
      standard OOM exclusion (aka ignores TIF_MEMDIE) and allows to enqueue
      the same task multiple times - e.g.  by sacrificing the same child
      multiple times.
      This patch fixes the issue by introducing a new MMF_OOM_KILLED mm flag
      which is set in oom_kill_process atomically and oom reaper is disabled
      if the flag was already set.
      Signed-off-by: default avatarMichal Hocko <>
      Reported-by: default avatarTetsuo Handa <>
      Cc: David Rientjes <>
      Cc: Mel Gorman <>
      Cc: Oleg Nesterov <>
      Cc: Hugh Dickins <>
      Cc: Rik van Riel <>
      Signed-off-by: default avatarAndrew Morton <>
      Signed-off-by: default avatarLinus Torvalds <>
    • Michal Hocko's avatar
      mm, oom_reaper: implement OOM victims queuing · 03049269
      Michal Hocko authored
      wake_oom_reaper has allowed only 1 oom victim to be queued.  The main
      reason for that was the simplicity as other solutions would require some
      way of queuing.  The current approach is racy and that was deemed
      sufficient as the oom_reaper is considered a best effort approach to
      help with oom handling when the OOM victim cannot terminate in a
      reasonable time.  The race could lead to missing an oom victim which can
      get stuck
          cmpxchg // OK
      oom_victim terminates
      			      atomic_inc_not_zero // fail
          cmpxchg // fails
      			  task_to_reap = NULL
      This race requires 2 OOM invocations in a short time period which is not
      very likely but certainly not impossible.  E.g.  the original victim
      might have not released a lot of memory for some reason.
      The situation would improve considerably if wake_oom_reaper used a more
      robust queuing.  This is what this patch implements.  This means adding
      oom_reaper_list list_head into task_struct (eat a hole before embeded
      thread_struct for that purpose) and a oom_reaper_lock spinlock for
      queuing synchronization.  wake_oom_reaper will then add the task on the
      queue and oom_reaper will dequeue it.
      Signed-off-by: default avatarMichal Hocko <>
      Cc: Vladimir Davydov <>
      Cc: Andrea Argangeli <>
      Cc: David Rientjes <>
      Cc: Hugh Dickins <>
      Cc: Johannes Weiner <>
      Cc: Mel Gorman <>
      Cc: Oleg Nesterov <>
      Cc: Rik van Riel <>
      Cc: Tetsuo Handa <>
      Signed-off-by: default avatarAndrew Morton <>
      Signed-off-by: default avatarLinus Torvalds <>
    • Michal Hocko's avatar
      oom: clear TIF_MEMDIE after oom_reaper managed to unmap the address space · 36324a99
      Michal Hocko authored
      When oom_reaper manages to unmap all the eligible vmas there shouldn't
      be much of the freable memory held by the oom victim left anymore so it
      makes sense to clear the TIF_MEMDIE flag for the victim and allow the
      OOM killer to select another task.
      The lack of TIF_MEMDIE also means that the victim cannot access memory
      reserves anymore but that shouldn't be a problem because it would get
      the access again if it needs to allocate and hits the OOM killer again
      due to the fatal_signal_pending resp.  PF_EXITING check.  We can safely
      hide the task from the OOM killer because it is clearly not a good
      candidate anymore as everyhing reclaimable has been torn down already.
      This patch will allow to cap the time an OOM victim can keep TIF_MEMDIE
      and thus hold off further global OOM killer actions granted the oom
      reaper is able to take mmap_sem for the associated mm struct.  This is
      not guaranteed now but further steps should make sure that mmap_sem for
      write should be blocked killable which will help to reduce such a lock
      contention.  This is not done by this patch.
      Note that exit_oom_victim might be called on a remote task from
      __oom_reap_task now so we have to check and clear the flag atomically
      otherwise we might race and underflow oom_victims or wake up waiters too
      Signed-off-by: default avatarMichal Hocko <>
      Suggested-by: default avatarJohannes Weiner <>
      Suggested-by: default avatarTetsuo Handa <>
      Cc: Andrea Argangeli <>
      Cc: David Rientjes <>
      Cc: Hugh Dickins <>
      Cc: Mel Gorman <>
      Cc: Oleg Nesterov <>
      Cc: Rik van Riel <>
      Signed-off-by: default avatarAndrew Morton <>
      Signed-off-by: default avatarLinus Torvalds <>
    • Michal Hocko's avatar
      mm, oom: introduce oom reaper · aac45363
      Michal Hocko authored
      This patch (of 5):
      This is based on the idea from Mel Gorman discussed during LSFMM 2015
      and independently brought up by Oleg Nesterov.
      The OOM killer currently allows to kill only a single task in a good
      hope that the task will terminate in a reasonable time and frees up its
      memory.  Such a task (oom victim) will get an access to memory reserves
      via mark_oom_victim to allow a forward progress should there be a need
      for additional memory during exit path.
      It has been shown (e.g.  by Tetsuo Handa) that it is not that hard to
      construct workloads which break the core assumption mentioned above and
      the OOM victim might take unbounded amount of time to exit because it
      might be blocked in the uninterruptible state waiting for an event (e.g.
      lock) which is blocked by another task looping in the page allocator.
      This patch reduces the probability of such a lockup by introducing a
      specialized kernel thread (oom_reaper) which tries to reclaim additional
      memory by preemptively reaping the anonymous or swapped out memory owned
      by the oom victim under an assumption that such a memory won't be needed
      when its owner is killed and kicked from the userspace anyway.  There is
      one notable exception to this, though, if the OOM victim was in the
      process of coredumping the result would be incomplete.  This is
      considered a reasonable constrain because the overall system health is
      more important than debugability of a particular application.
      A kernel thread has been chosen because we need a reliable way of
      invocation so workqueue context is not appropriate because all the
      workers might be busy (e.g.  allocating memory).  Kswapd which sounds
      like another good fit is not appropriate as well because it might get
      blocked on locks during reclaim as well.
      oom_reaper has to take mmap_sem on the target task for reading so the
      solution is not 100% because the semaphore might be held or blocked for
      write but the probability is reduced considerably wrt.  basically any
      lock blocking forward progress as described above.  In order to prevent
      from blocking on the lock without any forward progress we are using only
      a trylock and retry 10 times with a short sleep in between.  Users of
      mmap_sem which need it for write should be carefully reviewed to use
      _killable waiting as much as possible and reduce allocations requests
      done with the lock held to absolute minimum to reduce the risk even
      The API between oom killer and oom reaper is quite trivial.
      wake_oom_reaper updates mm_to_reap with cmpxchg to guarantee only
      NULL->mm transition and oom_reaper clear this atomically once it is done
      with the work.  This means that only a single mm_struct can be reaped at
      the time.  As the operation is potentially disruptive we are trying to
      limit it to the ncessary minimum and the reaper blocks any updates while
      it operates on an mm.  mm_struct is pinned by mm_count to allow parallel
      exit_mmap and a race is detected by atomic_inc_not_zero(mm_users).
      Signed-off-by: default avatarMichal Hocko <>
      Suggested-by: default avatarOleg Nesterov <>
      Suggested-by: default avatarMel Gorman <>
      Acked-by: default avatarMel Gorman <>
      Acked-by: default avatarDavid Rientjes <>
      Cc: Mel Gorman <>
      Cc: Tetsuo Handa <>
      Cc: Oleg Nesterov <>
      Cc: Hugh Dickins <>
      Cc: Andrea Argangeli <>
      Cc: Rik van Riel <>
      Signed-off-by: default avatarAndrew Morton <>
      Signed-off-by: default avatarLinus Torvalds <>
    • Andrew Morton's avatar
      sched: add schedule_timeout_idle() · 69b27baf
      Andrew Morton authored
      This will be needed in the patch "mm, oom: introduce oom reaper".
      Acked-by: default avatarMichal Hocko <>
      Cc: Ingo Molnar <>
      Cc: Peter Zijlstra <>
      Signed-off-by: default avatarAndrew Morton <>
      Signed-off-by: default avatarLinus Torvalds <>
    • Octavian Purdila's avatar
      configfs: fix CONFIGFS_BIN_ATTR_[RW]O definitions · 96c22a32
      Octavian Purdila authored
      The type should be struct configfs_bin_attribute and not struct
      Signed-off-by: default avatarOctavian Purdila <>
      Signed-off-by: default avatarChristoph Hellwig <>
    • Yan, Zheng's avatar
      ceph: fix security xattr deadlock · 315f2408
      Yan, Zheng authored
      When security is enabled, security module can call filesystem's
      getxattr/setxattr callbacks during d_instantiate(). For cephfs,
      d_instantiate() is usually called by MDS' dispatch thread, while
      handling MDS reply. If the MDS reply does not include xattrs and
      corresponding caps, getxattr/setxattr need to send a new request
      to MDS and waits for the reply. This makes MDS' dispatch sleep,
      nobody handles later MDS replies.
      The fix is make sure lookup/atomic_open reply include xattrs and
      corresponding caps. So getxattr can be handled by cached xattrs.
      This requires some modification to both MDS and request message.
      (Client tells MDS what caps it wants; MDS encodes proper caps in
      the reply)
      Smack security module may call setxattr during d_instantiate().
      Unlike getxattr, we can't force MDS to issue CEPH_CAP_XATTR_EXCL
      to us. So just make setxattr return error when called by MDS'
      dispatch thread.
      Signed-off-by: default avatarYan, Zheng <>
    • Yan, Zheng's avatar
      libceph: add helper that duplicates last extent operation · 2c63f49a
      Yan, Zheng authored
      This helper duplicates last extent operation in OSD request, then
      adjusts the new extent operation's offset and length. The helper
      is for scatterd page writeback, which adds nonconsecutive dirty
      pages to single OSD request.
      Signed-off-by: default avatarYan, Zheng <>
      Signed-off-by: default avatarIlya Dryomov <>
    • Ilya Dryomov's avatar
      libceph: enable large, variable-sized OSD requests · 3f1af42a
      Ilya Dryomov authored
      Turn r_ops into a flexible array member to enable large, consisting of
      up to 16 ops, OSD requests.  The use case is scattered writeback in
      cephfs and, as far as the kernel client is concerned, 16 is just a made
      up number.
      r_ops had size 3 for copyup+hint+write, but copyup is really a special
      case - it can only happen once.  ceph_osd_request_cache is therefore
      stuffed with num_ops=2 requests, anything bigger than that is allocated
      with kmalloc().  req_mempool is backed by ceph_osd_request_cache, which
      means either num_ops=1 or num_ops=2 for use_mempool=true - all existing
      users (ceph_writepages_start(), ceph_osdc_writepages()) are fine with
      Signed-off-by: default avatarIlya Dryomov <>
    • Yan, Zheng's avatar
      libceph: move r_reply_op_{len,result} into struct ceph_osd_req_op · 7665d85b
      Yan, Zheng authored
      This avoids defining large array of r_reply_op_{len,result} in
      in struct ceph_osd_request.
      Signed-off-by: default avatarYan, Zheng <>
      Signed-off-by: default avatarIlya Dryomov <>
    • Ilya Dryomov's avatar
      libceph: rename ceph_osd_req_op::payload_len to indata_len · de2aa102
      Ilya Dryomov authored
      Follow userspace nomenclature on this - the next commit adds
      Signed-off-by: default avatarIlya Dryomov <>
    • Ilya Dryomov's avatar
      libceph: monc hunt rate is 3s with backoff up to 30s · 168b9090
      Ilya Dryomov authored
      Unless we are in the process of setting up a client (i.e. connecting to
      the monitor cluster for the first time), apply a backoff: every time we
      want to reopen a session, increase our timeout by a multiple (currently
      2); when we complete the connection, reduce that multipler by 50%.
      Mirrors ceph.git commit 794c86fd289bd62a35ed14368fa096c46736e9a2.
      Signed-off-by: default avatarIlya Dryomov <>
    • Ilya Dryomov's avatar
      libceph: monc ping rate is 10s · 58d81b12
      Ilya Dryomov authored
      Split ping interval and ping timeout: ping interval is 10s; keepalive
      timeout is 30s.
      Make monc_ping_timeout a constant while at it - it's not actually
      exported as a mount option (and the rest of tick-related settings won't
      be either), so it's got no place in ceph_options.
      Signed-off-by: default avatarIlya Dryomov <>
    • Ilya Dryomov's avatar
      libceph: revamp subs code, switch to SUBSCRIBE2 protocol · 82dcabad
      Ilya Dryomov authored
      It is currently hard-coded in the mon_client that mdsmap and monmap
      subs are continuous, while osdmap sub is always "onetime".  To better
      handle full clusters/pools in the osd_client, we need to be able to
      issue continuous osdmap subs.  Revamp subs code to allow us to specify
      for each sub whether it should be continuous or not.
      Although not strictly required for the above, switch to SUBSCRIBE2
      protocol while at it, eliminating the ambiguity between a request for
      "every map since X" and a request for "just the latest" when we don't
      have a map yet (i.e. have epoch 0).  SUBSCRIBE2 feature bit is now
      required - it's been supported since pre-argonaut (2010).
      Move "got mdsmap" call to the end of ceph_mdsc_handle_map() - calling
      in before we validate the epoch and successfully install the new map
      can mess up mon_client sub state.
      Signed-off-by: default avatarIlya Dryomov <>
    • Jaedon Shin's avatar
      net: phy: bcm7xxx: Add entries for Broadcom BCM7346 and BCM7362 · 4cef191d
      Jaedon Shin authored
      Add PHY entries for the Broadcom BCM7346 and BCM7362 chips, these are
      40nm generation Ethernet PHY.
      Fixes: 815717d1 ("net: phy: bcm7xxx: Remove wildcard entries")
      Signed-off-by: default avatarJaedon Shin <>
      Signed-off-by: default avatarDavid S. Miller <>
  10. 23 Mar, 2016 1 commit