1. 18 7月, 2015 7 次提交
    • P
      rcu: Get rid of synchronize_sched_expedited()'s polling loop · 385b73c0
      Paul E. McKenney 提交于
      This commit gets rid of synchronize_sched_expedited()'s mutex_trylock()
      polling loop in favor of a funnel-locking scheme based on the rcu_node
      tree.  The work-done check is done at each level of the tree, allowing
      high-contention situations to be resolved quickly with reasonable levels
      of mutex contention.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      385b73c0
    • P
      rcu: Rework synchronize_sched_expedited() counter handling · d6ada2cf
      Paul E. McKenney 提交于
      Now that synchronize_sched_expedited() have a mutex, it can use simpler
      work-already-done detection scheme.  This commit simplifies this scheme
      by using something similar to the sequence-locking counter scheme.
      A counter is incremented before and after each grace period, so that
      the counter is odd in the midst of the grace period and even otherwise.
      So if the counter has advanced to the second even number that is
      greater than or equal to the snapshot, the required grace period has
      already happened.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      d6ada2cf
    • P
      rcu: Switch synchronize_sched_expedited() to stop_one_cpu() · c190c3b1
      Peter Zijlstra 提交于
      The synchronize_sched_expedited() currently invokes try_stop_cpus(),
      which schedules the stopper kthreads on each online non-idle CPU,
      and waits until all those kthreads are running before letting any
      of them stop.  This is disastrous for real-time workloads, which
      get hit with a preemption that is as long as the longest scheduling
      latency on any CPU, including any non-realtime housekeeping CPUs.
      This commit therefore switches to using stop_one_cpu() on each CPU
      in turn.  This avoids inflicting the worst-case scheduling latency
      on the worst-case CPU onto all other CPUs, and also simplifies the
      code a little bit.
      
      Follow-up commits will simplify the counter-snapshotting algorithm
      and convert a number of the counters that are now protected by the
      new ->expedited_mutex to non-atomic.
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      [ paulmck: Kept stop_one_cpu(), dropped disabling of "guardrails". ]
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      c190c3b1
    • P
      rcu: Remove CONFIG_RCU_CPU_STALL_INFO · 75c27f11
      Paul E. McKenney 提交于
      The CONFIG_RCU_CPU_STALL_INFO has been default-y for a couple of
      releases with no complaints, so it is time to eliminate this Kconfig
      option entirely, so that the long-form RCU CPU stall warnings cannot
      be disabled.  This commit does just that.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      75c27f11
    • P
      rcu: Stop disabling CPU hotplug in synchronize_rcu_expedited() · 9b683874
      Paul E. McKenney 提交于
      The fact that tasks could be migrated from leaf to root rcu_node
      structures meant that synchronize_rcu_expedited() had to disable
      CPU hotplug.  However, tasks now stay put, so this commit removes the
      CPU-hotplug disabling from synchronize_rcu_expedited().
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      9b683874
    • P
      rcu: Reset rcu_fanout_leaf if out of bounds · 13bd6494
      Paul E. McKenney 提交于
      Currently if the rcu_fanout_leaf boot parameter is out of bounds (that
      is, less than RCU_FANOUT_LEAF or greater than the number of bits in an
      unsigned long), a warning is issued and execution continues with the
      out-of-bounds value.  This can result in all manner of failures, so this
      patch resets rcu_fanout_leaf to RCU_FANOUT_LEAF when an out-of-bounds
      condition is detected.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      13bd6494
    • A
      rcu: Shut up bogus gcc array bounds warning · 032dfc87
      Alexander Gordeev 提交于
      Because gcc does not realize a loop would not be entered ever
      (i.e. in case of rcu_num_lvls == 1):
      
        for (i = 1; i < rcu_num_lvls; i++)
      	  rsp->level[i] = rsp->level[i - 1] + levelcnt[i - 1];
      
      some compiler (pre- 5.x?) versions give a bogus warning:
      
        kernel/rcu/tree.c: In function ‘rcu_init_one.isra.55’:
        kernel/rcu/tree.c:4108:13: warning: array subscript is above array bounds [-Warray-bounds]
           rsp->level[i] = rsp->level[i - 1] + rsp->levelcnt[i - 1];
                     ^
      Fix that warning by adding an extra item to rcu_state::level[]
      array. Once the bogus warning is fixed in gcc and kernel drops
      support of older versions, the dummy item may be removed from
      the array.
      
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Suggested-by: N"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NAlexander Gordeev <agordeev@redhat.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      032dfc87
  2. 16 7月, 2015 10 次提交
  3. 04 7月, 2015 5 次提交
  4. 03 7月, 2015 1 次提交
  5. 01 7月, 2015 8 次提交
  6. 28 6月, 2015 2 次提交
  7. 27 6月, 2015 1 次提交
    • T
      timer: Fix hotplug regression · 24bfcb10
      Thomas Gleixner 提交于
      The recent timer wheel rework removed the get/put_cpu_var() pair in
      the hotplug migration code, which results in:
      
      BUG: using smp_processor_id() in preemptible [00000000] code: hib.sh/2845
      ...
      [<ffffffff810d4fa3>] timer_cpu_notify+0x53/0x12
      
      That hunk is a leftover from an earlier iteration and went unnoticed
      so far.
      
      Restore the previous code which was obviously correct.
      
      Fixes: 0eeda71b 'timer: Replace timer base by a cpu index'
      Reported-and_tested-by: Borislav Petkov <bp@alien8.de>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      24bfcb10
  8. 26 6月, 2015 6 次提交
    • R
      exit,stats: /* obey this comment */ · 51229b49
      Rik van Riel 提交于
      There is a helpful comment in do_exit() that states we sync the mm's RSS
      info before statistics gathering.
      
      The function that does the statistics gathering is called right above that
      comment.
      
      Change the code to obey the comment.
      Signed-off-by: NRik van Riel <riel@redhat.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Michal Hocko <mhocko@suse.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      51229b49
    • R
      kernel/trace/blktrace.c: use strreplace() in do_blk_trace_setup() · ff14417c
      Rasmus Villemoes 提交于
      Part of the disassembly of do_blk_trace_setup:
      
          231b:       e8 00 00 00 00          callq  2320 <do_blk_trace_setup+0x50>
                              231c: R_X86_64_PC32     strlen+0xfffffffffffffffc
          2320:       eb 0a                   jmp    232c <do_blk_trace_setup+0x5c>
          2322:       66 0f 1f 44 00 00       nopw   0x0(%rax,%rax,1)
          2328:       48 83 c3 01             add    $0x1,%rbx
          232c:       48 39 d8                cmp    %rbx,%rax
          232f:       76 47                   jbe    2378 <do_blk_trace_setup+0xa8>
          2331:       41 80 3c 1c 2f          cmpb   $0x2f,(%r12,%rbx,1)
          2336:       75 f0                   jne    2328 <do_blk_trace_setup+0x58>
          2338:       41 c6 04 1c 5f          movb   $0x5f,(%r12,%rbx,1)
          233d:       4c 89 e7                mov    %r12,%rdi
          2340:       e8 00 00 00 00          callq  2345 <do_blk_trace_setup+0x75>
                              2341: R_X86_64_PC32     strlen+0xfffffffffffffffc
          2345:       eb e1                   jmp    2328 <do_blk_trace_setup+0x58>
      
      Yep, that's right: gcc isn't smart enough to realize that replacing '/' by
      '_' cannot change the strlen(), so we call it again and again (at least
      when a '/' is found).  Even if gcc were that smart, this construction
      would still loop over the string twice, once for the initial strlen() call
      and then the open-coded loop.
      
      Let's simply use strreplace() instead.
      Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Liked-by: NJens Axboe <axboe@fb.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ff14417c
    • R
      kernel/trace/trace_events_filter.c: use strreplace() · 1bb56471
      Rasmus Villemoes 提交于
      There's no point in starting over every time we see a ','...
      Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1bb56471
    • V
      check_syslog_permissions() cleanup · 3ea4331c
      Vasily Averin 提交于
      Patch fixes drawbacks in heck_syslog_permissions() noticed by AKPM:
      "from_file handling makes me cry.
      
      That's not a boolean - it's an enumerated value with two values
      currently defined.
      
      But the code in check_syslog_permissions() treats it as a boolean and
      also hardwires the knowledge that SYSLOG_FROM_PROC == 1 (or == `true`).
      
      And the name is wrong: it should be called from_proc to match
      SYSLOG_FROM_PROC."
      Signed-off-by: NVasily Averin <vvs@virtuozzo.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Josh Boyer <jwboyer@redhat.com>
      Cc: Eric Paris <eparis@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3ea4331c
    • V
      security_syslog() should be called once only · d194e5d6
      Vasily Averin 提交于
      The final version of commit 637241a9 ("kmsg: honor dmesg_restrict
      sysctl on /dev/kmsg") lost few hooks, as result security_syslog() are
      processed incorrectly:
      
      - open of /dev/kmsg checks syslog access permissions by using
        check_syslog_permissions() where security_syslog() is not called if
        dmesg_restrict is set.
      
      - syslog syscall and /proc/kmsg calls do_syslog() where security_syslog
        can be executed twice (inside check_syslog_permissions() and then
        directly in do_syslog())
      
      With this patch security_syslog() is called once only in all
      syslog-related operations regardless of dmesg_restrict value.
      
      Fixes: 637241a9 ("kmsg: honor dmesg_restrict sysctl on /dev/kmsg")
      Signed-off-by: NVasily Averin <vvs@virtuozzo.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Josh Boyer <jwboyer@redhat.com>
      Cc: Eric Paris <eparis@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d194e5d6
    • T
      printk: implement support for extended console drivers · 6fe29354
      Tejun Heo 提交于
      printk log_buf keeps various metadata for each message including its
      sequence number and timestamp.  The metadata is currently available only
      through /dev/kmsg and stripped out before passed onto console drivers.  We
      want this metadata to be available to console drivers too so that console
      consumers can get full information including the metadata and dictionary,
      which among other things can be used to detect whether messages got lost
      in transit.
      
      This patch implements support for extended console drivers.  Consoles can
      indicate that they want extended messages by setting the new CON_EXTENDED
      flag and they'll be fed messages formatted the same way as /dev/kmsg.
      
       "<level>,<sequnum>,<timestamp>,<contflag>;<message text>\n"
      
      If extended consoles exist, in-kernel fragment assembly is disabled.  This
      ensures that all messages emitted to consoles have full metadata including
      sequence number.  The contflag carries enough information to reassemble
      the fragments from the reader side trivially.  Note that this only affects
      /dev/kmsg.  Regular console and /proc/kmsg outputs are not affected by
      this change.
      
      * Extended message formatting for console drivers is enabled iff there
        are registered extended consoles.
      
      * Comment describing /dev/kmsg message format updated to add missing
        contflag field and help distinguishing variable from verbatim terms.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: David Miller <davem@davemloft.net>
      Cc: Kay Sievers <kay@vrfy.org>
      Reviewed-by: NPetr Mladek <pmladek@suse.cz>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6fe29354