1. 07 3月, 2010 5 次提交
    • D
      lib: more scalable list_sort() · 835cc0c8
      Don Mullis 提交于
      XFS and UBIFS can pass long lists to list_sort(); this alternative
      implementation scales better, reaching ~3x performance gain when list
      length exceeds the L2 cache size.
      
      Stand-alone program timings were run on a Core 2 duo L1=32KB L2=4MB,
      gcc-4.4, with flags extracted from an Ubuntu kernel build.  Object size is
      581 bytes compared to 455 for Mark J.  Roberts' code.
      
      Worst case for either implementation is a list length just over a power of
      two, and to roughly the same degree, so here are timing results for a
      range of 2^N+1 lengths.  List elements were 16 bytes each including malloc
      overhead; initial order was random.
      
                            time (msec)
                            Tatham-Roberts
                            |       generic-Mullis-v2
      loop_count  length    |       |    ratio
      4000000       2     206     294    1.427
      2000000       3     176     227    1.289
      1000000       5     199     172    0.864
       500000       9     235     178    0.757
       250000      17     243     182    0.748
       125000      33     261     196    0.750
        62500      65     277     209    0.754
        31250     129     292     219    0.75
        15625     257     317     235    0.741
         7812     513     340     252    0.741
         3906    1025     362     267    0.737
         1953    2049     388     283    0.729  ~ L1 size
          976    4097     556     323    0.580
          488    8193     678     361    0.532
          244   16385     773     395    0.510
          122   32769     844     418    0.495
           61   65537     917     454    0.495
           30  131073    1128     543    0.481
           15  262145    2355     869    0.369  ~ L2 size
            7  524289    5597    1714    0.306
            3 1048577    6218    2022    0.325
      
      Mark's code does not actually implement the usual or generic mergesort,
      but rather a variant from Simon Tatham described here:
      
          http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html
      
      Simon's algorithm performs O(log N) passes over the entire input list,
      doing merges of sublists that double in size on each pass.  The generic
      algorithm instead merges pairs of equal length lists as early as possible,
      in recursive order.  For either algorithm, the elements that extend the
      list beyond power-of-two length are a special case, handled as nearly as
      possible as a "rounding-up" to a full POT.
      
      Some intuition for the locality of reference implications of merge order
      may be gotten by watching this animation:
      
          http://www.sorting-algorithms.com/merge-sort
      
      Simon's algorithm requires only O(1) extra space rather than the generic
      algorithm's O(log N), but in my non-recursive implementation the actual
      O(log N) data is merely a vector of ~20 pointers, which I've put on the
      stack.
      
      Long-running list_sort() calls: If the list passed in may be long, or the
      client's cmp() callback function is slow, the client's cmp() may
      periodically invoke cond_resched() to voluntarily yield the CPU.  All
      inner loops of list_sort() call back to cmp().
      
      Stability of the sort: distinct elements that compare equal emerge from
      the sort in the same order as with Mark's code, for simple test cases.  A
      boot-time test is provided to verify this and other correctness
      requirements.
      
      A kernel that uses drm.ko appears to run normally with this change; I have
      no suitable hardware to similarly test the use by UBIFS.
      
      [akpm@linux-foundation.org: style tweaks, fix comment, make list_sort_test __init]
      Signed-off-by: NDon Mullis <don.mullis@gmail.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Artem Bityutskiy <dedekind@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      835cc0c8
    • A
      lib/string.c: simplify strnstr() · d6a2eedf
      André Goddard Rosa 提交于
      Signed-off-by: NAndré Goddard Rosa <andre.goddard@gmail.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d6a2eedf
    • A
      lib/string.c: simplify stricmp() · a11d2b64
      André Goddard Rosa 提交于
      Removes 32 bytes on core2 with gcc 4.4.1:
         text    data     bss     dec     hex filename
         3196       0       0    3196     c7c lib/string-BEFORE.o
         3164       0       0    3164     c5c lib/string-AFTER.o
      Signed-off-by: NAndré Goddard Rosa <andre.goddard@gmail.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a11d2b64
    • S
      lkdtm: add debugfs access and loosen KPROBE ties · 0347af4e
      Simon Kagstrom 提交于
      Add adds a debugfs interface and additional failure modes to LKDTM to
      provide similar functionality to the provoke-crash driver submitted here:
      
        http://lwn.net/Articles/371208/
      
      Crashes can now be induced either through module parameters (as before)
      or through the debugfs interface as in provoke-crash.
      
      The patch also provides a new "direct" interface, where KPROBES are not
      used, i.e., the crash is invoked directly upon write to the debugfs
      file. When built without KPROBES configured, only this mode is available.
      Signed-off-by: NSimon Kagstrom <simon.kagstrom@netinsight.net>
      Cc: M. Mohan Kumar <mohan@in.ibm.com>
      Cc: Americo Wang <xiyou.wangcong@gmail.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0347af4e
    • A
      mm: use the same log level for show_mem() · f047f4f3
      Amerigo Wang 提交于
      Use the same log level for printk's in show_mem(), so that those messages
      can be shown completely when using log level 6.
      Signed-off-by: NWANG Cong <amwang@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f047f4f3
  2. 25 2月, 2010 4 次提交
    • P
      rcu: Add RCU_CPU_STALL_VERBOSE to dump detailed per-task information · 1ed509a2
      Paul E. McKenney 提交于
      When RCU detects a grace-period stall, it currently just prints
      out the PID of any tasks doing the stalling.  This patch adds
      RCU_CPU_STALL_VERBOSE, which enables the more-verbose reporting
      from sched_show_task().
      Suggested-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: laijs@cn.fujitsu.com
      Cc: dipankar@in.ibm.com
      Cc: mathieu.desnoyers@polymtl.ca
      Cc: josh@joshtriplett.org
      Cc: dvhltc@us.ibm.com
      Cc: niv@us.ibm.com
      Cc: peterz@infradead.org
      Cc: rostedt@goodmis.org
      Cc: Valdis.Kletnieks@vt.edu
      Cc: dhowells@redhat.com
      LKML-Reference: <1266887105-1528-21-git-send-email-paulmck@linux.vnet.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1ed509a2
    • P
      idr: Apply lockdep-based diagnostics to rcu_dereference() uses · 96be753a
      Paul E. McKenney 提交于
      Because idr can be used with any of a number of locks or with
      any flavor of RCU, just disable the lockdep-based diagnostics.
      If idr needs diagnostics, the check expression will need to be
      passed into the relevant idr primitives as an additional
      argument.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: laijs@cn.fujitsu.com
      Cc: dipankar@in.ibm.com
      Cc: mathieu.desnoyers@polymtl.ca
      Cc: josh@joshtriplett.org
      Cc: dvhltc@us.ibm.com
      Cc: niv@us.ibm.com
      Cc: peterz@infradead.org
      Cc: rostedt@goodmis.org
      Cc: Valdis.Kletnieks@vt.edu
      Cc: dhowells@redhat.com
      LKML-Reference: <1266887105-1528-11-git-send-email-paulmck@linux.vnet.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      96be753a
    • P
      radix-tree: Disable RCU lockdep checking in radix tree · 2676a58c
      Paul E. McKenney 提交于
      Because the radix tree is used with many different locking
      designs, we cannot do any effective checking without changing
      the radix-tree APIs. It might make sense to do this later, but
      only if the RCU lockdep checking proves itself sufficiently
      valuable.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: laijs@cn.fujitsu.com
      Cc: dipankar@in.ibm.com
      Cc: mathieu.desnoyers@polymtl.ca
      Cc: josh@joshtriplett.org
      Cc: dvhltc@us.ibm.com
      Cc: niv@us.ibm.com
      Cc: peterz@infradead.org
      Cc: rostedt@goodmis.org
      Cc: Valdis.Kletnieks@vt.edu
      Cc: dhowells@redhat.com
      LKML-Reference: <1266887105-1528-10-git-send-email-paulmck@linux.vnet.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2676a58c
    • P
      rcu: Introduce lockdep-based checking to RCU read-side primitives · 632ee200
      Paul E. McKenney 提交于
      Inspection is proving insufficient to catch all RCU misuses,
      which is understandable given that rcu_dereference() might be
      protected by any of four different flavors of RCU (RCU, RCU-bh,
      RCU-sched, and SRCU), and might also/instead be protected by any
      of a number of locking primitives. It is therefore time to
      enlist the aid of lockdep.
      
      This set of patches is inspired by earlier work by Peter
      Zijlstra and Thomas Gleixner, and takes the following approach:
      
      o	Set up separate lockdep classes for RCU, RCU-bh, and RCU-sched.
      
      o	Set up separate lockdep classes for each instance of SRCU.
      
      o	Create primitives that check for being in an RCU read-side
      	critical section.  These return exact answers if lockdep is
      	fully enabled, but if unsure, report being in an RCU read-side
      	critical section.  (We want to avoid false positives!)
      	The primitives are:
      
      	For RCU: rcu_read_lock_held(void)
      
      	For RCU-bh: rcu_read_lock_bh_held(void)
      
      	For RCU-sched: rcu_read_lock_sched_held(void)
      
      	For SRCU: srcu_read_lock_held(struct srcu_struct *sp)
      
      o	Add rcu_dereference_check(), which takes a second argument
      	in which one places a boolean expression based on the above
      	primitives and/or lockdep_is_held().
      
      o	A new kernel configuration parameter, CONFIG_PROVE_RCU, enables
      	rcu_dereference_check().  This depends on CONFIG_PROVE_LOCKING,
      	and should be quite helpful during the transition period while
      	CONFIG_PROVE_RCU-unaware patches are in flight.
      
      The existing rcu_dereference() primitive does no checking, but
      upcoming patches will change that.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: laijs@cn.fujitsu.com
      Cc: dipankar@in.ibm.com
      Cc: mathieu.desnoyers@polymtl.ca
      Cc: josh@joshtriplett.org
      Cc: dvhltc@us.ibm.com
      Cc: niv@us.ibm.com
      Cc: peterz@infradead.org
      Cc: rostedt@goodmis.org
      Cc: Valdis.Kletnieks@vt.edu
      Cc: dhowells@redhat.com
      LKML-Reference: <1266887105-1528-1-git-send-email-paulmck@linux.vnet.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      632ee200
  3. 23 2月, 2010 1 次提交
  4. 05 2月, 2010 1 次提交
  5. 03 2月, 2010 2 次提交
    • M
      lmb: Add lmb_free() · 24551f64
      Michael Ellerman 提交于
      We can free memory allocated with lmb_alloc() by removing it from the
      list of reserved LMBs. Rework lmb_remove() to allow that possibility
      and add lmb_free() which exploits it.
      
      BenH: Removed some useless parenthesis
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      24551f64
    • T
      idr: fix a critical misallocation bug · 859ddf09
      Tejun Heo 提交于
      Eric Paris located a bug in idr.  With IDR_BITS of 6, it grows to three
      layers when id 4096 is first allocated.  When that happens, idr wraps
      incorrectly and searches the idr array ignoring the high bits.  The
      following test code from Eric demonstrates the bug nicely.
      
      #include <linux/idr.h>
      #include <linux/kernel.h>
      #include <linux/module.h>
      
      static DEFINE_IDR(test_idr);
      
      int init_module(void)
      {
      	int ret, forty95, forty96;
      	void *addr;
      
      	/* add 2 entries both with 4095 as the start address */
      again1:
      	if (!idr_pre_get(&test_idr, GFP_KERNEL))
      		return -ENOMEM;
      	ret = idr_get_new_above(&test_idr, (void *)4095, 4095, &forty95);
      	if (ret) {
      		if (ret == -EAGAIN)
      			goto again1;
      		return ret;
      	}
      	if (forty95 != 4095)
      		printk(KERN_ERR "hmmm, forty95=%d\n", forty95);
      
      again2:
      	if (!idr_pre_get(&test_idr, GFP_KERNEL))
      		return -ENOMEM;
      	ret = idr_get_new_above(&test_idr, (void *)4096, 4095, &forty96);
      	if (ret) {
      		if (ret == -EAGAIN)
      			goto again2;
      		return ret;
      	}
      	if (forty96 != 4096)
      		printk(KERN_ERR "hmmm, forty96=%d\n", forty96);
      
      	/* try to find the 2 entries, noticing that 4096 broke */
      	addr = idr_find(&test_idr, forty95);
      	if ((int)addr != forty95)
      		printk(KERN_ERR "hmmm, after find forty95=%d addr=%d\n", forty95, (int)addr);
      	addr = idr_find(&test_idr, forty96);
      	if ((int)addr != forty96)
      		printk(KERN_ERR "hmmm, after find forty96=%d addr=%d\n", forty96, (int)addr);
      	/* really weird, the entry which should be at 4096 is actually at 0!! */
      	addr = idr_find(&test_idr, 0);
      	if ((int)addr)
      		printk(KERN_ERR "found an entry at id=0 for addr=%d\n", (int)addr);
      
      	idr_remove(&test_idr, forty95);
      	idr_remove(&test_idr, forty96);
      
      	return 0;
      }
      
      void cleanup_module(void)
      {
      }
      
      MODULE_AUTHOR("Eric Paris <eparis@redhat.com>");
      MODULE_DESCRIPTION("Simple idr test");
      MODULE_LICENSE("GPL");
      
      This happens because when sub_alloc() back tracks it doesn't always do it
      step-by-step while the over-the-limit detection assumes step-by-step
      backtracking.  The logic in sub_alloc() looks like the following.
      
        restart:
          clear pa[top level + 1] for end cond detection
          l = top level
          while (true) {
      	search for empty slot at this level
      	if (not found) {
      	    push id to the next possible value
      	    l++
      A:	    if (pa[l] is clear)
      	        failed, return asking caller to grow the tree
      	    if (going up 1 level gives more slots to search)
      	        continue the while loop above with the incremented l
      	    else
      C:	        goto restart
      	}
      	adjust id accordingly to the found slot
      	if (l == 0)
      	    return found id;
      	create lower level if not there yet
      	record pa[l] and l--
          }
      
      Test A is the fail exit condition but this assumes that failure is
      propagated upwared one level at a time but the B optimization path breaks
      the assumption and restarts the whole thing with a start value which is
      above the possible limit with the current layers.  sub_alloc() assumes the
      start id value is inside the limit when called and test A is the only exit
      condition check, so it ends up searching for empty slot while ignoring
      high set bit.
      
      So, for 4095->4096 test, level0 search fails but pa[1] contains a valid
      pointer.  However, going up 1 level wouldn't give any more empty slot so
      it takes C and when the whole thing restarts nobody notices the high bit
      set beyond the top level.
      
      This patch fixes the bug by changing the fail exit condition check to full
      id limit check.
      
      Based-on-patch-from: Eric Paris <eparis@redhat.com>
      Reported-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      859ddf09
  6. 27 1月, 2010 1 次提交
  7. 23 1月, 2010 1 次提交
  8. 16 1月, 2010 1 次提交
    • P
      rcu: 1Q2010 update for RCU documentation · 4c54005c
      Paul E. McKenney 提交于
      Add expedited functions.  Review documentation and update
      obsolete verbiage.  Also fix the advice for the RCU CPU-stall
      kernel configuration parameter, and document RCU CPU-stall
      warnings.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: laijs@cn.fujitsu.com
      Cc: dipankar@in.ibm.com
      Cc: mathieu.desnoyers@polymtl.ca
      Cc: josh@joshtriplett.org
      Cc: dvhltc@us.ibm.com
      Cc: niv@us.ibm.com
      Cc: peterz@infradead.org
      Cc: rostedt@goodmis.org
      Cc: Valdis.Kletnieks@vt.edu
      Cc: dhowells@redhat.com
      LKML-Reference: <12635142581866-git-send-email->
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4c54005c
  9. 15 1月, 2010 1 次提交
  10. 14 1月, 2010 2 次提交
    • J
      lib/vsprintf.c: Add IPV4 options %pI4[hnbl] for host, network, big and little endian · 0159f24e
      Joe Perches 提交于
      This should allow the removal of the #defines and uses
      of NIPQUAD and NIPQUAD_FMT
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0159f24e
    • B
      zlib: Fix build of powerpc boot wrapper · 6846ee5c
      Benjamin Herrenschmidt 提交于
      Commit ac4c2a3b broke the build
      of all powerpc boot wrappers.
      
      It attempts to add an include of autoconf.h but used the wrong
      path for it. It also adds -D__KERNEL__ to our boot wrapper, both
      things that we pretty much didn't do on purpose so far.
      
      We want our boot wrapper to remain independent enough of the kernel
      for various reasons, one of them being that you can "wrap" an existing
      kernel at distro install time which allows to ship one kernel image
      and a set of boot wrappers for different platforms, the wrappers
      don't have to be built out of the same kernel build tree.
      
      It's also incorrect to do what the patch does in our boot environment
      since we may not have a proper alignment exception handler which means
      we may not be able to fixup the few cases where an unaligned access will
      need SW emulation (depends on the core variant, could be when crossing
      page or segment boundaries for example).
      
      This patch fixes it by putting the old code back in and using the
      new "fancy" variant only when CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
      is set, which happens not to be set on powerpc since we don't include
      autoconf.h. It also reverts the changes to our boot wrapper Makefile.
      
      This means that x86 should, afaik, keep the optimisations since its
      boot wrapper does include autoconf.h and define __KERNEL__ (though I
      doubt they make that much different outside of slow embedded processors).
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6846ee5c
  11. 13 1月, 2010 1 次提交
  12. 12 1月, 2010 6 次提交
  13. 11 1月, 2010 1 次提交
  14. 08 1月, 2010 1 次提交
    • J
      lib/vsprintf.c: Add %pMF to format FDDI bit reversed MAC addresses · bc7259a2
      Joe Perches 提交于
      On Mon, 2010-01-04 at 23:43 +0000, Maciej W. Rozycki wrote:
      > The example below shows an address, and the sequence of bits or symbols
      > that would be transmitted when the address is used in the Source Address
      > or Destination Address fields on the MAC header.  The transmission line
      > shows the address bits in the order transmitted, from left to right.  For
      > IEEE 802 LANs these correspond to actual bits on the medium.  The FDDI
      > symbols line shows how the FDDI PHY sends the address bits as encoded
      > symbols.
      >
      >         MSB:            35:7B:12:00:00:01
      >         Canonical:      AC-DE-48-00-00-80
      >         Transmission:   00110101 01111011 00010010 00000000 00000000 00000001
      >         FDDI Symbols:   35 7B 12 00 00 01"
      >
      > Please note that this address has its group bit clear.
      >
      >  This notation is also defined in the "FDDI MEDIA ACCESS CONTROL-2
      > (MAC-2)" (X3T9/92-120) document although that book does not have a need
      > to use the MSB form and it's skipped.
      
      Adds 6 bytes to object size for x86
      
      New:
      $ size lib/vsprintf.o
         text	   data	    bss	    dec	    hex	filename
         8664	      0	      2	   8666	   21da	lib/vsprintf.o
      $ size lib/vsprintf.o
         text    data     bss     dec     hex filename
         8658       0       2    8660    21d4 lib/vsprintf.o
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bc7259a2
  15. 31 12月, 2009 1 次提交
    • I
      dma-debug: Fix bug causing build warning · a8fe9ea2
      Ingo Molnar 提交于
      Stephen Rothwell reported the following build warning:
      
       lib/dma-debug.c: In function 'dma_debug_device_change':
       lib/dma-debug.c:680: warning: 'return' with no value, in function returning non-void
      
      Introduced by commit f797d988
      ("dma-debug: Do not add notifier when dma debugging is disabled").
      
      Return 0 [notify-done] when disabled. (this is standard bus notifier behavior.)
      Signed-off-by: NShaun Ruffell <sruffell@digium.com>
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: <stable@kernel.org>
      LKML-Reference: <20091231125624.GA14666@liondog.tnic>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a8fe9ea2
  16. 28 12月, 2009 1 次提交
    • A
      x86, core: Optimize hweight32() · 39d997b5
      Akinobu Mita 提交于
      Optimize hweight32 by using the same technique in hweight64.
      
      The proof of this technique can be found in the commit log for
      f9b41929 ("bitops: hweight()
      speedup").
      
      The userspace benchmark on x86_32 showed 20% speedup with
      bitmap_weight() which uses hweight32 to count bits for each
      unsigned long on 32bit architectures.
      
       int main(void)
       {
      	#define SZ (1024 * 1024 * 512)
      
      	static DECLARE_BITMAP(bitmap, SZ) = {
      	        [0 ... 100] = 1,
      	};
      
      	return bitmap_weight(bitmap, SZ);
       }
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1258603932-4590-1-git-send-email-akinobu.mita@gmail.com>
      [ only x86 sets ARCH_HAS_FAST_MULTIPLIER so we do this via the x86 tree]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      39d997b5
  17. 23 12月, 2009 1 次提交
  18. 21 12月, 2009 1 次提交
    • S
      dma-debug: Do not add notifier when dma debugging is disabled. · f797d988
      Shaun Ruffell 提交于
      If CONFIG_HAVE_DMA_API_DEBUG is defined and "dma_debug=off" is
      specified on the kernel command line, when you detach a driver from a
      device you can cause the following NULL pointer dereference:
      
      BUG: unable to handle kernel NULL pointer dereference at (null)
      IP: [<c0580d35>] dma_debug_device_change+0x5d/0x117
      
      The problem is that the dma_debug_device_change notifier function is
      added to the bus notifier chain even though the dma_entry_hash array
      was never initialized.  If dma debugging is disabled, this patch both
      prevents dma_debug_device_change notifiers from being added to the
      chain, and additionally ensures that the dma_debug_device_change
      notifier function is a no-op.
      
      Cc: stable@kernel.org
      Signed-off-by: NShaun Ruffell <sruffell@digium.com>
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      f797d988
  19. 18 12月, 2009 1 次提交
  20. 16 12月, 2009 7 次提交