1. 09 2月, 2011 1 次提交
  2. 05 2月, 2011 1 次提交
  3. 04 2月, 2011 2 次提交
  4. 03 2月, 2011 6 次提交
    • S
      tracing: Replace syscall_meta_data struct array with pointer array · 3d56e331
      Steven Rostedt 提交于
      Currently the syscall_meta structures for the syscall tracepoints are
      placed in the __syscall_metadata section, and at link time, the linker
      makes one large array of all these syscall metadata structures. On boot
      up, this array is read (much like the initcall sections) and the syscall
      data is processed.
      
      The problem is that there is no guarantee that gcc will place complex
      structures nicely together in an array format. Two structures in the
      same file may be placed awkwardly, because gcc has no clue that they
      are suppose to be in an array.
      
      A hack was used previous to force the alignment to 4, to pack the
      structures together. But this caused alignment issues with other
      architectures (sparc).
      
      Instead of packing the structures into an array, the structures' addresses
      are now put into the __syscall_metadata section. As pointers are always the
      natural alignment, gcc should always pack them tightly together
      (otherwise initcall, extable, etc would also fail).
      
      By having the pointers to the structures in the section, we can still
      iterate the trace_events without causing unnecessary alignment problems
      with other architectures, or depending on the current behaviour of
      gcc that will likely change in the future just to tick us kernel developers
      off a little more.
      
      The __syscall_metadata section is also moved into the .init.data section
      as it is now only needed at boot up.
      Suggested-by: NDavid Miller <davem@davemloft.net>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      3d56e331
    • M
      tracepoints: Fix section alignment using pointer array · 65498646
      Mathieu Desnoyers 提交于
      Make the tracepoints more robust, making them solid enough to handle compiler
      changes by not relying on anything based on compiler-specific behavior with
      respect to structure alignment. Implement an approach proposed by David Miller:
      use an array of const pointers to refer to the individual structures, and export
      this pointer array through the linker script rather than the structures per se.
      It will consume 32 extra bytes per tracepoint (24 for structure padding and 8
      for the pointers), but are less likely to break due to compiler changes.
      
      History:
      
      commit 7e066fb8 tracepoints: add DECLARE_TRACE() and DEFINE_TRACE()
      added the aligned(32) type and variable attribute to the tracepoint structures
      to deal with gcc happily aligning statically defined structures on 32-byte
      multiples.
      
      One attempt was to use a 8-byte alignment for tracepoint structures by applying
      both the variable and type attribute to tracepoint structures definitions and
      declarations. It worked fine with gcc 4.5.1, but broke with gcc 4.4.4 and 4.4.5.
      
      The reason is that the "aligned" attribute only specify the _minimum_ alignment
      for a structure, leaving both the compiler and the linker free to align on
      larger multiples. Because tracepoint.c expects the structures to be placed as an
      array within each section, up-alignment cause NULL-pointer exceptions due to the
      extra unexpected padding.
      
      (this patch applies on top of -tip)
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      LKML-Reference: <20110126222622.GA10794@Krystal>
      CC: Frederic Weisbecker <fweisbec@gmail.com>
      CC: Ingo Molnar <mingo@elte.hu>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Andrew Morton <akpm@linux-foundation.org>
      CC: Peter Zijlstra <peterz@infradead.org>
      CC: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      65498646
    • S
      tracing: Replace trace_event struct array with pointer array · e4a9ea5e
      Steven Rostedt 提交于
      Currently the trace_event structures are placed in the _ftrace_events
      section, and at link time, the linker makes one large array of all
      the trace_event structures. On boot up, this array is read (much like
      the initcall sections) and the events are processed.
      
      The problem is that there is no guarantee that gcc will place complex
      structures nicely together in an array format. Two structures in the
      same file may be placed awkwardly, because gcc has no clue that they
      are suppose to be in an array.
      
      A hack was used previous to force the alignment to 4, to pack the
      structures together. But this caused alignment issues with other
      architectures (sparc).
      
      Instead of packing the structures into an array, the structures' addresses
      are now put into the _ftrace_event section. As pointers are always the
      natural alignment, gcc should always pack them tightly together
      (otherwise initcall, extable, etc would also fail).
      
      By having the pointers to the structures in the section, we can still
      iterate the trace_events without causing unnecessary alignment problems
      with other architectures, or depending on the current behaviour of
      gcc that will likely change in the future just to tick us kernel developers
      off a little more.
      
      The _ftrace_event section is also moved into the .init.data section
      as it is now only needed at boot up.
      Suggested-by: NDavid Miller <davem@davemloft.net>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      e4a9ea5e
    • N
      vfs: sparse: add __FMODE_EXEC · 3cd90ea4
      Namhyung Kim 提交于
      FMODE_EXEC is a constant type of fmode_t but was used with normal integer
      constants.  This results in following warnings from sparse.  Fix it using
      new macro __FMODE_EXEC.
      
       fs/exec.c:116:58: warning: restricted fmode_t degrades to integer
       fs/exec.c:689:58: warning: restricted fmode_t degrades to integer
       fs/fcntl.c:777:9: warning: restricted fmode_t degrades to integer
      Signed-off-by: NNamhyung Kim <namhyung@gmail.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>
      3cd90ea4
    • N
      vfs: sparse: remove a warning on OPEN_FMODE() · 1a44bc8c
      Namhyung Kim 提交于
      AND-ing FMODE_* constant with normal integer results in following
      sparse warnings. Fix it.
      
       fs/open.c:662:21: warning: restricted fmode_t degrades to integer
       fs/anon_inodes.c:123:34: warning: restricted fmode_t degrades to integer
      Signed-off-by: NNamhyung Kim <namhyung@gmail.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>
      1a44bc8c
    • J
      memcg: prevent endless loop when charging huge pages to near-limit group · 19942822
      Johannes Weiner 提交于
      If reclaim after a failed charging was unsuccessful, the limits are
      checked again, just in case they settled by means of other tasks.
      
      This is all fine as long as every charge is of size PAGE_SIZE, because in
      that case, being below the limit means having at least PAGE_SIZE bytes
      available.
      
      But with transparent huge pages, we may end up in an endless loop where
      charging and reclaim fail, but we keep going because the limits are not
      yet exceeded, although not allowing for a huge page.
      
      Fix this up by explicitely checking for enough room, not just whether we
      are within limits.
      Signed-off-by: NJohannes Weiner <hannes@cmpxchg.org>
      Acked-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Reviewed-by: NMinchan Kim <minchan.kim@gmail.com>
      Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
      Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      19942822
  5. 02 2月, 2011 1 次提交
  6. 01 2月, 2011 2 次提交
    • P
      netfilter: ecache: always set events bits, filter them later · 3db7e93d
      Pablo Neira Ayuso 提交于
      For the following rule:
      
      iptables -I PREROUTING -t raw -j CT --ctevents assured
      
      The event delivered looks like the following:
      
       [UPDATE] tcp      6 src=192.168.0.2 dst=192.168.1.2 sport=37041 dport=80 src=192.168.1.2 dst=192.168.1.100 sport=80 dport=37041 [ASSURED]
      
      Note that the TCP protocol state is not included. For that reason
      the CT event filtering is not very useful for conntrackd.
      
      To resolve this issue, instead of conditionally setting the CT events
      bits based on the ctmask, we always set them and perform the filtering
      in the late stage, just before the delivery.
      
      Thus, the event delivered looks like the following:
      
       [UPDATE] tcp      6 432000 ESTABLISHED src=192.168.0.2 dst=192.168.1.2 sport=37041 dport=80 src=192.168.1.2 dst=192.168.1.100 sport=80 dport=37041 [ASSURED]
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      3db7e93d
    • R
      kernel.h: fix kernel-doc warning · ffbbf2da
      Randy Dunlap 提交于
      Fix kernel-doc warning in kernel.h from commit 7ef88ad5
      ("BUILD_BUG_ON: make it handle more cases"):
      
        Warning(include/linux/kernel.h:605): No description found for parameter 'condition'
        Warning(include/linux/kernel.h:605): Excess function parameter 'cond' description in 'BUILD_BUG_ON'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ffbbf2da
  7. 31 1月, 2011 1 次提交
    • C
      drm/i915: Suppress spurious vblank interrupts · 78c6e170
      Chris Wilson 提交于
      Hugh Dickins found that characters in xterm were going missing and oft
      delayed. Being the curious type, he managed to associate this with the
      new high-precision vblank patches; disabling these he found, restored
      the orderliness of his characters.
      
      The oddness begins when one realised that Hugh was not using vblanks at
      all on his system (fvwm and some xterms). Instead, all he had to go on
      were warning of a pipe underrun, curiously enough at around 60Hz. He
      poked and found that in addition to the underrun warning, the hardware
      was flagging the start of a new frame, a vblank, which in turn was
      kicking off the pending vblank processing code.
      
      There is little we can do for the underruns on Hugh's machine, a
      Crestline [965GM], which must have its FIFO watermarks set to 8.
      However, we do not need to process the vblank if we know that they are
      disabled...
      Reported-by: NHugh Dickins <hughd@google.com>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      78c6e170
  8. 30 1月, 2011 2 次提交
  9. 26 1月, 2011 5 次提交
  10. 25 1月, 2011 3 次提交
  11. 24 1月, 2011 5 次提交
    • R
      Remove MAYBE_BUILD_BUG_ON · 1765e3a4
      Rusty Russell 提交于
      Now BUILD_BUG_ON() can handle optimizable constants, we don't need
      MAYBE_BUILD_BUG_ON any more.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      1765e3a4
    • R
      BUILD_BUG_ON: make it handle more cases · 7ef88ad5
      Rusty Russell 提交于
      BUILD_BUG_ON used to use the optimizer to do code elimination or fail
      at link time; it was changed to first the size of a negative array (a
      nicer compile time error), then (in
      8c87df45) to a bitfield.
      
      This forced us to change some non-constant cases to MAYBE_BUILD_BUG_ON();
      as Jan points out in that commit, it didn't work as intended anyway.
      
      bitfields: needs a literal constant at parse time, and can't be put under
      	"if (__builtin_constant_p(x))" for example.
      negative array: can handle anything, but if the compiler can't tell it's
      	a constant, silently has no effect.
      link time: breaks link if the compiler can't determine the value, but the
      	linker output is not usually as informative as a compiler error.
      
      If we use the negative-array-size method *and* the link time trick,
      we get the ability to use BUILD_BUG_ON() under __builtin_constant_p()
      branches, and maximal ability for the compiler to detect errors at
      build time.
      
      We also document it thoroughly.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Jan Beulich <JBeulich@novell.com>
      Acked-by: NHollis Blanchard <hollisb@us.ibm.com>
      7ef88ad5
    • L
      param: add null statement to compiled-in module params · b75be420
      Linus Walleij 提交于
      Add an unused struct declaration statement requiring a
      terminating semicolon to the compile-in case to provoke an
      error if __MODULE_INFO() is used without the terminating
      semicolon. Previously MODULE_ALIAS("foo") (no semicolon)
      compiled fine if MODULE was not selected.
      
      Cc: Dan Carpenter <error27@gmail.com>
      Signed-off-by: NLinus Walleij <linus.walleij@stericsson.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      b75be420
    • R
      module: fix linker error for MODULE_VERSION when !MODULE and CONFIG_SYSFS=n · 3b90a5b2
      Rusty Russell 提交于
      lib/built-in.o:(__modver+0x8): undefined reference to `__modver_version_show'
      lib/built-in.o:(__modver+0x2c): undefined reference to `__modver_version_show'
      
      Simplest to just not emit anything: if they've disabled SYSFS they probably
      want the smallest kernel possible.
      Reported-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      3b90a5b2
    • D
      module: show version information for built-in modules in sysfs · e94965ed
      Dmitry Torokhov 提交于
      Currently only drivers that are built as modules have their versions
      shown in /sys/module/<module_name>/version, but this information might
      also be useful for built-in drivers as well. This especially important
      for drivers that do not define any parameters - such drivers, if
      built-in, are completely invisible from userspace.
      
      This patch changes MODULE_VERSION() macro so that in case when we are
      compiling built-in module, version information is stored in a separate
      section. Kernel then uses this data to create 'version' sysfs attribute
      in the same fashion it creates attributes for module parameters.
      Signed-off-by: NDmitry Torokhov <dtor@vmware.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      e94965ed
  12. 23 1月, 2011 1 次提交
    • L
      USB: serial: handle Data Carrier Detect changes · d14fc1a7
      Libor Pechacek 提交于
      Alan's commit 335f8514 introduced
      .carrier_raised function in several drivers.  That also means
      tty_port_block_til_ready can now suspend the process trying to open the serial
      port when Carrier Detect is low and put it into tty_port.open_wait queue.  We
      need to wake up the process when Carrier Detect goes high and trigger TTY
      hangup when CD goes low.
      
      Some of the devices do not report modem status line changes, or at least we
      don't understand the status message, so for those we remove .carrier_raised
      again.
      Signed-off-by: NLibor Pechacek <lpechacek@suse.cz>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d14fc1a7
  13. 22 1月, 2011 3 次提交
  14. 21 1月, 2011 4 次提交
  15. 20 1月, 2011 3 次提交