1. 12 2月, 2018 1 次提交
    • L
      vfs: do bulk POLL* -> EPOLL* replacement · a9a08845
      Linus Torvalds 提交于
      This is the mindless scripted replacement of kernel use of POLL*
      variables as described by Al, done by this script:
      
          for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
              L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
              for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done
          done
      
      with de-mangling cleanups yet to come.
      
      NOTE! On almost all architectures, the EPOLL* constants have the same
      values as the POLL* constants do.  But they keyword here is "almost".
      For various bad reasons they aren't the same, and epoll() doesn't
      actually work quite correctly in some cases due to this on Sparc et al.
      
      The next patch from Al will sort out the final differences, and we
      should be all done.
      Scripted-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a9a08845
  2. 07 2月, 2018 1 次提交
  3. 28 11月, 2017 1 次提交
  4. 28 2月, 2017 1 次提交
  5. 25 2月, 2017 1 次提交
  6. 27 12月, 2016 1 次提交
  7. 15 12月, 2016 1 次提交
  8. 12 10月, 2016 1 次提交
    • P
      relay: Use irq_work instead of plain timer for deferred wakeup · 26b5679e
      Peter Zijlstra 提交于
      Relay avoids calling wake_up_interruptible() for doing the wakeup of
      readers/consumers, waiting for the generation of new data, from the
      context of a process which produced the data.  This is apparently done to
      prevent the possibility of a deadlock in case Scheduler itself is is
      generating data for the relay, after acquiring rq->lock.
      
      The following patch used a timer (to be scheduled at next jiffy), for
      delegating the wakeup to another context.
      	commit 7c9cb383
      	Author: Tom Zanussi <zanussi@comcast.net>
      	Date:   Wed May 9 02:34:01 2007 -0700
      
      	relay: use plain timer instead of delayed work
      
      	relay doesn't need to use schedule_delayed_work() for waking readers
      	when a simple timer will do.
      
      Scheduling a plain timer, at next jiffies boundary, to do the wakeup
      causes a significant wakeup latency for the Userspace client, which makes
      relay less suitable for the high-frequency low-payload use cases where the
      data gets generated at a very high rate, like multiple sub buffers getting
      filled within a milli second.  Moreover the timer is re-scheduled on every
      newly produced sub buffer so the timer keeps getting pushed out if sub
      buffers are filled in a very quick succession (less than a jiffy gap
      between filling of 2 sub buffers).  As a result relay runs out of sub
      buffers to store the new data.
      
      By using irq_work it is ensured that wakeup of userspace client, blocked
      in the poll call, is done at earliest (through self IPI or next timer
      tick) enabling it to always consume the data in time.  Also this makes
      relay consistent with printk & ring buffers (trace), as they too use
      irq_work for deferred wake up of readers.
      
      [arnd@arndb.de: select CONFIG_IRQ_WORK]
       Link: http://lkml.kernel.org/r/20160912154035.3222156-1-arnd@arndb.de
      [akpm@linux-foundation.org: coding-style fixes]
      Link: http://lkml.kernel.org/r/1472906487-1559-1-git-send-email-akash.goel@intel.comSigned-off-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NAkash Goel <akash.goel@intel.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      26b5679e
  9. 06 10月, 2016 1 次提交
  10. 07 9月, 2016 2 次提交
  11. 03 8月, 2016 1 次提交
    • A
      relay: add global mode support for buffer-only channels · 59dbb2a0
      Akash Goel 提交于
      Commit 20d8b67c ("relay: add buffer-only channels; useful for early
      logging") added support to use channels with no associated files.
      
      This is useful when the exact location of relay file is not known or the
      the parent directory of relay file is not available, while creating the
      channel and the logging has to start right from the boot.
      
      But there was no provision to use global mode with buffer-only channels,
      which is added by this patch, without modifying the interface where
      initially there will be a dummy invocation of create_buf_file callback
      through which kernel client can convey the need of a global buffer.
      
      For the use case where drivers/kernel clients want a simple interface
      for the userspace, which enables them to capture data/logs from relay
      file inorder & without any post processing, support of Global buffer
      mode is warranted.
      
      Modules, like i915, using relay_open() in early init would have to later
      register their buffer-only relays, once debugfs is available, by calling
      relay_late_setup_files().  Hence relay_late_setup_files() symbol also
      needs to be exported.
      
      Link: http://lkml.kernel.org/r/1468404563-11653-1-git-send-email-akash.goel@intel.comSigned-off-by: NAkash Goel <akash.goel@intel.com>
      Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      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>
      59dbb2a0
  12. 10 6月, 2016 1 次提交
  13. 23 1月, 2016 1 次提交
    • A
      wrappers for ->i_mutex access · 5955102c
      Al Viro 提交于
      parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested},
      inode_foo(inode) being mutex_foo(&inode->i_mutex).
      
      Please, use those for access to ->i_mutex; over the coming cycle
      ->i_mutex will become rwsem, with ->lookup() done with it held
      only shared.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      5955102c
  14. 01 7月, 2015 1 次提交
  15. 16 4月, 2015 1 次提交
  16. 12 4月, 2014 1 次提交
  17. 02 4月, 2014 1 次提交
  18. 19 2月, 2014 1 次提交
  19. 15 7月, 2013 1 次提交
    • P
      kernel: delete __cpuinit usage from all core kernel files · 0db0628d
      Paul Gortmaker 提交于
      The __cpuinit type of throwaway sections might have made sense
      some time ago when RAM was more constrained, but now the savings
      do not offset the cost and complications.  For example, the fix in
      commit 5e427ec2 ("x86: Fix bit corruption at CPU resume time")
      is a good example of the nasty type of bugs that can be created
      with improper use of the various __init prefixes.
      
      After a discussion on LKML[1] it was decided that cpuinit should go
      the way of devinit and be phased out.  Once all the users are gone,
      we can then finally remove the macros themselves from linux/init.h.
      
      This removes all the uses of the __cpuinit macros from C files in
      the core kernel directories (kernel, init, lib, mm, and include)
      that don't really have a specific maintainer.
      
      [1] https://lkml.org/lkml/2013/5/20/589Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      0db0628d
  20. 01 5月, 2013 3 次提交
  21. 30 4月, 2013 1 次提交
    • D
      relay: move remove_buf_file inside relay_close_buf · b8d4a5bf
      Dmitry Monakhov 提交于
      Currently remove_buf_file callback is called from from kobject
      release method. This result in follow issue:
      # blktrace -d /dev/sda1 -d /dev/sda -o test
      
      blktrace_setup()
       dir = create_dir()
       rchan = relay_open(dir,...)
       ->create_buf_file_callback
          buf_file  = debugfs_create_file(dir, )
      
      Userspace will open buf_file.
      Later we make a decision to stop tracing
      blktrace_down()
        relay_close(rhcan)  /* just decrement kobj reference  */
                            /* since it is not zero then callback not called */
        debugfs_remove(dir) /* FAIL due to non empty dir   */
      
      Later user space will close the file and file will be deleted,
      but directory still exist.
      user_space_close()
       ->file_release
         ->release_buf_file_callback
           ->debugfs_remove(buf_file
      ## TESTCASE:
      # blktrace -d /dev/sda1 -d /dev/sda -o test
      # After that blktrace infrastructure will remain broken in
      # an unusable state so: blktrace -d /dev/sda1 will not work.
      
      In fact this is general issue, blktrace is just one of examples.
      We can not reliably remove parent dir until all users close the
      buf_file.
      
      Solution: We don't have to wait that long. File should be deleted inside
      relay_close_buf().
      Signed-off-by: NDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      b8d4a5bf
  22. 23 2月, 2013 1 次提交
  23. 14 6月, 2012 1 次提交
    • E
      splice: fix racy pipe->buffers uses · 047fe360
      Eric Dumazet 提交于
      Dave Jones reported a kernel BUG at mm/slub.c:3474! triggered
      by splice_shrink_spd() called from vmsplice_to_pipe()
      
      commit 35f3d14d (pipe: add support for shrinking and growing pipes)
      added capability to adjust pipe->buffers.
      
      Problem is some paths don't hold pipe mutex and assume pipe->buffers
      doesn't change for their duration.
      
      Fix this by adding nr_pages_max field in struct splice_pipe_desc, and
      use it in place of pipe->buffers where appropriate.
      
      splice_shrink_spd() loses its struct pipe_inode_info argument.
      Reported-by: NDave Jones <davej@redhat.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Tom Herbert <therbert@google.com>
      Cc: stable <stable@vger.kernel.org> # 2.6.35
      Tested-by: NDave Jones <davej@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      047fe360
  24. 10 2月, 2012 1 次提交
  25. 04 1月, 2012 1 次提交
  26. 31 10月, 2011 1 次提交
  27. 05 11月, 2010 1 次提交
  28. 28 5月, 2010 1 次提交
  29. 22 5月, 2010 1 次提交
  30. 07 3月, 2010 1 次提交
  31. 16 12月, 2009 1 次提交
  32. 28 9月, 2009 1 次提交
  33. 03 4月, 2009 1 次提交
  34. 19 2月, 2009 1 次提交
    • I
      timers: add mod_timer_pending() · 74019224
      Ingo Molnar 提交于
      Impact: new timer API
      
      Based on an idea from Martin Josefsson with the help of
      Patrick McHardy and Stephen Hemminger:
      
      introduce the mod_timer_pending() API which is a mod_timer()
      offspring that is an invariant on already removed timers.
      
      (regular mod_timer() re-activates non-pending timers.)
      
      This is useful for the networking code in that it can
      allow unserialized mod_timer_pending() timer-forwarding
      calls, but a single del_timer*() will stop the timer
      from being reactivated again.
      
      Also while at it:
      
      - optimize the regular mod_timer() path some more, the
        timer-stat and a debug check was needlessly duplicated
        in __mod_timer().
      
      - make the exports come straight after the function, as
        most other exports in timer.c already did.
      
      - eliminate __mod_timer() as an external API, change the
        users to mod_timer().
      
      The regular mod_timer() code path is not impacted
      significantly, due to inlining optimizations and due to
      the simplifications.
      
      Based-on-patch-from: Stephen Hemminger <shemminger@vyatta.com>
      Acked-by: NStephen Hemminger <shemminger@vyatta.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: netdev@vger.kernel.org
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      74019224
  35. 19 1月, 2009 1 次提交
  36. 30 12月, 2008 1 次提交
    • I
      relayfs: replace BUG() with WARN_ON() in relay_late_setup_files() · 7a51cffb
      Ingo Molnar 提交于
      Impact: turn boot crash into boot warning
      
      This BUG() can trigger:
      
      [   16.684131] initcall fail_page_alloc_debugfs+0x0/0xc1 returned 0 after 0 usecs
      [   16.692035] calling  kmemtrace_setup_late+0x0/0xd5 @ 1
      [   16.700087] relay_late_setup_files: CPU 1 has no buffer, it must have!
      [   16.704044] ------------[ cut here ]------------
      [   16.708030] kernel BUG at kernel/relay.c:680!
      [   16.708030] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC
      [   16.708030] last sysfs file:
      [   16.708030]
      [   16.708030] Pid: 1, comm: swapper Not tainted (2.6.28-tip-03903-g9a39f58-dirty #13207) System Product Name
      [   16.708030] EIP: 0060:[<c01604ae>] EFLAGS: 00010246 CPU: 1
      [   16.708030] EIP is at relay_late_setup_files+0x8c/0x176
      
      Reduce it to a more reportable WARN_ONCE().
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7a51cffb
  37. 11 12月, 2008 1 次提交