1. 21 1月, 2010 1 次提交
  2. 17 1月, 2010 1 次提交
  3. 28 12月, 2009 1 次提交
  4. 24 12月, 2009 1 次提交
    • A
      SYSCTL: Print binary sysctl warnings (nearly) only once · 4440095c
      Andi Kleen 提交于
      When printing legacy sysctls print the warning message
      for each of them only once.  This way there is a guarantee
      the syslog won't be flooded for any sane program.
      
      The original attempt at this made the tables non const and stored
      the flag inline.
      
      Linus suggested using a separate hash table for this, this is based on a
      code snippet from him.
      
      The hash implies this is not exact and can sometimes not print a
      new sysctl due to a hash collision, but in practice this should not
      be a problem
      
      I used a FNV32 hash over the binary string with a 32byte bitmap. This
      gives relatively little collisions when all the predefined binary sysctls
      are hashed:
      
      size 256
      bucket
      length      number
      0:          [25]
      1:          [67]
      2:          [88]
      3:          [47]
      4:          [22]
      5:          [6]
      6:          [1]
      
      The worst case is a single collision of 6 hash values.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      4440095c
  5. 23 12月, 2009 10 次提交
  6. 22 12月, 2009 1 次提交
  7. 21 12月, 2009 2 次提交
  8. 20 12月, 2009 2 次提交
    • A
      fix more leaks in audit_tree.c tag_chunk() · b4c30aad
      Al Viro 提交于
      Several leaks in audit_tree didn't get caught by commit
      318b6d3d, including the leak on normal
      exit in case of multiple rules refering to the same chunk.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b4c30aad
    • A
      fix braindamage in audit_tree.c untag_chunk() · 6f5d5114
      Al Viro 提交于
      ... aka "Al had badly fscked up when writing that thing and nobody
      noticed until Eric had fixed leaks that used to mask the breakage".
      
      The function essentially creates a copy of old array sans one element
      and replaces the references to elements of original (they are on cyclic
      lists) with those to corresponding elements of new one.  After that the
      old one is fair game for freeing.
      
      First of all, there's a dumb braino: when we get to list_replace_init we
      use indices for wrong arrays - position in new one with the old array
      and vice versa.
      
      Another bug is more subtle - termination condition is wrong if the
      element to be excluded happens to be the last one.  We shouldn't go
      until we fill the new array, we should go until we'd finished the old
      one.  Otherwise the element we are trying to kill will remain on the
      cyclic lists...
      
      That crap used to be masked by several leaks, so it was not quite
      trivial to hit.  Eric had fixed some of those leaks a while ago and the
      shit had hit the fan...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6f5d5114
  9. 18 12月, 2009 3 次提交
  10. 17 12月, 2009 18 次提交
    • P
      sched: Fix broken assertion · 077614ee
      Peter Zijlstra 提交于
      There's a preemption race in the set_task_cpu() debug check in
      that when we get preempted after setting task->state we'd still
      be on the rq proper, but fail the test.
      
      Check for preempted tasks, since those are always on the RQ.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20091217121830.137155561@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      077614ee
    • P
      perf events: Dont report side-band events on each cpu for per-task-per-cpu events · 5d27c23d
      Peter Zijlstra 提交于
      Acme noticed that his FORK/MMAP numbers were inflated by about
      the same factor as his cpu-count.
      
      This led to the discovery of a few more sites that need to
      respect the event->cpu filter.
      Reported-by: NArnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <20091217121830.215333434@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5d27c23d
    • F
      perf events, x86/stacktrace: Make stack walking optional · 61c1917f
      Frederic Weisbecker 提交于
      The current print_context_stack helper that does the stack
      walking job is good for usual stacktraces as it walks through
      all the stack and reports even addresses that look unreliable,
      which is nice when we don't have frame pointers for example.
      
      But we have users like perf that only require reliable
      stacktraces, and those may want a more adapted stack walker, so
      lets make this function a callback in stacktrace_ops that users
      can tune for their needs.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1261024834-5336-1-git-send-regression-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      61c1917f
    • F
      sched: Teach might_sleep() about preemptible RCU · 234da7bc
      Frederic Weisbecker 提交于
      In practice, it is harmless to voluntarily sleep in a
      rcu_read_lock() section if we are running under preempt rcu, but
      it is illegal if we build a kernel running non-preemptable rcu.
      
      Currently, might_sleep() doesn't notice sleepable operations
      under rcu_read_lock() sections if we are running under
      preemptable rcu because preempt_count() is left untouched after
      rcu_read_lock() in this case. But we want developers who test
      their changes under such config to notice the "sleeping while
      atomic" issues.
      
      So we add rcu_read_lock_nesting to prempt_count() in
      might_sleep() checks.
      
      [ v2: Handle rcu-tiny ]
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Reviewed-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <1260991265-8451-1-git-send-regression-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      234da7bc
    • M
      kprobe-tracer: Check new event/group name · 6f3cf440
      Masami Hiramatsu 提交于
      Check new event/group name is same syntax as a C symbol. In other
      words, checking the name is as like as other tracepoint events.
      
      This can prevent user to create an event with useless name (e.g.
      foo|bar, foo*bar).
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      LKML-Reference: <20091216222408.14459.68790.stgit@dhcp-100-2-132.bos.redhat.com>
      [ v2: minor cleanups ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6f3cf440
    • I
      sched: Make warning less noisy · 416eb395
      Ingo Molnar 提交于
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <20091216170517.807938893@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      416eb395
    • R
      cpumask: avoid dereferencing struct cpumask · 62ac1279
      Rusty Russell 提交于
      struct cpumask will be undefined soon with CONFIG_CPUMASK_OFFSTACK=y,
      to avoid them being declared on the stack.
      
      cpumask_bits() does what we want here (of course, this code is crap).
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      To: Thomas Gleixner <tglx@linutronix.de>
      62ac1279
    • R
      cpumask: use cpu_online in kernel/perf_event.c · f6325e30
      Rusty Russell 提交于
      Also, we want to check against nr_cpu_ids, not num_possible_cpus().
      The latter works, but the correct bounds check is < nr_cpu_ids.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      To: Thomas Gleixner <tglx@linutronix.de>
      f6325e30
    • S
      timers: Remove duplicate setting of new_base in __mod_timer() · cf1e367e
      Simon Horman 提交于
      new_base is set using per_cpu(tvec_bases, cpu) after selecting the
      desired value of cpu immediately below so this line is a unnecessary.
      Signed-off-by: NSimon Horman <horms@verge.net.au>
      LKML-Reference: <20091217001542.GD25317@verge.net.au>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      cf1e367e
    • D
      NOMMU: Optimise away the {dac_,}mmap_min_addr tests · 6e141546
      David Howells 提交于
      In NOMMU mode clamp dac_mmap_min_addr to zero to cause the tests on it to be
      skipped by the compiler.  We do this as the minimum mmap address doesn't make
      any sense in NOMMU mode.
      
      mmap_min_addr and round_hint_to_min() can be discarded entirely in NOMMU mode.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      6e141546
    • A
      [sysctl] Fix breakage on systems with older glibc · 61cf6931
      Andi Kleen 提交于
      As predicted during code review, the sysctl(2) changes made systems with
      old glibc nearly unusable.  About every command gives a:
      
        warning: process `ls' used the deprecated sysctl system call with 1.4
      
      warning in the log.
      
      I see this on a SUSE 10.0 system with glibc 2.3.5.
      
      Don't warn for this common case.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      61cf6931
    • P
      sched: Simplify set_task_cpu() · 738d2be4
      Peter Zijlstra 提交于
      Rearrange code a bit now that its a simpler function.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <20091216170518.269101883@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      738d2be4
    • P
      sched: Remove the cfs_rq dependency from set_task_cpu() · 88ec22d3
      Peter Zijlstra 提交于
      In order to remove the cfs_rq dependency from set_task_cpu() we
      need to ensure the task is cfs_rq invariant for all callsites.
      
      The simple approach is to substract cfs_rq->min_vruntime from
      se->vruntime on dequeue, and add cfs_rq->min_vruntime on
      enqueue.
      
      However, this has the downside of breaking FAIR_SLEEPERS since
      we loose the old vruntime as we only maintain the relative
      position.
      
      To solve this, we observe that we only migrate runnable tasks,
      we do this using deactivate_task(.sleep=0) and
      activate_task(.wakeup=0), therefore we can restrain the
      min_vruntime invariance to that state.
      
      The only other case is wakeup balancing, since we want to
      maintain the old vruntime we cannot make it relative on dequeue,
      but since we don't migrate inactive tasks, we can do so right
      before we activate it again.
      
      This is where we need the new pre-wakeup hook, we need to call
      this while still holding the old rq->lock. We could fold it into
      ->select_task_rq(), but since that has multiple callsites and
      would obfuscate the locking requirements, that seems like a
      fudge.
      
      This leaves the fork() case, simply make sure that ->task_fork()
      leaves the ->vruntime in a relative state.
      
      This covers all cases where set_task_cpu() gets called, and
      ensures it sees a relative vruntime.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <20091216170518.191697025@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      88ec22d3
    • P
      sched: Add pre and post wakeup hooks · efbbd05a
      Peter Zijlstra 提交于
      As will be apparent in the next patch, we need a pre wakeup hook
      for sched_fair task migration, hence rename the post wakeup hook
      and one pre wakeup.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <20091216170518.114746117@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      efbbd05a
    • P
      sched: Move kthread_bind() back to kthread.c · 881232b7
      Peter Zijlstra 提交于
      Since kthread_bind() lost its dependencies on sched.c, move it
      back where it came from.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <20091216170518.039524041@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      881232b7
    • P
      sched: Fix select_task_rq() vs hotplug issues · 5da9a0fb
      Peter Zijlstra 提交于
      Since select_task_rq() is now responsible for guaranteeing
      ->cpus_allowed and cpu_active_mask, we need to verify this.
      
      select_task_rq_rt() can blindly return
      smp_processor_id()/task_cpu() without checking the valid masks,
      select_task_rq_fair() can do the same in the rare case that all
      SD_flags are disabled.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <20091216170517.961475466@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5da9a0fb
    • P
      sched: Fix sched_exec() balancing · 38022906
      Peter Zijlstra 提交于
      Since we access ->cpus_allowed without holding rq->lock we need
      a retry loop to validate the result, this comes for near free
      when we merge sched_migrate_task() into sched_exec() since that
      already does the needed check.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <20091216170517.884743662@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      38022906
    • P
      sched: Ensure set_task_cpu() is never called on blocked tasks · e2912009
      Peter Zijlstra 提交于
      In order to clean up the set_task_cpu() rq dependencies we need
      to ensure it is never called on blocked tasks because such usage
      does not pair with consistent rq->lock usage.
      
      This puts the migration burden on ttwu().
      
      Furthermore we need to close a race against changing
      ->cpus_allowed, since select_task_rq() runs with only preemption
      disabled.
      
      For sched_fork() this is safe because the child isn't in the
      tasklist yet, for wakeup we fix this by synchronizing
      set_cpus_allowed_ptr() against TASK_WAKING, which leaves
      sched_exec to be a problem
      
      This also closes a hole in (6ad4c188 sched: Fix balance vs
      hotplug race) where ->select_task_rq() doesn't validate the
      result against the sched_domain/root_domain.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <20091216170517.807938893@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e2912009