1. 20 Jun, 2008 1 commit
    • Linus Torvalds's avatar
      Reinstate ZERO_PAGE optimization in 'get_user_pages()' and fix XIP · 89f5b7da
      Linus Torvalds authored
      KAMEZAWA Hiroyuki and Oleg Nesterov point out that since the commit
      557ed1fa ("remove ZERO_PAGE") removed
      the ZERO_PAGE from the VM mappings, any users of get_user_pages() will
      generally now populate the VM with real empty pages needlessly.
      
      We used to get the ZERO_PAGE when we did the "handle_mm_fault()", but
      since fault handling no longer uses ZERO_PAGE for new anonymous pages,
      we now need to handle that special case in follow_page() instead.
      
      In particular, the removal of ZERO_PAGE effectively removed the core
      file writing optimization where we would skip writing pages that had not
      been populated at all, and increased memory pressure a lot by allocating
      all those useless newly zeroed pages.
      
      This reinstates the optimization by making the unmapped PTE case the
      same as for a non-existent page table, which already did this correctly.
      
      While at it, this also fixes the XIP case for follow_page(), where the
      caller could not differentiate between the case of a page that simply
      could not be used (because it had no "struct page" associated with it)
      and a page that just wasn't mapped.
      
      We do that by simply returning an error pointer for pages that could not
      be turned into a "struct page *".  The error is arbitrarily picked to be
      EFAULT, since that was what get_user_pages() already used for the
      equivalent IO-mapped page case.
      
      [ Also removed an impossible test for pte_offset_map_lock() failing:
        that's not how that function works ]
      Acked-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
      Acked-by: default avatarNick Piggin <npiggin@suse.de>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Hugh Dickins <hugh@veritas.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Roland McGrath <roland@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      89f5b7da
  2. 19 Jun, 2008 7 commits
  3. 18 Jun, 2008 30 commits
  4. 17 Jun, 2008 2 commits
    • Steffen Klassert's avatar
      xfrm: fix fragmentation for ipv4 xfrm tunnel · fe833fca
      Steffen Klassert authored
      When generating the ip header for the transformed packet we just copy
      the frag_off field of the ip header from the original packet to the ip
      header of the new generated packet. If we receive a packet as a chain
      of fragments, all but the last of the new generated packets have the
      IP_MF flag set. We have to mask the frag_off field to only keep the
      IP_DF flag from the original packet. This got lost with git commit
      36cf9acf ("[IPSEC]: Separate
      inner/outer mode processing on output")
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fe833fca
    • Patrick McHardy's avatar
      netfilter: nf_conntrack_h323: fix module unload crash · a56b8f81
      Patrick McHardy authored
      The H.245 helper is not registered/unregistered, but assigned to
      connections manually from the Q.931 helper. This means on unload
      existing expectations and connections using the helper are not
      cleaned up, leading to the following oops on module unload:
      
      CPU 0 Unable to handle kernel paging request at virtual address c00a6828, epc == 802224dc, ra == 801d4e7c
      Oops[#1]:
      Cpu 0
      $ 0   : 00000000 00000000 00000004 c00a67f0
      $ 4   : 802a5ad0 81657e00 00000000 00000000
      $ 8   : 00000008 801461c8 00000000 80570050
      $12   : 819b0280 819b04b0 00000006 00000000
      $16   : 802a5a60 80000000 80b46000 80321010
      $20   : 00000000 00000004 802a5ad0 00000001
      $24   : 00000000 802257a8
      $28   : 802a4000 802a59e8 00000004 801d4e7c
      Hi    : 0000000b
      Lo    : 00506320
      epc   : 802224dc ip_conntrack_help+0x38/0x74     Tainted: P
      ra    : 801d4e7c nf_iterate+0xbc/0x130
      Status: 1000f403    KERNEL EXL IE
      Cause : 00800008
      BadVA : c00a6828
      PrId  : 00019374
      Modules linked in: ip_nat_pptp ip_conntrack_pptp ath_pktlog wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_xauth ath_pci ath_dev ath_dfs ath_rate_atheros wlan ath_hal ip_nat_tftp ip_conntrack_tftp ip_nat_ftp ip_conntrack_ftp pppoe ppp_async ppp_deflate ppp_mppe pppox ppp_generic slhc
      Process swapper (pid: 0, threadinfo=802a4000, task=802a6000)
      Stack : 801e7d98 00000004 802a5a60 80000000 801d4e7c 801d4e7c 802a5ad0 00000004
              00000000 00000000 801e7d98 00000000 00000004 802a5ad0 00000000 00000010
              801e7d98 80b46000 802a5a60 80320000 80000000 801d4f8c 802a5b00 00000002
              80063834 00000000 80b46000 802a5a60 801e7d98 80000000 802ba854 00000000
              81a02180 80b7e260 81a021b0 819b0000 819b0000 80570056 00000000 00000001
              ...
      Call Trace:
       [<801e7d98>] ip_finish_output+0x0/0x23c
       [<801d4e7c>] nf_iterate+0xbc/0x130
       [<801d4e7c>] nf_iterate+0xbc/0x130
       [<801e7d98>] ip_finish_output+0x0/0x23c
       [<801e7d98>] ip_finish_output+0x0/0x23c
       [<801d4f8c>] nf_hook_slow+0x9c/0x1a4
      
      One way to fix this would be to split helper cleanup from the unregistration
      function and invoke it for the H.245 helper, but since ctnetlink needs to be
      able to find the helper for synchonization purposes, a better fix is to
      register it normally and make sure its not assigned to connections during
      helper lookup. The missing l3num initialization is enough for this, this
      patch changes it to use AF_UNSPEC to make it more explicit though.
      Reported-by: default avatarliannan <liannan@twsz.com>
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a56b8f81