- 08 Mar, 2005 40 commits
-
-
Matt Mackall authored
Remove Linux 2.2 compatibility cruft. Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
Remove unused extract_timer_state struct. It was formerly used to feedback zero-entropy timing samples while extracting entropy, but that had a tendency to overwhelm the batch processing queue and prevent storing real samples. Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
Remove redundant memsets of BSS data Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
Simplify the init code Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
- Re-init all three pools in ioctls - Clear entropy count in init_std_data under a lock - Add kerneldoc comment Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
ZAPENTCNT is now effectively identical to RNDCLEARPOOL, fall through Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
Remove pool clearing. We've only ever cleared one of three pools and there's no good reason to do it. Instead just reset the entropy count. Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
Original code checked in output pool for missed wakeup avoidance, while waker (batch_entropy_process) checked input pool which could result in a missed wakeup. - Move to wait_event_interruptible style - Delete superfluous waitqueue Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
x86_64 wasn't doing anything special in its sort_extable. Use the generic lib/extable sort. Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
Switch IA64 exception tables to lib/sort. Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
Replace exception table insertion sort with lib/sort Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
Point XFS qsort at lib/sort in a way that makes it happy. Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Andrew Morton authored
We cannot tell at build time whether some module may want it. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
This patch adds a generic array sorting library routine. This is meant to replace qsort, which has two problem areas for kernel use. The first issue is quadratic worst-case performance. While quicksort worst-case datasets are rarely encountered in normal scenarios, it is in fact quite easy to construct worst cases for almost all quicksort algorithms given source or access to an element comparison callback. This could allow attackers to cause sorts that would otherwise take less than a millisecond to take seconds and sorts that should take less than a second to take weeks or months. Fixing this problem requires randomizing pivot selection with a secure random number generator, which is rather expensive. The second is that quicksort's recursion tracking requires either nontrivial amounts of stack space or dynamic memory allocation and out of memory error handling. By comparison, heapsort has both O(n log n) average and worst-case performance and practically no extra storage requirements. This version runs within 70-90% of the average performance of optimized quicksort so it should be an acceptable replacement wherever quicksort would be used in the kernel. Note that this function has an extra parameter for passing in an optimized swapping function. This is worth 10% or more over the typical byte-by-byte exchange functions. Benchmarks: qsort: glibc variant 1189 bytes (+ 256/1024 stack) qsort_3f: my simplified variant 459 bytes (+ 256/1024 stack) heapsort: the version below 346 bytes shellsort: an optimized shellsort 196 bytes P4 1.8GHz Opteron 1.4GHz (32-bit) size algorithm cycles relative cycles relative 100: qsort: 38682 100.00% 27631 100.00% qsort_3f: 36277 106.63% 22406 123.32% heapsort: 43574 88.77% 30301 91.19% shellsort: 39087 98.97% 25139 109.91% 200: qsort: 86468 100.00% 61148 100.00% qsort_3f: 78918 109.57% 48959 124.90% heapsort: 98040 88.20% 68235 89.61% shellsort: 95688 90.36% 62279 98.18% 400: qsort: 187720 100.00% 131313 100.00% qsort_3f: 174905 107.33% 107954 121.64% heapsort: 223896 83.84% 154241 85.13% shellsort: 223037 84.17% 148990 88.14% 800: qsort: 407060 100.00% 287460 100.00% qsort_3f: 385106 105.70% 239131 120.21% heapsort: 484662 83.99% 340099 84.52% shellsort: 537110 75.79% 354755 81.03% 1600: qsort: 879596 100.00% 621331 100.00% qsort_3f: 861568 102.09% 522013 119.03% heapsort: 1079750 81.46% 746677 83.21% shellsort: 1234243 71.27% 820782 75.70% 3200: qsort: 1903902 100.00% 1342126 100.00% qsort_3f: 1908816 99.74% 1131496 118.62% heapsort: 2515493 75.69% 1630333 82.32% shellsort: 2985339 63.78% 1964794 68.31% 6400: qsort: 4046370 100.00% 2909215 100.00% qsort_3f: 4164468 97.16% 2468393 117.86% heapsort: 5150659 78.56% 3533585 82.33% shellsort: 6650225 60.85% 4429849 65.67% 12800: qsort: 8729730 100.00% 6185097 100.00% qsort_3f: 8776885 99.46% 5288826 116.95% heapsort: 11064224 78.90% 7603061 81.35% shellsort: 15487905 56.36% 10305163 60.02% 25600: qsort: 18357770 100.00% 13172205 100.00% qsort_3f: 18687842 98.23% 11337115 116.19% heapsort: 24121241 76.11% 16612122 79.29% shellsort: 35552814 51.64% 24106987 54.64% 51200: qsort: 38658883 100.00% 28008505 100.00% qsort_3f: 39498463 97.87% 24339675 115.07% heapsort: 50553552 76.47% 37013828 75.67% shellsort: 82602416 46.80% 56201889 49.84% 102400: qsort: 81197794 100.00% 58918933 100.00% qsort_3f: 84257930 96.37% 51986219 113.34% heapsort: 110540577 73.46% 81419675 72.36% shellsort: 191303132 42.44% 129786472 45.40% From: Zou Nan hai <nanhai.zou@intel.com> The new sort routine only works if there are an even number of entries in the ia64 exception fix-up tables. If the number of entries is odd the sort fails, and then random get_user/put_user calls can fail. Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
CONFIG_BASE_SMALL reduce console transfer buffer Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
CONFIG_BASE_SMALL reduce timer list hashes Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
CONFIG_BASE_SMALL reduce futex hash table Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
CONFIG_BASE_SMALL reduce UID lookup hash Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
CONFIG_BASE_SMALL reduce size of pidmap table for small machines Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
CONFIG_BASE_SMALL degrade char dev hash table to linked list Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Matt Mackall authored
This patch series introduced a new pair of CONFIG_EMBEDDED options call CONFIG_BASE_FULL/CONFIG_BASE_SMALL. Disabling CONFIG_BASE_FULL sets the boolean CONFIG_BASE_SMALL to 1 and it is used to shrink a number of core data structures. The space savings for the current batch is around 14k. This patch: Add CONFIG_BASE_SMALL for miscellaneous core size that don't warrant their own options. Example users to follow. Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Randy Dunlap authored
oss/sscape: fix initdata reference used in exit: Error: ./sound/oss/sscape.o .exit.text refers to 000000000000007d R_X86_64_PC32 .init.data+0x0000000000000003 Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Randy Dunlap authored
oss/pss: fix initdata reference used in exit: Error: ./sound/oss/pss.o .exit.text refers to 000000000000003f R_X86_64_PC32 .init.data+0x0000000000000003 Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Randy Dunlap authored
oss/nm256_audio: fix init text section reference: Error: ./sound/oss/nm256_audio.o .text refers to 0000000000001847 R_X86_64_PC32 .init.text+0x0000000000000018 Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Randy Dunlap authored
oss/esssolo1: fix initdata section reference: Error: ./sound/oss/esssolo1.o .text refers to 0000000000000bab R_X86_64_32S .init.data+0x0000000000000004 Error: ./sound/oss/esssolo1.o .text refers to 0000000000000bb2 R_X86_64_32S .init.data Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Randy Dunlap authored
oss/es1370: fix initdata section reference: Error: ./sound/oss/es1370.o .text refers to 00000000000042bd R_X86_64_32S .init.data+0x0000000000000024 Error: ./sound/oss/es1370.o .text refers to 00000000000042c5 R_X86_64_32S .init.data+0x0000000000000020 Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Randy Dunlap authored
oss/cmpci: fix initdata section reference: Error: ./sound/oss/cmpci.o .text refers to 000000000000418e R_X86_64_32S .init.data+0x0000000000000004 Error: ./sound/oss/cmpci.o .text refers to 0000000000004196 R_X86_64_32S .init.data Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Randy Dunlap authored
oss/cs4281: fix initdata section references: Error: ./sound/oss/cs4281/cs4281.o .text refers to 0000000000006dae R_X86_64_32S .init.data+0x0000000000000004 Error: ./sound/oss/cs4281/cs4281.o .text refers to 0000000000006db6 R_X86_64_32S .init.data Error: ./sound/oss/cs4281/cs4281m.o .text refers to 0000000000006dae R_X86_64_32S .init.data+0x0000000000000004 Error: ./sound/oss/cs4281/cs4281m.o .text refers to 0000000000006db6 R_X86_64_32S .init.data Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Randy Dunlap authored
atm/zatm: fix text section references to __init text and __initdata; they should be __devinit instead of __init; Error: ./drivers/atm/zatm.o .text refers to 0000000000001abb R_X86_64_PC32 .init.text+0x0000000000000154 Error: ./drivers/atm/zatm.o .text refers to 0000000000001ad3 R_X86_64_PC32 .init.text+0x0000000000000154 Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Randy Dunlap authored
atm/ambassador: fix text section references to __init text and __initdata; The biggest negative about this AFAIK is that it makes ucode_data non-initdata, and that moves about 8 KB of data from .init.data to .data. Similarly, .text increases by approx. 1300 bytes (on x86-32). Error: ./drivers/atm/ambassador.o .text refers to 0000000000002a07 R_X86_64_PC32 .init.text+0x0000000000000149 Error: ./drivers/atm/ambassador.o .text refers to 0000000000002a45 R_X86_64_32S .init.data+0x0000000000000040 Error: ./drivers/atm/ambassador.o .text refers to 0000000000002a7c R_X86_64_PC32 .init.data+0x0000000000000020 Error: ./drivers/atm/ambassador.o .text refers to 0000000000002a83 R_X86_64_PC32 .init.data+0x000000000000001c Error: ./drivers/atm/ambassador.o .text refers to 0000000000002b40 R_X86_64_PC32 .init.text+0x0000000000000149 Error: ./drivers/atm/ambassador.o .text refers to 0000000000002bbc R_X86_64_PC32 .init.text+0x0000000000000149 Error: ./drivers/atm/ambassador.o .text refers to 0000000000002c0f R_X86_64_32S .init.data+0x0000000000000024 Error: ./drivers/atm/ambassador.o .text refers to 0000000000002c17 R_X86_64_32S .init.data+0x0000000000000020 Error: ./drivers/atm/ambassador.o .text refers to 0000000000002c3c R_X86_64_PC32 .init.data+0xfffffffffffffffc Error: ./drivers/atm/ambassador.o .text refers to 0000000000002c6a R_X86_64_PC32 .init.text+0x0000000000000149 Error: ./drivers/atm/ambassador.o .text refers to 0000000000002c77 R_X86_64_32S .init.data+0x0000000000000040 Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Randy Dunlap authored
atm/lanai: fix text section references to __init text; they should be __devinit instead of __init; Error: ./drivers/atm/lanai.o .text refers to 0000000000002105 R_X86_64_PC32 .init.text+0x0000000000000021 Error: ./drivers/atm/lanai.o .text refers to 0000000000002116 R_X86_64_PC32 .init.text+0x0000000000000021 Error: ./drivers/atm/lanai.o .text refers to 0000000000002132 R_X86_64_PC32 .init.text+0x0000000000000021 Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Paul Fulghum authored
Fix register access typo in synclinkmp.c that caused value to be written to wrong register. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Panagiotis Issaris authored
The EFI driver allocates memory and writes into it without checking the success of the allocation. Furthermore, on failure of the firmware_register() it doesn't free the allocated memory and on failure of the subsys_create_file() calls it returns zero instead of the errorcode. Signed-off-by: Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Jeff Moyer authored
There is a memory in the autofs4_wait function, if multiple processes are waiting on the same queue: name = kmalloc(NAME_MAX + 1, GFP_KERNEL); if (!name) return -ENOMEM; ... if ( !wq ) { /* Create a new wait queue */ wq = kmalloc(sizeof(struct autofs_wait_queue), GFP_KERNEL); if ( !wq ) { kfree(name); up(&sbi->wq_sem); return -ENOMEM; } ... wq->name = name; ... } else { atomic_inc(&wq->wait_ctr); up(&sbi->wq_sem); ... } In the else clause, we forget to free the name we kmalloc'd above. This is pretty easy to trigger with the following reproducer: setup an automount map as follows: for n in `seq 1 48`; do echo "$n server:/export/$n" >> /etc/auto.test; done setup a master map entry to point at this: echo "/test /etc/auto.test --timeout=1" >> /etc/auto.master Now, assuming the nfs server was setup to export said directories, run the following shell script in two xterms: #!/bin/sh while true; do for n in `seq 1 48`; do ls /test/$n done sleep 2 done and watch the size-256 slab cache grow Within 4 minutes, I had the size-256 cache grow to 384k. On a kernel with the below patch applied, the size-256 remained constant during an over-night run. Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Jan Kara authored
Attached patch from Nathan splits the checks done in quotactl() in XFS and VFS parts (it's mostly just moving of code back and forth). It's done mainly because XFS guys would like to implement more types of quotas and I don't want them to slow down the general VFS case. Signed-off-by: Nathan Scott <nathans@sgi.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Corey Minyard authored
This patch cleans up the DMI handling so that multiple interfaces can be reported from the DMI tables and so that the DMI slave address can be transferred up to the upper layer. It also adds an option to specify the slave address as an init parm and removes some unnecessary initializers. This patch also adds inc/dec usecount functions for the SMIs so they can modify the usecounts of modules they use (added because the SMB driver uses the I2C code). Signed-off-by: Corey Minyard <minyard@acm.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Nathan T. Lynch authored
With hotplug cpu and preempt, we tend to see smp_processor_id warnings from idle loop code because it's always checking whether its cpu has gone offline. Replacing every use of smp_processor_id with _smp_processor_id in all idle loop code is one solution; another way is explicitly binding idle threads to their cpus (the smp_processor_id warning does not fire if the caller is bound only to the calling cpu). This has the (admittedly slight) advantage of letting us know if an idle thread ever runs on the wrong cpu. Signed-off-by: Nathan Lynch <ntl@pobox.com> Acked-by: Joel Schopp <jschopp@austin.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Andries E. Brouwer authored
A well-known kernel bug is that it guesses at the partition type and the partitions on any disk it encounters. This is bad because needless I/O is done, slowing down the boot, sometimes quite a lot, especially when I/O errors occur. And it is bad because sometimes we guess wrong. In other words, we need the user space command `partition', where "partition -t dos /dev/sda" reads a DOS-type partition table. (And "partition /dev/sda" tries all known heuristics to decide what type of partitioning might be present.) The two variants are: (i) partition tells the kernel to do the partition table reading, and (ii) partition uses partx to read the partition table and tells the kernel one-by-one about the partitions found this way. Since this is a fundamental change, a long transition period is needed, and that period could start with a kernel boot parameter telling the kernel not to do partition table parsing on a particular disk, or a particular type of disks, or all disks. This could have been the intro to a patch doing that, but is not. (It is just an RFC.) The tiny patch below prompted the above - it was suggested by Uwe Bonnes who encountered USB devices without partition table where our present heuristics did not suffice to stop partition table parsing. It causes the kernel to ignore partitions of type 0. A band-aid. I think nobody uses such partitions seriously, but nevertheless this should probably live in -mm for a while to see if anybody complains. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Alexey Dobriyan authored
For when the layout of `struct resource' changes. Signed-off-by: Alexey Dobriyan <adobriyan@mail.ru> Acked-by: William Irwin <wli@holomorphy.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
Peter Samuelson authored
AIX curses.h defines macros 'clear_screen' and 'color_names' but does not define 'scroll()'. Signed-Off-By: Peter Samuelson <peter@p12n.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-