1. 28 7月, 2010 26 次提交
  2. 25 7月, 2010 2 次提交
  3. 23 7月, 2010 3 次提交
    • S
      vmlinux.lds: fix .data..init_task output section (fix popwerpc boot) · da5e37ef
      Sam Ravnborg 提交于
      The .data..init_task output section was missing
      a load offset causing a popwerpc target to fail to boot.
      
      Sean MacLennan tracked it down to the definition of
      INIT_TASK_DATA_SECTION().
      
      There are only two users of INIT_TASK_DATA_SECTION()
      in the kernel today: cris and popwerpc.
      cris do not support relocatable kernels and is thus not
      impacted by this change.
      
      Fix INIT_TASK_DATA_SECTION() to specify load offset like
      all other output sections.
      Reported-by: NSean MacLennan <smaclennan@pikatech.com>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      da5e37ef
    • L
      ACPI: skip checking BM_STS if the BIOS doesn't ask for it · 718be4aa
      Len Brown 提交于
      It turns out that there is a bit in the _CST for Intel FFH C3
      that tells the OS if we should be checking BM_STS or not.
      
      Linux has been unconditionally checking BM_STS.
      If the chip-set is configured to enable BM_STS,
      it can retard or completely prevent entry into
      deep C-states -- as illustrated by turbostat:
      
      http://userweb.kernel.org/~lenb/acpi/utils/pmtools/turbostat/
      
      ref: Intel Processor Vendor-Specific ACPI Interface Specification
      table 4 "_CST FFH GAS Field Encoding"
      Bit 1: Set to 1 if OSPM should use Bus Master avoidance for this C-state
      
      https://bugzilla.kernel.org/show_bug.cgi?id=15886Signed-off-by: NLen Brown <len.brown@intel.com>
      718be4aa
    • H
      macvtap: Limit packet queue length · 8a35747a
      Herbert Xu 提交于
      Mark Wagner reported OOM symptoms when sending UDP traffic over
      a macvtap link to a kvm receiver.
      
      This appears to be caused by the fact that macvtap packet queues
      are unlimited in length.  This means that if the receiver can't
      keep up with the rate of flow, then we will hit OOM. Of course
      it gets worse if the OOM killer then decides to kill the receiver.
      
      This patch imposes a cap on the packet queue length, in the same
      way as the tuntap driver, using the device TX queue length.
      
      Please note that macvtap currently has no way of giving congestion
      notification, that means the software device TX queue cannot be
      used and packets will always be dropped once the macvtap driver
      queue fills up.
      
      This shouldn't be a great problem for the scenario where macvtap
      is used to feed a kvm receiver, as the traffic is most likely
      external in origin so congestion notification can't be applied
      anyway.
      
      Of course, if anybody decides to complain about guest-to-guest
      UDP packet loss down the track, then we may have to revisit this.
      
      Incidentally, this patch also fixes a real memory leak when
      macvtap_get_queue fails.
      
      Chris Wright noticed that for this patch to work, we need a
      non-zero TX queue length.  This patch includes his work to change
      the default macvtap TX queue length to 500.
      Reported-by: NMark Wagner <mwagner@redhat.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Acked-by: NChris Wright <chrisw@sous-sol.org>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a35747a
  4. 22 7月, 2010 1 次提交
  5. 21 7月, 2010 4 次提交
    • M
      math-emu: correct test for downshifting fraction in _FP_FROM_INT() · f8324e20
      Mikael Pettersson 提交于
      The kernel's math-emu code contains a macro _FP_FROM_INT() which is
      used to convert an integer to a raw normalized floating-point value.
      It does this basically in three steps:
      
      1. Compute the exponent from the number of leading zero bits.
      2. Downshift large fractions to put the MSB in the right position
         for normalized fractions.
      3. Upshift small fractions to put the MSB in the right position.
      
      There is an boundary error in step 2, causing a fraction with its
      MSB exactly one bit above the normalized MSB position to not be
      downshifted.  This results in a non-normalized raw float, which when
      packed becomes a massively inaccurate representation for that input.
      
      The impact of this depends on a number of arch-specific factors,
      but it is known to have broken emulation of FXTOD instructions
      on UltraSPARC III, which was originally reported as GCC bug 44631
      <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44631>.
      
      Any arch which uses math-emu to emulate conversions from integers to
      same-size floats may be affected.
      
      The fix is simple: the exponent comparison used to determine if the
      fraction should be downshifted must be "<=" not "<".
      
      I'm sending a kernel module to test this as a reply to this message.
      There are also SPARC user-space test cases in the GCC bug entry.
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f8324e20
    • D
      include/linux/vgaarb.h: add missing part of include guard · a6a1a095
      Doug Goldstein 提交于
      vgaarb.h was missing the #define of the #ifndef at the top for the guard
      to prevent multiple #include's from causing re-define errors
      Signed-off-by: NDoug Goldstein <cardoe@gentoo.org>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      a6a1a095
    • P
      vfs: fix RCU-lockdep false positive due to /proc · 844b9a87
      Paul E. McKenney 提交于
      If a single-threaded process does a file-descriptor operation, and some
      other process accesses that same file descriptor via /proc, the current
      rcu_dereference_check_fdtable() can give a false-positive RCU-lockdep
      splat due to the reference count being increased by the /proc access after
      the reference-count check in fget_light() but before the check in
      rcu_dereference_check_fdtable().
      
      This commit prevents this false positive by checking for a single-threaded
      process.  To avoid #include hell, this commit uses the wrapper for
      thread_group_empty(current) defined by rcu_my_thread_group_empty()
      provided in a separate commit.
      Located-by: NMiles Lane <miles.lane@gmail.com>
      Located-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Al Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      844b9a87
    • S
      tracing: Properly align linker defined symbols · 07fca0e5
      Sam Ravnborg 提交于
      We define a number of symbols in the linker scipt like this:
      
          __start_syscalls_metadata = .;
          *(__syscalls_metadata)
      
      But we do not know the alignment of "." when we assign
      the __start_syscalls_metadata symbol.
      gcc started to uses bigger alignment for structs (32 bytes),
      so we saw situations where the linker due to alignment
      constraints increased the value of "." after the symbol assignment.
      
      This resulted in boot fails.
      
      Fix this by forcing a 32 byte alignment of "." before the
      assignment.
      
      This patch introduces the forced alignment for
      ftrace_events and syscalls_metadata.
      It may be required in more places.
      Reported-by: NZeev Tarantov <zeev.tarantov@gmail.com>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      LKML-Reference: <20100710063459.GA14596@merkur.ravnborg.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      07fca0e5
  6. 20 7月, 2010 1 次提交
  7. 19 7月, 2010 1 次提交
    • D
      mm: add context argument to shrinker callback · 7f8275d0
      Dave Chinner 提交于
      The current shrinker implementation requires the registered callback
      to have global state to work from. This makes it difficult to shrink
      caches that are not global (e.g. per-filesystem caches). Pass the shrinker
      structure to the callback so that users can embed the shrinker structure
      in the context the shrinker needs to operate on and get back to it in the
      callback via container_of().
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      7f8275d0
  8. 17 7月, 2010 1 次提交
    • B
      PCI: fall back to original BIOS BAR addresses · 58c84eda
      Bjorn Helgaas 提交于
      If we fail to assign resources to a PCI BAR, this patch makes us try the
      original address from BIOS rather than leaving it disabled.
      
      Linux tries to make sure all PCI device BARs are inside the upstream
      PCI host bridge or P2P bridge apertures, reassigning BARs if necessary.
      Windows does similar reassignment.
      
      Before this patch, if we could not move a BAR into an aperture, we left
      the resource unassigned, i.e., at address zero.  Windows leaves such BARs
      at the original BIOS addresses, and this patch makes Linux do the same.
      
      This is a bit ugly because we disable the resource long before we try to
      reassign it, so we have to keep track of the BIOS BAR address somewhere.
      For lack of a better place, I put it in the struct pci_dev.
      
      I think it would be cleaner to attempt the assignment immediately when the
      claim fails, so we could easily remember the original address.  But we
      currently claim motherboard resources in the middle, after attempting to
      claim PCI resources and before assigning new PCI resources, and changing
      that is a fairly big job.
      
      Addresses https://bugzilla.kernel.org/show_bug.cgi?id=16263Reported-by: NAndrew <nitr0@seti.kr.ua>
      Tested-by: NAndrew <nitr0@seti.kr.ua>
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      58c84eda
  9. 16 7月, 2010 1 次提交
    • J
      jbd2/ocfs2: Fix block checksumming when a buffer is used in several transactions · 13ceef09
      Jan Kara 提交于
      OCFS2 uses t_commit trigger to compute and store checksum of the just
      committed blocks. When a buffer has b_frozen_data, checksum is computed
      for it instead of b_data but this can result in an old checksum being
      written to the filesystem in the following scenario:
      
      1) transaction1 is opened
      2) handle1 is opened
      3) journal_access(handle1, bh)
          - This sets jh->b_transaction to transaction1
      4) modify(bh)
      5) journal_dirty(handle1, bh)
      6) handle1 is closed
      7) start committing transaction1, opening transaction2
      8) handle2 is opened
      9) journal_access(handle2, bh)
          - This copies off b_frozen_data to make it safe for transaction1 to commit.
            jh->b_next_transaction is set to transaction2.
      10) jbd2_journal_write_metadata() checksums b_frozen_data
      11) the journal correctly writes b_frozen_data to the disk journal
      12) handle2 is closed
          - There was no dirty call for the bh on handle2, so it is never queued for
            any more journal operation
      13) Checkpointing finally happens, and it just spools the bh via normal buffer
      writeback.  This will write b_data, which was never triggered on and thus
      contains a wrong (old) checksum.
      
      This patch fixes the problem by calling the trigger at the moment data is
      frozen for journal commit - i.e., either when b_frozen_data is created by
      do_get_write_access or just before we write a buffer to the log if
      b_frozen_data does not exist. We also rename the trigger to t_frozen as
      that better describes when it is called.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      13ceef09