aboutsummaryrefslogtreecommitdiff
path: root/arch/m68k/mm
AgeCommit message (Collapse)AuthorFilesLines
2012-01-22m68k: Fix assembler constraint to prevent overeager gcc optimisationAndreas Schwab1-3/+3
Passing the address of a variable as an operand to an asm statement doesn't mark the value of this variable as used, so gcc may optimize its initialisation away. Fix this by using the "m" constraint instead. Signed-off-by: Andreas Schwab <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Cc: [email protected]
2011-12-30m68k: add ColdFire with MMU enabled support to the m68k mem init codeGreg Ungerer1-1/+1
The ColdFire has similar setup requirements to the SUN3 code, so we use that. Signed-off-by: Greg Ungerer <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Acked-by: Matt Waddel <[email protected]> Acked-by: Kurt Mahan <[email protected]>
2011-12-30m68k: compile appropriate mm arch files for ColdFire MMU supportGreg Ungerer1-3/+5
Create a config symbol to enable when using a ColdFire MMU. We then use that to only compile the necessary arch mm files. Signed-off-by: Greg Ungerer <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Acked-by: Matt Waddel <[email protected]> Acked-by: Kurt Mahan <[email protected]>
2011-12-30m68k: ColdFire V4e MMU paging init code and miss handlerGreg Ungerer1-0/+198
The different ColdFire V4e MMU requires its own dedicated paging init code, and a TLB miss handler for its software driven TLB. Signed-off-by: Greg Ungerer <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Acked-by: Matt Waddel <[email protected]> Acked-by: Kurt Mahan <[email protected]>
2011-12-30m68k: use ColdFire MMU read/write bit flags when ioremappingGreg Ungerer1-1/+2
The ColdFire MMU has separate read and write bits, unlike the Motorola m68k MMU which has a single read-only bit. Define a _PAGE_READWRITE value for the Motorola MMU, which is 0, so we can unconditionaly include that in the page table entry bits when setting up ioremapped pages. Signed-off-by: Greg Ungerer <[email protected]> Acked-by: Matt Waddel <[email protected]> Acked-by: Kurt Mahan <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]>
2011-12-30m68k: modify cache push and clear code for ColdFire with MMU enableGreg Ungerer1-2/+6
The cache push and clear code only need to flush the branch cache on the write-through cache setup of the ColdFire V4e with MMU enabled. Signed-off-by: Greg Ungerer <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Acked-by: Matt Waddel <[email protected]> Acked-by: Kurt Mahan <[email protected]>
2011-12-30m68k: add cache support for V4e ColdFire cores running with MMU enabledGreg Ungerer1-3/+21
Add code to deal with instruction, data and branch caches of the V4e ColdFire cores when they are running with the MMU enabled. This code is loosely based on Freescales changes for the caches of the V4e ColdFire in the 2.6.25 kernel BSP. That code was originally by Kurt Mahan <[email protected]> (now <[email protected]>). Signed-off-by: Greg Ungerer <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Acked-by: Matt Waddel <[email protected]> Acked-by: Kurt Mahan <[email protected]>
2011-12-24m68k: print memory layout info in boot logGreg Ungerer1-0/+34
Output a table of the kernel memory regions at boot time. This is taken directly from the ARM architecture code that does this. The table looks like this: Virtual kernel memory layout: vector : 0x00000000 - 0x00000400 ( 0 KiB) kmap : 0xd0000000 - 0xe0000000 ( 256 MiB) vmalloc : 0xc0000000 - 0xcfffffff ( 255 MiB) lowmem : 0x00000000 - 0x02000000 ( 32 MiB) .init : 0x00128000 - 0x00134000 ( 48 KiB) .text : 0x00020000 - 0x00118d54 ( 996 KiB) .data : 0x00118d60 - 0x00126000 ( 53 KiB) .bss : 0x00134000 - 0x001413e0 ( 53 KiB) This has been very useful while debugging the ColdFire virtual memory support code. But in general I think it is nice to know extacly where the kernel has layed everything out on boot. Signed-off-by: Greg Ungerer <[email protected]>
2011-10-18m68knommu: create common externs for _ram* varsGreg Ungerer1-1/+0
Create common extern definitions of _rambase, _ramstart and _ramend instead of them being externed when used in code. Signed-off-by: Greg Ungerer <[email protected]>
2011-10-18m68knommu: remove extern declarations of memory_start/memory_end from mm/initGreg Ungerer1-3/+0
We do not need to have local extern declarations of memory_start and memory_end in mm/init_no.c. There are declarations already in asm/page_no.h. Signed-off-by: Greg Ungerer <[email protected]>
2011-10-18m68knommu: use generic section names in mm/init codeGreg Ungerer1-9/+8
We should be including and using sections.h to get at the extern definitions of the linker sections in the m68knommu mm init code. Not defining them locally. Signed-off-by: Greg Ungerer <[email protected]>
2011-07-31Merge branch 'for-linus' of ↵Linus Torvalds1-5/+0
git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k/math-emu: Remove unnecessary code m68k/math-emu: Remove commented out old code m68k: Kill warning in setup_arch() when compiling for Sun3 m68k/atari: Prefix GPIO_{IN,OUT} with CODEC_ sparc: iounmap() and *_free_coherent() - Use lookup_resource() m68k/atari: Reserve some ST-RAM early on for device buffer use m68k/amiga: Chip RAM - Use lookup_resource() resources: Add lookup_resource() sparc: _sparc_find_resource() should check for exact matches m68k/amiga: Chip RAM - Offset resource end by CHIP_PHYSADDR m68k/amiga: Chip RAM - Use resource_size() to fix off-by-one error m68k/amiga: Chip RAM - Change chipavail to an atomic_t m68k/amiga: Chip RAM - Always allocate from the start of memory m68k/amiga: Chip RAM - Convert from printk() to pr_*() m68k/amiga: Chip RAM - Use tabs for indentation
2011-07-30m68k/atari: Reserve some ST-RAM early on for device buffer useMichael Schmitz1-5/+0
Based on an original patch from Michael Schmitz: Because mem_init() is now called before device init, devices that rely on ST-RAM may find all ST-RAM already allocated to other users by the time device init happens. In particular, a large initrd RAM disk may use up enough of ST-RAM to cause atari_stram_alloc() to resort to __get_dma_pages() allocation. In the current state of Atari memory management, all of RAM is marked DMA capable, so __get_dma_pages() may well return RAM that is not in actual fact DMA capable. Using this for frame buffer or SCSI DMA buffer causes subtle failure. The ST-RAM allocator has been changed to allocate memory from a pool of reserved ST-RAM of configurable size, set aside on ST-RAM init (i.e. before mem_init()). As long as this pool is not exhausted, allocation of real ST-RAM can be guaranteed. Other changes: - Replace the custom allocator in the ST-RAM pool by the existing allocator in the resource subsystem, - Remove mem_init_done and its hook, as memory init is now done before device init, - Remove /proc/stram, as ST-RAM usage now shows up under /proc/iomem, e.g. 005f2000-006f1fff : ST-RAM Pool 005f2000-0063dfff : atafb 0063e000-00641fff : ataflop 00642000-00642fff : SCSI Signed-off-by: Michael Schmitz <[email protected]> [Andreas Schwab <[email protected]>: Use memparse()] [Geert: Use the resource subsystem instead of a custom allocator] Signed-off-by: Geert Uytterhoeven <[email protected]>
2011-07-25m68knommu: Fix printk() format in free_initrd_mem()Geert Uytterhoeven1-2/+3
arch/m68k/mm/init_no.c:123: warning: format "%d" expects type "int", but argument 2 has type "long unsigned int" And use pr_notice() while we're at it. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Greg Ungerer <[email protected]>
2011-07-25m68knommu: Make empty_zero_page "void *", like on m68kGeert Uytterhoeven1-3/+3
This allows to get rid of the casts. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Greg Ungerer <[email protected]>
2011-05-25mm: now that all old mmu_gather code is gone, remove the storagePeter Zijlstra1-2/+0
Fold all the mmu_gather rework patches into one for submission Signed-off-by: Peter Zijlstra <[email protected]> Reported-by: Hugh Dickins <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: David Miller <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Russell King <[email protected]> Cc: Paul Mundt <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Tony Luck <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Cc: Mel Gorman <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Cc: Nick Piggin <[email protected]> Cc: Namhyung Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-24m68knommu: clean up mm/init_no.cGreg Ungerer1-47/+4
The memory initialization code for m68knommu has grown a bit crufty, clean it up. . remove unused declaration for die_if_kernel() . remove un-needed declaration of free_initmem() . removed unused definitions of empty_bad_page and empty_bad_page_table . removed unused DEBUG code . make free_initmem() proper prototype Signed-off-by: Greg Ungerer <[email protected]>
2011-05-24m68k: merge the mmu and non-mmu mm/MakefileGreg Ungerer3-18/+9
Its is trivial to megre the mmu and non-mmu arch/m68k/mm/Makefile's back into a single file. So do it. Signed-off-by: Greg Ungerer <[email protected]>
2011-05-24m68k: mv kmap_mm.c to kmap.cGreg Ungerer2-370/+365
The non-mmu kmap_no.c has been removed. So we can move kmap_mm.c back to being the only kmap.c. Signed-off-by: Greg Ungerer <[email protected]>
2011-05-24m68knommu: remove stubs for __ioremap() and iounmap()Greg Ungerer2-38/+1
The implementation of iounmap() and __ioremap() for non-mmu m68k is trivial. We can inline them in m68knommu headers and remove the trivial implementations. Signed-off-by: Greg Ungerer <[email protected]>
2011-05-24m68knommu: remove unused kernel_set_cachemode()Greg Ungerer1-8/+0
None of the m68knommu platforms will ever use kernel_set_cachemode(). And it is specific to a couple of m68k devices. So remove it. Signed-off-by: Greg Ungerer <[email protected]>
2011-04-27m68k/mm: Set all online nodes in N_NORMAL_MEMORYMichael Schmitz1-0/+2
For m68k, N_NORMAL_MEMORY represents all nodes that have present memory since it does not support HIGHMEM. This patch sets the bit at the time node_present_pages has been set by free_area_init_node. At the time the node is brought online, the node state would have to be done unconditionally since information about present memory has not yet been recorded. If N_NORMAL_MEMORY is not accurate, slub may encounter errors since it uses this nodemask to setup per-cache kmem_cache_node data structures. This pach is an alternative to the one proposed by David Rientjes <[email protected]> attempting to set node state immediately when bringing the node online. Signed-off-by: Michael Schmitz <[email protected]> Tested-by: Thorsten Glaser <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> CC: [email protected]
2011-03-25m68k: merge m68k and m68knommu arch directoriesGreg Ungerer9-522/+780
There is a lot of common code that could be shared between the m68k and m68knommu arch branches. It makes sense to merge the two branches into a single directory structure so that we can more easily share that common code. This is a brute force merge, based on a script from Stephen King <[email protected]>, which was originally written by Arnd Bergmann <[email protected]>. > The script was inspired by the script Sam Ravnborg used to merge the > includes from m68knommu. For those files common to both arches but > differing in content, the m68k version of the file is renamed to > <file>_mm.<ext> and the m68knommu version of the file is moved into the > corresponding m68k directory and renamed <file>_no.<ext> and a small > wrapper file <file>.<ext> is used to select between the two version. Files > that are common to both but don't differ are removed from the m68knommu > tree and files and directories that are unique to the m68knommu tree are > moved to the m68k tree. Finally, the arch/m68knommu tree is removed. > > To select between the the versions of the files, the wrapper uses > > #ifdef CONFIG_MMU > #include <file>_mm.<ext> > #else > #include <file>_no.<ext> > #endif On top of this file merge I have done a simplistic merge of m68k and m68knommu Kconfig, which primarily attempts to keep existing options and menus in place. Other than a handful of options being moved it produces identical .config outputs on m68k and m68knommu targets I tested it on. With this in place there is now quite a bit of scope for merge cleanups in future patches. Signed-off-by: Greg Ungerer <[email protected]>
2011-03-16m68k: Add helper function handle_kernel_fault()Roman Zippel1-15/+1
Add helper function handle_kernel_fault() in signal.c, so frame_extra_sizes can become static, and to avoid future code duplication. Signed-off-by: Roman Zippel <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]>
2010-05-17m68k: invoke oom-killer from page faultNick Piggin1-10/+4
As explained in commit 1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM from handle_mm_fault, rather than simply killing current. Cc: [email protected] Cc: Geert Uytterhoeven <[email protected]> Cc: [email protected] Signed-off-by: Nick Piggin <[email protected]> Acked-by: David Rientjes <[email protected]> [Geert] Kill 2 introduced compiler warnings Signed-off-by: Geert Uytterhoeven <[email protected]>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo3-1/+3
implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <[email protected]> Guess-its-ok-by: Christoph Lameter <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Lee Schermerhorn <[email protected]>
2010-02-27m68k{,nommu}/h8300: Remove obsolete comment about map_chunkPhilippe De Muyter1-2/+1
Remove the comments referring to a function map_chunk that no longer exists. Signed-off-by: Philippe De Muyter <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]>
2010-02-27m68k: Allow ioremapping top of memoryPhilippe De Muyter1-1/+1
The test in __ioremap to reject memory ranges crossing the 0 boundary rejects also memory ranges ending at the end of the memory. Fix that. Signed-off-by: Philippe De Muyter <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]>
2009-09-22arches: drop superfluous casts in nr_free_pages() callersGeert Uytterhoeven1-1/+1
Commit 96177299416dbccb73b54e6b344260154a445375 ("Drop free_pages()") modified nr_free_pages() to return 'unsigned long' instead of 'unsigned int'. This made the casts to 'unsigned long' in most callers superfluous, so remove them. [[email protected]: coding-style fixes] Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Christoph Lameter <[email protected]> Acked-by: Ingo Molnar <[email protected]> Acked-by: Russell King <[email protected]> Acked-by: David S. Miller <[email protected]> Acked-by: Kyle McMartin <[email protected]> Acked-by: WANG Cong <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Haavard Skinnemoen <[email protected]> Cc: Mikael Starvik <[email protected]> Cc: "Luck, Tony" <[email protected]> Cc: Hirokazu Takata <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: David Howells <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Paul Mundt <[email protected]> Cc: Chris Zankel <[email protected]> Cc: Michal Simek <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2009-06-21Move FAULT_FLAG_xyz into handle_mm_fault() callersLinus Torvalds1-1/+1
This allows the callers to now pass down the full set of FAULT_FLAG_xyz flags to handle_mm_fault(). All callers have been (mechanically) converted to the new calling convention, there's almost certainly room for architectures to clean up their code and then add FAULT_FLAG_RETRY when that support is added. Signed-off-by: Linus Torvalds <[email protected]>
2009-01-12m68k: Kill several external declarations in source filesGeert Uytterhoeven2-7/+4
- Replace external declarations by proper includes where availiable. The accesses to some symbols had to be modified, as before they were declared using e.g. "extern int _end", while asm-generic/sections.h uses e.g. "extern char _end[]" - Remove unused or superfluous external declarations Signed-off-by: Geert Uytterhoeven <[email protected]>
2008-10-14arch/m68k/mm/kmap.c: introduce missing kfreeJulia Lawall1-1/+3
Error handling code following a kmalloc should free the allocated data. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r exists@ local idexpression x; statement S; expression E; identifier f,l; position p1,p2; expression *ptr != NULL; @@ ( if ((x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...)) == NULL) S | x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...); .. if (x == NULL) S ) <... when != x when != if (...) { <+...x...+> } x->f = E ..> ( return \(0\|<+...x...+>\|ptr\); | return@p2 ...; ) @script:python@ p1 << r.p1; p2 << r.p2; @@ print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line) // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-07-26m68k: use generic show_mem()Johannes Weiner1-30/+0
Remove arch-specific show_mem() in favor of the generic version. This also removes the following redundant information display: - free pages, printed by show_free_areas() - pages in swapcache, printed by show_swap_cache_info() where show_mem() calls show_free_areas(), which calls show_swap_cache_info(). Signed-off-by: Johannes Weiner <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Cc: Roman Zippel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-07-24mm: drop unneeded pgdat argument from free_area_init_node()Johannes Weiner2-2/+2
free_area_init_node() gets passed in the node id as well as the node descriptor. This is redundant as the function can trivially get the node descriptor itself by means of NODE_DATA() and the node's id. I checked all the users and NODE_DATA() seems to be usable everywhere from where this function is called. Signed-off-by: Johannes Weiner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-07-24mm: move bootmem descriptors definition to a single placeJohannes Weiner1-3/+1
There are a lot of places that define either a single bootmem descriptor or an array of them. Use only one central array with MAX_NUMNODES items instead. Signed-off-by: Johannes Weiner <[email protected]> Acked-by: Ralf Baechle <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Russell King <[email protected]> Cc: Tony Luck <[email protected]> Cc: Hirokazu Takata <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Kyle McMartin <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Paul Mundt <[email protected]> Cc: David S. Miller <[email protected]> Cc: Yinghai Lu <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Andy Whitcroft <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-07-20arch/m68k/mm/sun3mmu.c: Eliminate NULL test and memset after alloc_bootmemJulia Lawall1-1/+0
As noted by Akinobu Mita in patch b1fceac2b9e04d278316b2faddf276015fc06e3b, alloc_bootmem and related functions never return NULL and always return a zeroed region of memory. Thus a NULL test or memset after calls to these functions is unnecessary. This was fixed using the following semantic patch. (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ expression E; statement S; @@ E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...) .. when != E ( - BUG_ON (E == NULL); | - if (E == NULL) S ) @@ expression E,E1; @@ E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...) .. when != E - memset(E,0,E1); // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-07-20arch/m68k/mm/motorola.c: Eliminate NULL test and memset after alloc_bootmemJulia Lawall1-1/+0
As noted by Akinobu Mita in patch b1fceac2b9e04d278316b2faddf276015fc06e3b, alloc_bootmem and related functions never return NULL and always return a zeroed region of memory. Thus a NULL test or memset after calls to these functions is unnecessary. This was fixed using the following semantic patch. (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ expression E; statement S; @@ E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...) .. when != E ( - BUG_ON (E == NULL); | - if (E == NULL) S ) @@ expression E,E1; @@ E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...) .. when != E - memset(E,0,E1); // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29m68k: Export empty_zero_page for ZERO_PAGE usage in modules.Aneesh Kumar K.V1-0/+1
ext4 uses ZERO_PAGE(0) to zero out blocks. We need to export different symbols in different arches for the usage of ZERO_PAGE in modules. Signed-off-by: Aneesh Kumar K.V <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
2008-04-28m68k: remove redundant display of free swap space in show_mem()Johannes Weiner1-1/+0
show_mem() has no need to print the amount of free swap space manually because show_free_areas() does this already and is called by the former. The two outputs only differ in text formatting: printk("Free swap = %lukB\n", ...); printk("Free swap: %6ldkB\n", ...); Signed-off-by: Johannes Weiner <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-10-19pid namespaces: define is_global_init() and is_container_init()Serge E. Hallyn1-1/+1
is_init() is an ambiguous name for the pid==1 check. Split it into is_global_init() and is_container_init(). A cgroup init has it's tsk->pid == 1. A global init also has it's tsk->pid == 1 and it's active pid namespace is the init_pid_ns. But rather than check the active pid namespace, compare the task structure with 'init_pid_ns.child_reaper', which is initialized during boot to the /sbin/init process and never changes. Changelog: 2.6.22-rc4-mm2-pidns1: - Use 'init_pid_ns.child_reaper' to determine if a given task is the global init (/sbin/init) process. This would improve performance and remove dependence on the task_pid(). 2.6.21-mm2-pidns2: - [Sukadev Bhattiprolu] Changed is_container_init() calls in {powerpc, ppc,avr32}/traps.c for the _exception() call to is_global_init(). This way, we kill only the cgroup if the cgroup's init has a bug rather than force a kernel panic. [[email protected]: fix comment] [[email protected]: Use is_global_init() in arch/m32r/mm/fault.c] [[email protected]: kernel/pid.c: remove unused exports] [[email protected]: Fix capability.c to work with threaded init] Signed-off-by: Serge E. Hallyn <[email protected]> Signed-off-by: Sukadev Bhattiprolu <[email protected]> Acked-by: Pavel Emelianov <[email protected]> Cc: Eric W. Biederman <[email protected]> Cc: Cedric Le Goater <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Herbert Poetzel <[email protected]> Cc: Kirill Korotaev <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-10-16During VM oom condition, kill all threads in process groupWill Schmidt1-1/+1
We have had complaints where a threaded application is left in a bad state after one of it's threads is killed when we hit a VM: out_of_memory condition. Killing just one of the process threads can leave the application in a bad state, whereas killing the entire process group would allow for the application to restart, or be otherwise handled, and makes it very obvious that something has gone wrong. This change allows the entire process group to be taken down, rather than just the one thread. Signed-off-by: Will Schmidt <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Russell King <[email protected]> Cc: Ian Molton <[email protected]> Cc: Haavard Skinnemoen <[email protected]> Cc: Mikael Starvik <[email protected]> Cc: David Howells <[email protected]> Cc: Andi Kleen <[email protected]> Cc: "Luck, Tony" <[email protected]> Cc: Hirokazu Takata <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Roman Zippel <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Kyle McMartin <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Paul Mundt <[email protected]> Cc: Kazumoto Kojima <[email protected]> Cc: Richard Curnow <[email protected]> Cc: William Lee Irwin III <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Chris Zankel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-08-22m68k: Kill superfluous externGeert Uytterhoeven1-5/+1
Kill a superfluous extern declaration Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-07-20m68k: missing __initAl Viro1-1/+1
Signed-off-by: Al Viro <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-07-20m68k: missing exportsAl Viro1-0/+2
Signed-off-by: Al Viro <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-07-19mm: fault feedback #2Nick Piggin1-11/+10
This patch completes Linus's wish that the fault return codes be made into bit flags, which I agree makes everything nicer. This requires requires all handle_mm_fault callers to be modified (possibly the modifications should go further and do things like fault accounting in handle_mm_fault -- however that would be for another patch). [[email protected]: fix alpha build] [[email protected]: fix s390 build] [[email protected]: fix sparc build] [[email protected]: fix sparc64 build] [[email protected]: fix ia64 build] Signed-off-by: Nick Piggin <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Russell King <[email protected]> Cc: Ian Molton <[email protected]> Cc: Bryan Wu <[email protected]> Cc: Mikael Starvik <[email protected]> Cc: David Howells <[email protected]> Cc: Yoshinori Sato <[email protected]> Cc: "Luck, Tony" <[email protected]> Cc: Hirokazu Takata <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Roman Zippel <[email protected]> Cc: Greg Ungerer <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Paul Mundt <[email protected]> Cc: Kazumoto Kojima <[email protected]> Cc: Richard Curnow <[email protected]> Cc: William Lee Irwin III <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Paolo 'Blaisorblade' Giarrusso <[email protected]> Cc: Miles Bader <[email protected]> Cc: Chris Zankel <[email protected]> Acked-by: Kyle McMartin <[email protected]> Acked-by: Haavard Skinnemoen <[email protected]> Acked-by: Ralf Baechle <[email protected]> Acked-by: Andi Kleen <[email protected]> Signed-off-by: Andrew Morton <[email protected]> [ Still apparently needs some ARM and PPC loving - Linus ] Signed-off-by: Linus Torvalds <[email protected]>
2007-05-31m68k: discontinuous memory supportRoman Zippel3-146/+147
Fix support for discontinuous memory Signed-off-by: Roman Zippel <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-05-31m68k: runtime patching infrastructureRoman Zippel1-0/+3
Add the basic infrastructure to allow runtime patching of kernel and modules to optimize a few functions with parameters, which are only calculated once during bootup and are otherwise constant. Use this for the conversion between virtual and physical addresses. Signed-off-by: Roman Zippel <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-12-13[PATCH] getting rid of all casts of k[cmz]alloc() callsRobert P. J. Day1-1/+1
Run this: #!/bin/sh for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do echo "De-casting $f..." perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f done And then go through and reinstate those cases where code is casting pointers to non-pointers. And then drop a few hunks which conflicted with outstanding work. Cc: Russell King <[email protected]>, Ian Molton <[email protected]> Cc: Mikael Starvik <[email protected]> Cc: Yoshinori Sato <[email protected]> Cc: Roman Zippel <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Kyle McMartin <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Greg KH <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Paul Fulghum <[email protected]> Cc: Alan Cox <[email protected]> Cc: Karsten Keil <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Cc: Jeff Garzik <[email protected]> Cc: James Bottomley <[email protected]> Cc: Ian Kent <[email protected]> Cc: Steven French <[email protected]> Cc: David Woodhouse <[email protected]> Cc: Neil Brown <[email protected]> Cc: Jaroslav Kysela <[email protected]> Cc: Takashi Iwai <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-12-09[PATCH] m68k: EXPORT_SYMBOL(cache_{clear,push}) bogus commentGeert Uytterhoeven1-2/+2
Remove bogus comments about unexporting cache_{push,clear}(), as inline dma_cache_maintenance() (used by at least bionet and pamsnet) calls them. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-12-09[PATCH] Sun3: General updatesSam Creasey1-2/+5
General compile fixes for 2.6.16 for sun3, and some updates to make the new bootloader work correctly. Tested on 3/50, 3/60, 3/80. Signed-off-by: Sam Creasey <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>