id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
298384cd7929a3a14d7b116095973f0d02f5d09e
Analyze and fix the following issue in the Linux kernel code: iget: stop EFS from using iget() and read_inode()
Problem Details: Stop the EFS filesystem from using iget() and read_inode(). Replace efs_read_inode() with efs_iget(), and call that instead of iget(). efs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. efs_fill_super() returns any error incurred...
```diff diff --git a/fs/efs/inode.c b/fs/efs/inode.c index 174696f9bf14..627c3026946d 100644 --- a/fs/efs/inode.c +++ b/fs/efs/inode.c @@ -45,17 +45,26 @@ static inline void extent_copy(efs_extent *src, efs_extent *dst) { return; } -void efs_read_inode(struct inode *inode) +struct inode *efs_iget(struct super_bloc...
e33ab086ae227a34e34b17e86dbb9d2dbaebb489
Analyze and fix the following issue in the Linux kernel code: iget: stop BFS from using iget() and read_inode()
Problem Details: Stop the BFS filesystem from using iget() and read_inode(). Replace bfs_read_inode() with bfs_iget(), and call that instead of iget(). bfs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. bfs_fill_super() returns any error incurred...
```diff diff --git a/fs/bfs/bfs.h b/fs/bfs/bfs.h index ac7a8b1d6c3a..71faf4d23908 100644 --- a/fs/bfs/bfs.h +++ b/fs/bfs/bfs.h @@ -44,6 +44,8 @@ static inline struct bfs_inode_info *BFS_I(struct inode *inode) #define printf(format, args...) \ printk(KERN_ERR "BFS-fs: %s(): " format, __FUNCTION__, ## args) +/* inod...
210f855963ba5edc4c7150754a79709a7c8a0d3c
Analyze and fix the following issue in the Linux kernel code: iget: stop AFFS from using iget() and read_inode()
Problem Details: Stop the AFFS filesystem from using iget() and read_inode(). Replace affs_read_inode() with affs_iget(), and call that instead of iget(). affs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. affs_fill_super() returns any error incu...
```diff diff --git a/fs/affs/affs.h b/fs/affs/affs.h index 232c69493683..d5bd497ab9cb 100644 --- a/fs/affs/affs.h +++ b/fs/affs/affs.h @@ -174,7 +174,8 @@ extern void affs_put_inode(struct inode *inode); extern void affs_drop_inode(struct inode *inode); extern void affs_delete_inode(struct inode *inode); ex...
92df5c3e38c0a0a66a456926039548275dfb3328
Analyze and fix the following issue in the Linux kernel code: vmcoreinfo: fix the configuration dependencies
Problem Details: This patch fixes the configuration dependencies in the vmcoreinfo data. i386's "node_data" is defined in arch/x86/mm/discontig_32.c, and x86_64's one is defined in arch/x86/mm/numa_64.c. They depend on CONFIG_NUMA: arch/x86/mm/Makefile_32:7 obj-$(CONFIG_NUMA) += discontig_32.o arch/x86/mm/Make...
```diff diff --git a/arch/ia64/kernel/machine_kexec.c b/arch/ia64/kernel/machine_kexec.c index 6e725eff271b..0823de1f6ebe 100644 --- a/arch/ia64/kernel/machine_kexec.c +++ b/arch/ia64/kernel/machine_kexec.c @@ -129,10 +129,11 @@ void machine_kexec(struct kimage *image) void arch_crash_save_vmcoreinfo(void) { -#if d...
bba1f603b88f30945ae4c5eccf2a6f5a12b877c5
Analyze and fix the following issue in the Linux kernel code: vmcoreinfo: add "VMCOREINFO_" to all the call for vmcoreinfo_append_str()
Problem Details: For readability, all the calls to vmcoreinfo_append_str() are changed to macros having a prefix "VMCOREINFO_". This discussion is the following: http://www.ussg.iu.edu/hypermail/linux/kernel/0709.3/0584.html Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp> Acked-by: Simon Horman <horms@ver...
```diff diff --git a/include/linux/kexec.h b/include/linux/kexec.h index cbc3cd7e11c1..3265968cd2cd 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -127,6 +127,10 @@ void vmcoreinfo_append_str(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); unsigned long paddr_vmcoreinfo_note(void); ...
43d46ab1cdeb12b8d072cfdf84956073a1fa8866
Analyze and fix the following issue in the Linux kernel code: dz: fix locking issues
Problem Details: The ->start_tx(), ->stop_tx() and ->stop_rx() backends are called with the port's lock already taken. Remove locking from within them and wrap around calls as necessary. Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> Cc: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@lin...
```diff diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c index c2f867777145..656c342a80f8 100644 --- a/drivers/serial/dz.c +++ b/drivers/serial/dz.c @@ -108,37 +108,28 @@ static void dz_stop_tx(struct uart_port *uport) { struct dz_port *dport = (struct dz_port *)uport; unsigned short tmp, mask = 1 << dport->...
ce783d70b95416725e262866f5b11436f35f68a9
Analyze and fix the following issue in the Linux kernel code: drivers-edac: i3000 code tidying
Problem Details: Style cleanup, mostly just 80-column fixes. Signed-off-by: Jason Uhlenkott <juhlenko@akamai.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk Signed-off-by: Doug Thompson <dougthompson@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-founda...
```diff diff --git a/drivers/edac/i3000_edac.c b/drivers/edac/i3000_edac.c index e895f9f887ab..3ccf3b5eecc3 100644 --- a/drivers/edac/i3000_edac.c +++ b/drivers/edac/i3000_edac.c @@ -30,105 +30,112 @@ #define I3000_MCHBAR_MASK 0xffffc000 #define I3000_MMR_WINDOW_SIZE 16384 -#define I3000_EDEAP 0x70 /* Extended DRA...
8f5aa26c75b7722e80c0c5c5bb833d41865d7019
Analyze and fix the following issue in the Linux kernel code: cpusets: update_cpumask documentation fix
Problem Details: Update cpuset documentation to match the October 2007 "Fix cpusets update_cpumask" changes that now apply changes to a cpusets 'cpus' allowed mask immediately to the cpus_allowed of the tasks in that cpuset. Signed-off-by: Paul Jackson <pj@sgi.com> Acked-by: Cliff Wickman <cpw@sgi.com> Cc: David Rient...
```diff diff --git a/Documentation/cpusets.txt b/Documentation/cpusets.txt index 141bef1c8599..43db6fe12814 100644 --- a/Documentation/cpusets.txt +++ b/Documentation/cpusets.txt @@ -523,21 +523,14 @@ from one cpuset to another, then the kernel will adjust the tasks memory placement, as above, the next time that the k...
c8d9c90c7ece28259436476a016cdecd25dccf2c
Analyze and fix the following issue in the Linux kernel code: hotplug cpu: move tasks in empty cpusets to parent various other fixes
Problem Details: Various minor formatting and comment tweaks to Cliff Wickman's [PATCH_3_of_3]_cpusets__update_cpumask_revision.patch I had had "iff", meaning "if and only if" in a comment. However, except for ancient mathematicians, the abbreviation "iff" was a tad too cryptic. Cliff changed it to "if", presumably ...
```diff diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 918bee9dc7a2..6868c1e78917 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -752,7 +752,7 @@ static int update_cpumask(struct cpuset *cs, char *buf) trialcs = *cs; /* - * An empty cpus_allowed is ok if there are no tasks in the cpuset. + * An emp...
58f4790b73639d1fa808439fac7f761a4c46e11f
Analyze and fix the following issue in the Linux kernel code: cpusets: update_cpumask revision
Problem Details: Use the new function cgroup_scan_tasks() to step through all tasks in a cpuset. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Cliff Wickman <cpw@sgi.com> Cc: Paul Menage <menage@google.com> Cc: Paul Jackson <pj@sgi.com> Cc: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Mo...
```diff diff --git a/kernel/cpuset.c b/kernel/cpuset.c index d94a8f7c4c29..20cb3916c66c 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -38,7 +38,6 @@ #include <linux/mount.h> #include <linux/namei.h> #include <linux/pagemap.h> -#include <linux/prio_heap.h> #include <linux/proc_fs.h> #include <linux/rcupdate...
956db3ca0606e78456786ef19fd4dc7a5151a6e1
Analyze and fix the following issue in the Linux kernel code: hotplug cpu: move tasks in empty cpusets to parent
Problem Details: This patch corrects a situation that occurs when one disables all the cpus in a cpuset. Currently, the disabled (cpu-less) cpuset inherits the cpus of its parent, which is incorrect because it may then overlap its cpu-exclusive sibling. Tasks of an empty cpuset should be moved to the cpuset which is ...
```diff diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 8675c691d3e2..ff9055fc3d2a 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -318,6 +318,7 @@ struct task_struct *cgroup_iter_next(struct cgroup *cont, struct cgroup_iter *it); void cgroup_iter_end(struct cgroup *cont, s...
31a7df01fd0cd786f60873a921aecafac148c290
Analyze and fix the following issue in the Linux kernel code: cgroups: mechanism to process each task in a cgroup
Problem Details: Provide cgroup_scan_tasks(), which iterates through every task in a cgroup, calling a test function and a process function for each. And call the process function without holding the css_set_lock lock. The idea is David Rientjes', predicting that such a function will make it much easier in the future...
```diff diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index d8e92223a79c..8675c691d3e2 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -14,6 +14,7 @@ #include <linux/nodemask.h> #include <linux/rcupdate.h> #include <linux/cgroupstats.h> +#include <linux/prio_heap.h> #ifdef CONFI...
1cfb419b394ba82745c54ff05436d598ecc2dbd5
Analyze and fix the following issue in the Linux kernel code: per-zone and reclaim enhancements for memory controller: modifies vmscan.c for isolate globa/cgroup lru activity
Problem Details: When using memory controller, there are 2 levels of memory reclaim. 1. zone memory reclaim because of system/zone memory shortage. 2. memory cgroup memory reclaim because of hitting limit. These two can be distinguished by sc->mem_cgroup parameter. (scan_global_lru() macro) This patch tries to make...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index be4dfe87be03..a26dabd62fed 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -856,7 +856,8 @@ static unsigned long shrink_inactive_list(unsigned long max_scan, __mod_zone_page_state(zone, NR_ACTIVE, -nr_active); __mod_zone_page_state(zone, NR_INACTIVE, -(nr_...
6c48a1d040a9a9eaa4acdd7d4cb3885e04bf8413
Analyze and fix the following issue in the Linux kernel code: per-zone and reclaim enhancements for memory controller: remember reclaim priority in memory cgroup
Problem Details: Functions to remember reclaim priority per cgroup (as zone->prev_priority) [akpm@linux-foundation.org: build fixes] [akpm@linux-foundation.org: more build fixes] Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Balbir Singh <balbir@l...
```diff diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index bb9c079eeb0c..f82158faa494 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -70,6 +70,11 @@ extern void mem_cgroup_page_migration(struct page *page, struct page *newpage); extern int mem_cgroup_calc_mapped_rat...
d2ceb9b7ddedbb2e8e590bc6ce33c854043016f9
Analyze and fix the following issue in the Linux kernel code: memory cgroup enhancements: add memory.stat file
Problem Details: Show accounted information of memory cgroup by memory.stat file [akpm@linux-foundation.org: coding-style fixes] [akpm@linux-foundation.org: fix printk warning] Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Balbir Singh <b...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 5f3ad9c37bea..904e9a9c223d 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -29,6 +29,7 @@ #include <linux/swap.h> #include <linux/spinlock.h> #include <linux/fs.h> +#include <linux/seq_file.h> #include <asm/uaccess.h> @@ -794,6 +795,49 @@ static...
d52aa412d43827033a8e2ce4415ef6e8f8d53635
Analyze and fix the following issue in the Linux kernel code: memory cgroup enhancements: add status accounting function for memory cgroup
Problem Details: Add statistics account infrastructure for memory controller. All account information is stored per-cpu and caller will not have to take lock or use atomic ops. This will be used by memory.stat file later. CACHE includes swapcache now. I'd like to divide it to PAGECACHE and SWAPCACHE later. This pat...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 31c4f0cefdee..5f3ad9c37bea 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -21,6 +21,7 @@ #include <linux/memcontrol.h> #include <linux/cgroup.h> #include <linux/mm.h> +#include <linux/smp.h> #include <linux/page-flags.h> #include <linux/backing-de...
82369553d6d3bc67c54129a02e0bc0b5b88f3045
Analyze and fix the following issue in the Linux kernel code: memcgroup: fix hang with shmem/tmpfs
Problem Details: The memcgroup regime relies upon a cgroup reclaiming pages from itself within add_to_page_cache: which may involve some waiting. Whereas shmem and tmpfs rely upon using add_to_page_cache while holding a spinlock: when it cannot wait. The consequence is that when a cgroup reaches its limit, shmem_getp...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index dbf571547c03..11b23f203d68 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -329,23 +329,26 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm, * with it */ retry: - lock_page_cgroup(page); - pc = page_get_page_cgroup(p...
ac44d354d5c9ced49b1165d6496f134501134219
Analyze and fix the following issue in the Linux kernel code: Memory controller use rcu_read_lock() in mem_cgroup_cache_charge()
Problem Details: Hugh Dickins noticed that we were using rcu_dereference() without rcu_read_lock() in the cache charging routine. The patch below fixes this problem Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Hugh Dickins <hugh@veritas.com> S...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 975e89935d52..160101a05b4d 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -456,16 +456,20 @@ int mem_cgroup_charge(struct page *page, struct mm_struct *mm, int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, gfp_t gfp_mask) { + ...
417eead30434b4bd09a54455e839cf9a62c05460
Analyze and fix the following issue in the Linux kernel code: memory cgroup enhancements: fix zone handling in try_to_free_mem_cgroup_page
Problem Details: Because NODE_DATA(node)->node_zonelists[] is guaranteed to contain all necessary zones, it is not necessary to use for_each_online_node. And this for_each_online_node() makes reclaim routine start always from node 0. This is not good. This patch makes reclaim start from caller's node and just use usua...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index 1b85217b528c..159e6c760d83 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1365,15 +1365,12 @@ unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem_cont, .mem_cgroup = mem_cont, .isolate_pages = mem_cgroup_isolate_pages, }; - int node; struct zo...
436c6541b13a73790646eb11429bdc8ee50eec41
Analyze and fix the following issue in the Linux kernel code: memcgroup: fix zone isolation OOM
Problem Details: mem_cgroup_charge_common shows a tendency to OOM without good reason, when a memhog goes well beyond its rss limit but with plenty of swap available. Seen on x86 but not on PowerPC; seen when the next patch omits swapcache from memcgroup, but we presume it can happen without. mem_cgroup_isolate_pages ...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index e8493fb2d69e..9793873d5a90 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -260,24 +260,20 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, spin_lock(&mem_cont->lru_lock); scan = 0; list_for_each_entry_safe_reverse(pc, tmp, src,...
ff7283fa3a66823933991ad55a558a3a01d5ab27
Analyze and fix the following issue in the Linux kernel code: bugfix for memory cgroup controller: avoid !PageLRU page in mem_cgroup_isolate_pages
Problem Details: This patch makes mem_cgroup_isolate_pages() to be - ignore !PageLRU pages. - fixes the bug that isolation makes no progress if page_zone(page) != zone page once find. (just increment scan in this case.) kswapd and memory migration removes a page from list when it handles a page for reclaiming...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 128f45c16fa6..e8493fb2d69e 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -250,7 +250,7 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, unsigned long scan; LIST_HEAD(pc_list); struct list_head *src; - struct page_cgroup *pc; +...
ae41be374293e70e1ed441d986afcc6e744ef9d9
Analyze and fix the following issue in the Linux kernel code: bugfix for memory cgroup controller: migration under memory controller fix
Problem Details: While using memory control cgroup, page-migration under it works as following. == 1. uncharge all refs at try to unmap. 2. charge regs again remove_migration_ptes() == This is simple but has following problems. == The page is uncharged and charged back again if *mapped*. - This means that cgroup...
```diff diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 42536c737d9c..4ec712967f7c 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -60,6 +60,10 @@ static inline void mem_cgroup_uncharge_page(struct page *page) mem_cgroup_uncharge(page_get_page_cgroup(page)); } ...
9175e0311ec9e6d1bf1f6dfecf9268baf08765e6
Analyze and fix the following issue in the Linux kernel code: bugfix for memory controller: add helper function for assigning cgroup to page
Problem Details: This patch adds following functions. - clear_page_cgroup(page, pc) - page_cgroup_assign_new_page_group(page, pc) Mainly for cleanup. A manner "check page->cgroup again after lock_page_cgroup()" is implemented in straight way. A comment in mem_cgroup_uncharge() will be removed by force-empty pa...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 2fadd4896a14..3270ce7375db 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -162,6 +162,48 @@ static void __always_inline unlock_page_cgroup(struct page *page) bit_spin_unlock(PAGE_CGROUP_LOCK_BIT, &page->page_cgroup); } +/* + * Tie new page_cgroup ...
4c4a22148909e4c003562ea7ffe0a06e26919e3c
Analyze and fix the following issue in the Linux kernel code: memcontrol: move oom task exclusion to tasklist scan
Problem Details: Creates a helper function to return non-zero if a task is a member of a memory controller: int task_in_mem_cgroup(const struct task_struct *task, const struct mem_cgroup *mem); When the OOM killer is constrained by the memory controller, the exclusion of tasks that are not a member of that...
```diff diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 4f580268b1b7..42536c737d9c 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -48,6 +48,7 @@ extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, extern void mem_cgroup_out_of_memory(struct me...
4c6bc8dd5a0932f2c0b30a5f0a124464b7f614d0
Analyze and fix the following issue in the Linux kernel code: mem-controller gfp-mask fix
Problem Details: Need to strip __GFP_HIGHMEM flag while passing to mem_container_cache_charge(). Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/mm/filemap.c b/mm/filemap.c index 35867ab72640..5357fcc4643b 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -460,7 +460,8 @@ int filemap_write_and_wait_range(struct address_space *mapping, int add_to_page_cache(struct page *page, struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask) ...
3062fc67dad01b1d2a15d58c709eff946389eca4
Analyze and fix the following issue in the Linux kernel code: memcontrol: move mm_cgroup to header file
Problem Details: Inline functions must preceed their use, so mm_cgroup() should be defined in linux/memcontrol.h. include/linux/memcontrol.h:48: warning: 'mm_cgroup' declared inline after being called include/linux/memcontrol.h:48: warning: previous declaration of 'mm_cgroup' was here [akpm@linux-foundation.org: bu...
```diff diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index cc0ad7191acd..4f580268b1b7 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -20,6 +20,9 @@ #ifndef _LINUX_MEMCONTROL_H #define _LINUX_MEMCONTROL_H +#include <linux/rcupdate.h> +#include <linux/mm.h> + stru...
8697d33194faae6fdd6b2e799f6308aa00cfdf67
Analyze and fix the following issue in the Linux kernel code: Memory controller: add switch to control what type of pages to limit
Problem Details: Choose if we want cached pages to be accounted or not. By default both are accounted for. A new set of tunables are added. echo -n 1 > mem_control_type switches the accounting to account for only mapped pages echo -n 3 > mem_control_type switches the behaviour back [bunk@kernel.org: mm/memcontro...
```diff diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 9bbbf524ba8f..bb6f5105401b 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -22,6 +22,8 @@ struct mem_cgroup; struct page_cgroup; +struct page; +struct mm_struct; #ifdef CONFIG_CGROUP_MEM_CONT @@ -40,6...
c7ba5c9e8176704bfac0729875fa62798037584d
Analyze and fix the following issue in the Linux kernel code: Memory controller: OOM handling
Problem Details: Out of memory handling for cgroups over their limit. A task from the cgroup over limit is chosen using the existing OOM logic and killed. TODO: 1. As discussed in the OLS BOF session, consider implementing a user space policy for OOM handling. [akpm@linux-foundation.org: fix build due to oom-killer c...
```diff diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 9c3c1c97c197..9bbbf524ba8f 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -39,6 +39,7 @@ extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, int mode, struct zone *z, struct me...
0eea10301708c64a6b793894c156e21ddd15eb64
Analyze and fix the following issue in the Linux kernel code: Memory controller improve user interface
Problem Details: Change the interface to use bytes instead of pages. Page sizes can vary across platforms and configurations. A new strategy routine has been added to the resource counters infrastructure to format the data as desired. Suggested by David Rientjes, Andrew Morton and Herbert Poetzl Tested on a UML set...
```diff diff --git a/Documentation/controllers/memory.txt b/Documentation/controllers/memory.txt index 7e27baacca7b..61df8f81c803 100644 --- a/Documentation/controllers/memory.txt +++ b/Documentation/controllers/memory.txt @@ -165,11 +165,30 @@ c. Enable CONFIG_CGROUP_MEM_CONT Since now we're in the 0 cgroup, We ca...
66e1707bc34609f626e2e7b4fe7e454c9748bad5
Analyze and fix the following issue in the Linux kernel code: Memory controller: add per cgroup LRU and reclaim
Problem Details: Add the page_cgroup to the per cgroup LRU. The reclaim algorithm has been modified to make the isolate_lru_pages() as a pluggable component. The scan_control data structure now accepts the cgroup on behalf of which reclaims are carried out. try_to_free_pages() has been extended to become cgroup awar...
```diff diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index f5b47efab48b..9c3c1c97c197 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -32,6 +32,13 @@ extern void page_assign_page_cgroup(struct page *page, extern struct page_cgroup *page_get_page_cgroup(struct page *p...
8a9f3ccd24741b50200c3f33d62534c7271f3dfc
Analyze and fix the following issue in the Linux kernel code: Memory controller: memory accounting
Problem Details: Add the accounting hooks. The accounting is carried out for RSS and Page Cache (unmapped) pages. There is now a common limit and accounting for both. The RSS accounting is accounted at page_add_*_rmap() and page_remove_rmap() time. Page cache is accounted at add_to_page_cache(), __delete_from_page_c...
```diff diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 7d1f119c796e..f5b47efab48b 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -30,6 +30,13 @@ extern void mm_free_cgroup(struct mm_struct *mm); extern void page_assign_page_cgroup(struct page *page, struct...
e552b6617067ab785256dcec5ca29eeea981aacb
Analyze and fix the following issue in the Linux kernel code: Memory controller: resource counters
Problem Details: With fixes from David Rientjes <rientjes@google.com> Introduce generic structures and routines for resource accounting. Each resource accounting cgroup is supposed to aggregate it, cgroup_subsystem_state and its resource-specific members within. Signed-off-by: Pavel Emelianov <xemul@openvz.org> Sign...
```diff diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h new file mode 100644 index 000000000000..eeb3f7749772 --- /dev/null +++ b/include/linux/res_counter.h @@ -0,0 +1,102 @@ +#ifndef __RES_COUNTER_H__ +#define __RES_COUNTER_H__ + +/* + * Resource Counters + * Contain common data types and routi...
e18f6318e5dab189efd4cb0bbfcbd923cc373e3c
Analyze and fix the following issue in the Linux kernel code: cgroup brace coding style fix
Problem Details: Coding style fix - one line conditionals don't get braces. Signed-off-by: Paul Jackson <pj@sgi.com> Acked-by: Paul Menage <menage@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/kernel/cgroup.c b/kernel/cgroup.c index ae367471b07b..54760d5b651e 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -1181,9 +1181,8 @@ static int attach_task(struct cgroup *cgrp, struct task_struct *tsk) for_each_subsys(root, ss) { if (ss->can_attach) { retval = ss->can_attach(ss, cgr...
f8a4c3b5250496f072d9098a641fd5642146d999
Analyze and fix the following issue in the Linux kernel code: tty: fix tty network driver interactions with TCGET/TCSET calls (x86 fix)
Problem Details: And to go with it Dave's type checking x86 termios headers. I've updated these as the original sent by Dave had some wrong types in it. Signed-off-by: Alan Cox <alan@redhat.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@linux-foun...
```diff diff --git a/include/asm-x86/termios.h b/include/asm-x86/termios.h index d501748700d2..f72956331c49 100644 --- a/include/asm-x86/termios.h +++ b/include/asm-x86/termios.h @@ -41,6 +41,8 @@ struct termio { #ifdef __KERNEL__ +#include <asm/uaccess.h> + /* intr=^C quit=^\ erase=del kill=^U eof=^D vtime=...
94b3e03c875f25c19ede9600c66d74a30b81957d
Analyze and fix the following issue in the Linux kernel code: kernel-doc: fix for vunmap function prototype
Problem Details: Fix kernel-doc function prototype parsing which was exposed by vunmap() by allowing more than one '*' before the function name. Error(linux-2.6.24-mm1//mm/vmalloc.c:438): cannot understand prototype: 'struct page **vunmap(const void *addr) ' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signe...
```diff diff --git a/scripts/kernel-doc b/scripts/kernel-doc index ec54f12f57b0..1c1d350b4901 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1654,7 +1654,7 @@ sub dump_function($$) { $prototype =~ m/^(\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || $prototype =~ m/^(\w+\s*\*)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(...
deb21db7788b97a2bccdefe605433ef97f482689
Analyze and fix the following issue in the Linux kernel code: VFS: swap do_ioctl and vfs_ioctl names
Problem Details: Rename old vfs_ioctl to do_ioctl, because the comment above it clearly indicates that it is an internal function not to be exported to modules; therefore it should have a more traditional do_XXX name. The new do_ioctl is exported in fs.h but not to modules. Rename the old do_ioctl to vfs_ioctl becaus...
```diff diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index ffdc022cae64..614bd75b5a4a 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c @@ -2986,7 +2986,7 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, } do_ioctl: - error = vfs_ioctl(filp, fd, cmd, arg); + error = do_vfs_ioctl(f...
ce22e1d39429c7de9f054ce8d03278dd2010b642
Analyze and fix the following issue in the Linux kernel code: [SPARC64]: Fix booting on non-zero cpu.
Problem Details: The early per-cpu handling needs a slight tweak to work when booting on a non-zero cpu. We got away with this for a long time, but can't any longer as now even printk() calls functions (cpu_clock() for example) that thus make early references to per-cpu variables. Signed-off-by: David S. Miller <dave...
```diff diff --git a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S index c4147ad8677b..44b105c04dd3 100644 --- a/arch/sparc64/kernel/head.S +++ b/arch/sparc64/kernel/head.S @@ -632,11 +632,36 @@ tlb_fixup_done: /* Not reached... */ 1: + /* If we boot on a non-zero cpu, all of the per-cpu + * variable re...
f9f7dd222364a6428d2ad99a515935dd1dd89d18
Analyze and fix the following issue in the Linux kernel code: [MTD] Fix mtdoops.c compilation
Problem Details: drivers/mtd/mtdoops.c: In function ‘mtdoops_console_sync’: drivers/mtd/mtdoops.c:329: error: implicit declaration of function ‘in_interrupt’ Signed-off-by: David Woodhouse <dwmw2@infradead.org>
```diff diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c index fd98e38f10bc..d3cf05012b46 100644 --- a/drivers/mtd/mtdoops.c +++ b/drivers/mtd/mtdoops.c @@ -30,6 +30,7 @@ #include <linux/wait.h> #include <linux/delay.h> #include <linux/spinlock.h> +#include <linux/interrupt.h> #include <linux/mtd/mtd.h> ...
484b8e64c848185af0d3671fafba4dd66ca412d2
Analyze and fix the following issue in the Linux kernel code: [MTD] [NOR] fix startup lock when using multiple nor flash chips
Problem Details: Taken from http://bugzilla.kernel.org/show_bug.cgi?id=9829 I found and solved the problem, at line 115 of drivers/mtd/chips/gen_probe.c (kernel 2.6.24): mapsize value must be calculated in bytes, not in long. Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <dwm...
```diff diff --git a/drivers/mtd/chips/gen_probe.c b/drivers/mtd/chips/gen_probe.c index 2eb696d7b97b..d338b8c92780 100644 --- a/drivers/mtd/chips/gen_probe.c +++ b/drivers/mtd/chips/gen_probe.c @@ -112,7 +112,7 @@ static struct cfi_private *genprobe_ident_chips(struct map_info *map, struct chi max_chips = 1; } ...
d5476689afd48e71395602698409e9f48cbba413
Analyze and fix the following issue in the Linux kernel code: [MTD] Fix maps/physmap.c compilation with CONFIG_PM
Problem Details: Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
```diff diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index 5a83ae7e14f9..f00e04efbe28 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c @@ -204,7 +204,7 @@ static int physmap_flash_suspend(struct platform_device *dev, pm_message_t state if (info) for (i = 0; i < MAX...
2b7f1b8c8f4a8991dfeefc31844e15c642b6de2a
Analyze and fix the following issue in the Linux kernel code: leds: Fix led-gpio active_low default brightness
Problem Details: When gpio_direction_output() is called, led_dat->active_low is used as default value. This means that the led will always be off by default. cdev.brightness should really have been set to LED_OFF unconditionally to reflect this behavior. Signed-off-by: Raphael Assenat <raph@8d.com> Signed-off-by: Rich...
```diff diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index 99bc50059d35..6c0a9c4761ee 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -85,7 +85,7 @@ static int gpio_led_probe(struct platform_device *pdev) led_dat->can_sleep = gpio_cansleep(cur_led->gpio); led_dat->activ...
b7143156c9ceee1a072c57aac8729d2dec5b3bf1
Analyze and fix the following issue in the Linux kernel code: ACPI: fix build warning
Problem Details: drivers/acpi/system.c:360: warning: ignoring return value of ‘sysfs_create_group’, declared with attribute warn_unused_result Signed-off-by: Len Brown <len.brown@intel.com>
```diff diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c index ce881713f7a6..55cf4c05bb74 100644 --- a/drivers/acpi/system.c +++ b/drivers/acpi/system.c @@ -357,8 +357,8 @@ void acpi_irq_stats_init(void) } interrupt_stats_attr_group.attrs = all_attrs; - sysfs_create_group(acpi_kobj, &interrupt_stats_att...
9b7131542178f5f948e4bb6bea6e1c545e697b06
Analyze and fix the following issue in the Linux kernel code: Revert "cpuidle: build fix for non-x86"
Problem Details: This reverts commit f757397097d0713c949af76dccabb65a2785782e. which ironically broke the ia64 build
```diff diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 3954ae96b0c7..fd4265007053 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -98,9 +98,6 @@ config ARCH_HAS_ILOG2_U32 config ARCH_HAS_ILOG2_U64 def_bool n -config ARCH_HAS_CPU_IDLE_WAIT - def_bool y - config GENERIC_CALIBRATE_DELAY def_bool y ...
87ecd5cddaa37f057d8d8c2813e1b748b1804423
Analyze and fix the following issue in the Linux kernel code: ACPI: add missing prink prefix strings
Problem Details: Signed-off-by: Len Brown <len.brown@intel.com>
```diff diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index d9d531cce27f..78a82b3c7b60 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -59,7 +59,7 @@ static int create_modalias(struct acpi_device *acpi_dev, char *modalias, count = snprintf(&modalias[len], size, "%s:", cid_list->id[i].v...
4e83dd95b343a4ecfdb236aa046a5366a29e6f1e
Analyze and fix the following issue in the Linux kernel code: ACPICA: fix CONFIG_ACPI_DEBUG_FUNC_TRACE build
Problem Details: 798d91039849486c7a4f1a458a5680cb55a65408 (ACPI: create CONFIG_ACPI_DEBUG_FUNC_TRACE) failed to associate the new tracing config option with the tracing code. Signed-off-by: Len Brown <len.brown@intel.com>
```diff diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 45662f6dbdb6..99d171c87c84 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h @@ -486,7 +486,7 @@ #define ACPI_FUNCTION_NAME(name) #endif -#ifdef DEBUG_FUNC_TRACE +#ifdef CONFIG_ACPI_DEBUG_FUNC_TRACE #define ACPI_FUNCTIO...
863c1490e512db40dab61e44b694a493a9e68b3f
Analyze and fix the following issue in the Linux kernel code: ACPI: video: reset brightness on resume
Problem Details: Some machines seem to need the backlight brightness to be reset on resume. Add support for doing so to the video module. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Andrew Morton <akpm@linux-fou...
```diff diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 74ff0faeab57..b5e35cd559ea 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -77,6 +77,7 @@ module_param(brightness_switch_enabled, bool, 0644); static int acpi_video_bus_add(struct acpi_device *device); static int acpi_video_bus_r...
450790a2c51e6d9d47ed30dbdcf486656b8e186f
Analyze and fix the following issue in the Linux kernel code: [XFS] Fix oops in xfs_file_readdir()
Problem Details: When xfs_file_readdir() exactly fills a buffer, it can move it's index past the end of the buffer and dereference it even though the result of the dereference is never used. On some platforms this causes an oops. SGI-PV: 976923 SGI-Modid: xfs-linux-melb:xfs-kern:30458a Signed-off-by: David Chinner <d...
```diff diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c index 21a1c2b1c5fc..edab1ffbb163 100644 --- a/fs/xfs/linux-2.6/xfs_file.c +++ b/fs/xfs/linux-2.6/xfs_file.c @@ -350,8 +350,8 @@ xfs_file_readdir( size = buf.used; de = (struct hack_dirent *)buf.dirent; - curr_offset = de->offset /* ...
de08dbc1977419efa47eb71f10d96a98eb5bb111
Analyze and fix the following issue in the Linux kernel code: [XFS] Make xfs_ail_check check less by default
Problem Details: Checking the entire AIL on every insert and remove is prohibitively expensive - the sustained sequntial create rate on a single disk drops from about 1800/s to 60/s because of this checking resulting in the xfslogd becoming cpu bound. By default on debug builds, only check the next and previous entrie...
```diff diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c index 7ed7425478de..4d6330eddc8d 100644 --- a/fs/xfs/xfs_trans_ail.c +++ b/fs/xfs/xfs_trans_ail.c @@ -34,9 +34,9 @@ STATIC xfs_log_item_t * xfs_ail_min(xfs_ail_entry_t *); STATIC xfs_log_item_t * xfs_ail_next(xfs_ail_entry_t *, xfs_log_item_t *); ...
edd319dc527733e61eec5bdc9ce20c94634b6482
Analyze and fix the following issue in the Linux kernel code: [XFS] Fix xfs_lowbit64
Problem Details: xfs_lowbit64 was broken on 32 bit platforms in a recent cleanup of the xfs bitops. Fix it back up again. SGI-PV: 974005 SGI-Modid: xfs-linux-melb:xfs-kern:30202a Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
```diff diff --git a/fs/xfs/xfs_bit.h b/fs/xfs/xfs_bit.h index 0f9fc9a3c415..325a007dec91 100644 --- a/fs/xfs/xfs_bit.h +++ b/fs/xfs/xfs_bit.h @@ -61,15 +61,15 @@ static inline int xfs_highbit64(__uint64_t v) /* Get low bit set out of 32-bit argument, -1 if none set */ static inline int xfs_lowbit32(__uint32_t v) { ...
5d51eff4538bdfeb9b7a2ec030ee3b0980b067d2
Analyze and fix the following issue in the Linux kernel code: [XFS] Fix inode allocation latency
Problem Details: The log force added in xfs_iget_core() has been a performance issue since it was introduced for tight loops that allocate then unlink a single file. under heavy writeback, this can introduce unnecessary latency due tothe log I/o getting stuck behind bulk data writes. Fix this latency problem by avoind...
```diff diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index b5afcfcdc7d5..264b1e7dacf7 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c @@ -70,6 +70,22 @@ xfs_synchronize_atime( } } +/* + * If the linux inode exists, mark it dirty. + * Used when commiting a dirty ...
e4143a1cf5973e3443c0650fc4c35292d3b7baa8
Analyze and fix the following issue in the Linux kernel code: [XFS] Fix transaction overrun during writeback.
Problem Details: Prevent transaction overrun in xfs_iomap_write_allocate() if we race with a truncate that overlaps the delalloc range we were planning to allocate. If we race, we may allocate into a hole and that requires block allocation. At this point in time we don't have a reservation for block allocation (apart ...
```diff diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index d16f40cdf5f6..637a24473f9b 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c @@ -702,6 +702,9 @@ retry: * the originating callers request. * * Called without a lock on the inode. + * + * We no longer bother to look at the incoming map - all...
8ae2c0f64a81a93d2c394eacee29d6ced53b54f9
Analyze and fix the following issue in the Linux kernel code: [XFS] Fix sparse warning in xlog_recover_do_efd_trans.
Problem Details: Sparse trips over the locking order in xlog_recover_do_efd_trans() when xfs_trans_delete_ail() drops the ail lock. Because the unlock is conditional, we need to either annotate with a "fake unlock" or change the structure of the code so sparse thinks the function always unlocks. Reordering the code ma...
```diff diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 3b804b93b282..071672969421 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -2733,21 +2733,13 @@ xlog_recover_do_efd_trans( * AIL lock. */ xfs_trans_delete_ail(mp, lip); - break; + xfs_efi_item_f...
a8272ce0c1d49aa3bec57682678f0bdfe28ed4ca
Analyze and fix the following issue in the Linux kernel code: [XFS] Fix up sparse warnings.
Problem Details: These are mostly locking annotations, marking things static, casts where needed and declaring stuff in header files. SGI-PV: 971186 SGI-Modid: xfs-linux-melb:xfs-kern:30002a Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy ...
```diff diff --git a/fs/xfs/linux-2.6/xfs_globals.c b/fs/xfs/linux-2.6/xfs_globals.c index 9febf9dc999d..ef90e64641e6 100644 --- a/fs/xfs/linux-2.6/xfs_globals.c +++ b/fs/xfs/linux-2.6/xfs_globals.c @@ -47,5 +47,6 @@ xfs_param_t xfs_params = { /* * Global system credential structure. */ -cred_t sys_cred_val, *sys_...
c319b58b13bb22f9a2478825b06c641c825f51ec
Analyze and fix the following issue in the Linux kernel code: [XFS] Make xfs_bulkstat() to report unlinked but referenced inodes
Problem Details: We need xfs_bulkstat() to report inode stat for inodes with link count zero but reference count non zero. The fix here: http://oss.sgi.com/archives/xfs/2007-09/msg00266.html changed this behavior and made xfs_bulkstat() to filter all unlinked inodes including those that are not destroyed yet but hel...
```diff diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 6d5641ff08f6..597e0ed4d2b6 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -1953,24 +1953,6 @@ xfs_iunlink( ASSERT(agi->agi_unlinked[bucket_index]); ASSERT(be32_to_cpu(agi->agi_unlinked[bucket_index]) != agino); - error = xfs_itobp(mp,...
bc58f9bb6be02a80b5f1f757b656c9affc07154f
Analyze and fix the following issue in the Linux kernel code: [XFS] fix 32-bit compat ioctls for GETXFLAGS, SETXFLAGS, GETVERSION
Problem Details: XFS_IOC_GETVERSION, XFS_IOC_GETXFLAGS and XFS_IOC_SETXFLAGS all take a "long" which changes size between 32 and 64 bit platforms. So, the ioctl cmds that come in from a 32-bit app aren't as expected, for example on GETXFLAGS, unknown cmd fd(3) cmd(80046601){t:'f';sz:4} due to the size mismatch. So,...
```diff diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c index bf2a956b63c2..83463c27545c 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl32.c +++ b/fs/xfs/linux-2.6/xfs_ioctl32.c @@ -379,9 +379,6 @@ xfs_compat_ioctl( switch (cmd) { case XFS_IOC_DIOINFO: case XFS_IOC_FSGEOMETRY: - case XFS_IOC_...
2e906655baf1c6f6fccd212fc9e6499dc6928b80
Analyze and fix the following issue in the Linux kernel code: ACPI: idle: Fix acpi_safe_halt usages and interrupt enabling/disabling
Problem Details: acpi_safe_halt() needs interrupts to be disabled for atomic need_resched check and safe halt. Otherwise we may miss an interrupt and go into halt. acpi_safe_halt() also does not enable interrupts on all return paths. So the callers should handle enable and disable interrupts around it. Signed-off-by...
```diff diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 199ea2146153..106a22948aa9 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -201,6 +201,10 @@ static inline u32 ticks_elapsed_in_us(u32 t1, u32 t2) return PM_TIMER_TICKS_TO_US((0xFFFFFFFF - t1) +...
547266e46cc0b35ce51bd1f37f261d831927431f
Analyze and fix the following issue in the Linux kernel code: ACPI: thinkpad-acpi: second TP_EC_FAN_FULLSPEED should be TP_EC_FAN_AUTO
Problem Details: fix bug in safety net for TPEC fan control mode eaa7571b2d1a08873e4bdd8e6db3431df61cd9ad Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
```diff diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index 8ef0afc88693..7ba1acad5402 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@ -4790,7 +4790,7 @@ static int fan_set_level(int level) * or FULLSPEED mode bits and just ignore them */ if (level & TP_...
df92e695998e1bc6e426a840eb86d6d1ee87e2a5
Analyze and fix the following issue in the Linux kernel code: ACPI: track opregion names to avoid driver resource conflicts.
Problem Details: Small ACPICA extension to be able to store the name of operation regions in osl.c later In ACPI, AML can define accesses to IO ports and System Memory by Operation Regions. Those are not registered as done by PNPACPI using resource templates (and _CRS/_SRS methods). The IO ports and System Memory re...
```diff diff --git a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c index fc9da4879cbf..f501e083aac7 100644 --- a/drivers/acpi/dispatcher/dsopcode.c +++ b/drivers/acpi/dispatcher/dsopcode.c @@ -359,7 +359,9 @@ acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *obj_desc) sta...
613d70436c1aeda6843ca8b70c7fab6d0484a591
Analyze and fix the following issue in the Linux kernel code: [XFS] kill xfs_iocore_t
Problem Details: xfs_iocore_t is a structure embedded in xfs_inode. Except for one field it just duplicates fields already in xfs_inode, and there is nothing this abstraction buys us on XFS/Linux. This patch removes it and shrinks source and binary size of xfs aswell as shrinking the size of xfs_inode by 60/44 bytes in...
```diff diff --git a/fs/xfs/Makefile-linux-2.6 b/fs/xfs/Makefile-linux-2.6 index d1491aa7a0e2..97316451fc6d 100644 --- a/fs/xfs/Makefile-linux-2.6 +++ b/fs/xfs/Makefile-linux-2.6 @@ -70,7 +70,6 @@ xfs-y += xfs_alloc.o \ xfs_iget.o \ xfs_inode.o \ xfs_inode_item.o \ - xfs_iocore.o \ ...
15947f2d4f747897f31cfaa36e98a93f80ca3d3f
Analyze and fix the following issue in the Linux kernel code: [XFS] more vnode/inode tracing fixes
Problem Details: SGI-PV: 970335 SGI-Modid: xfs-linux-melb:xfs-kern:29697a Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Signed-off-by: Tim Shimmin <tes@sgi.com>
```diff diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h index 09763067da11..bb3983a1bbbd 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.h +++ b/fs/xfs/linux-2.6/xfs_vnode.h @@ -314,12 +314,15 @@ extern void xfs_itrace_rele(struct xfs_inode *, char *, int, inst_t *); _xfs_itrace_entry(ip, __FUNCTION_...
52b804829ca4cf3d1d9849232dadf67269cd89f4
Analyze and fix the following issue in the Linux kernel code: [POWERPC] mpc52xx: fix compile error introduce when rebasing patch
Problem Details: When rebasing one of the mpc5200 psc UART patches I made a mistake and damaged the patch. This patch fixes the compile failure introduced in commit 25ae3a0739c69425a911925b43213895a9802b98 Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
```diff diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index 821facd10bbc..a638f23c6c61 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c @@ -131,31 +131,6 @@ static irqreturn_t mpc52xx_uart_int(int irq, void *dev_id); #define uart_console(port) (0) #endif -#...
b018fcdaa5e8b4eabb8cffda687d00004a3c4785
Analyze and fix the following issue in the Linux kernel code: drm: Make DRM_IOCTL_GET_CLIENT return EINVAL when it can't find client #idx.
Problem Details: Fixes the getclient test and dritest -c. Signed-off-by: Dave Airlie <airlied@linux.ie>
```diff diff --git a/drivers/char/drm/drm_ioctl.c b/drivers/char/drm/drm_ioctl.c index b4d86a3343c6..16829fb3089d 100644 --- a/drivers/char/drm/drm_ioctl.c +++ b/drivers/char/drm/drm_ioctl.c @@ -235,25 +235,22 @@ int drm_getclient(struct drm_device *dev, void *data, idx = client->idx; mutex_lock(&dev->struct_mutex)...
7ffa05e0518ebc055ef8f68d7d53e5f7d2ba3428
Analyze and fix the following issue in the Linux kernel code: drm: Fix ioc32 compat layer
Problem Details: Previously any ioctls that weren't explicitly listed in the compat ioctl table would fail with ENOTTY. If the incoming ioctl number is outside the range of the table, assume that it Just Works, and pass it off to drm_ioctl. This make the fence related ioctls work on 64-bit PowerPC. Signed-off-by: Dav...
```diff diff --git a/drivers/char/drm/drm_ioc32.c b/drivers/char/drm/drm_ioc32.c index 2286f3312c5c..90f5a8d9bdcb 100644 --- a/drivers/char/drm/drm_ioc32.c +++ b/drivers/char/drm/drm_ioc32.c @@ -1051,8 +1051,12 @@ long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) drm_ioctl_compat_t *fn; ...
47a184a80800dd69abd1206eea1b961070ce2ca3
Analyze and fix the following issue in the Linux kernel code: drm: fd.o bug #11895: Only add the AGP base to map offset if the caller didn't.
Problem Details: The i830 and newer intel 2D code adds the AGP base to map offsets already, because it wasn't doing the AGP enable which used to set dev->agp->base. Credit goes to Zhenyu for finding the issue. Signed-off-by: Dave Airlie <airlied@linux.ie>
```diff diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c index 07b774fa3f38..bde64b84166e 100644 --- a/drivers/char/drm/drm_bufs.c +++ b/drivers/char/drm/drm_bufs.c @@ -229,11 +229,17 @@ static int drm_addmap_core(struct drm_device * dev, unsigned int offset, #ifdef __alpha__ map->offset += de...
89c04849e71a7f8893474e5415cfd8bcb1b65d94
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] Fix sparse warning in powernow-k8
Problem Details: arch/x86/kernel/cpu/cpufreq/powernow-k8.c:1238:9: warning: symbol '__ptr' shadows an earlier one arch/x86/kernel/cpu/cpufreq/powernow-k8.c:1238:9: originally declared here Signed-off-by: Dave Jones <davej@redhat.com>
```diff diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index 67f04ec44af2..c99d59d8ef2e 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c @@ -1234,8 +1234,10 @@ static unsigned int powernowk8_get (unsigned int cpu) ...
232e8884cb62f865d69383e42ef333215da504d4
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] fix configuration help message
Problem Details: cpufreq support can't be built as a module. Fix the related configuration help message. Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it> Signed-off-by: Dave Jones <davej@redhat.com>
```diff diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig index 721f86f4f008..c159ae64eeb2 100644 --- a/drivers/cpufreq/Kconfig +++ b/drivers/cpufreq/Kconfig @@ -9,9 +9,6 @@ config CPU_FREQ clock speed, you need to either enable a dynamic cpufreq governor (see below) after boot, or use a userspace ...
9e76988e9390a4ff4d171f690586d0c58186b47e
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] Eliminate cpufreq_userspace scaling_setspeed deadlock
Problem Details: Eliminate cpufreq_userspace scaling_setspeed deadlock. Luming Yu recently uncovered yet another cpufreq related deadlock. One thread that continuously switches the governors and the other thread that repeatedly cats the contents of cpufreq directory causes both these threads to go into a deadlock. De...
```diff diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 613314851ecc..64926aa990db 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -601,6 +601,31 @@ static ssize_t show_affected_cpus (struct cpufreq_policy * policy, char *buf) return i; } +static ssize_t store_sca...
b25e75899e449456409cfa1a3b042257c03d4355
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] gx-suspmod.c: use boot_cpu_data instead of current_cpu_data
Problem Details: In preemptible kernel will report BUG: using smp_processor_id() in preemptible, so use boot_cpu_data instead of current_cpu_data. discussion in : http://lkml.org/lkml/2007/7/25/32 Signed-off-by: Dave Young <hidave.darkstar@gmail.com> CC: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-fo...
```diff diff --git a/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c b/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c index 2ed7db2fd257..9d9eae82e60f 100644 --- a/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c +++ b/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c @@ -181,8 +181,8 @@ static __init struct pci_dev *gx_detect_chipset(void) struc...
e32d22f77666312648735f7cda0a114a8242b9d8
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] fix incorrect comment on show_available_freqs() in freq_table.c
Problem Details: In freq_table.c, show_available_freqs()'s comment is oberviously wrong. Change the comment to a new one to avoid confusion. Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
```diff diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c index 5409f3afb3f8..ae6cd60d5c14 100644 --- a/drivers/cpufreq/freq_table.c +++ b/drivers/cpufreq/freq_table.c @@ -171,7 +171,7 @@ EXPORT_SYMBOL_GPL(cpufreq_frequency_table_target); static struct cpufreq_frequency_table *show_table[NR_CP...
e8318d98e95ddd3969c0701b5d15ec961ce786b2
Analyze and fix the following issue in the Linux kernel code: [POWERPC] 4xx: PCIe indirect DCR spinlock fix.
Problem Details: Since we have mfdcri() and mtdcri() as macros, we can't use constructions, such as "mtdcri(base, reg, mfdcri(base, reg) | val)". In this case the mfdcri() stuff is not evaluated first. It's evaluated inside the mtdcri() macro and we have the dcr_ind_lock spinlock acquired twice. To avoid this error,...
```diff diff --git a/include/asm-powerpc/dcr-native.h b/include/asm-powerpc/dcr-native.h index af5fb31af559..be6c879e8760 100644 --- a/include/asm-powerpc/dcr-native.h +++ b/include/asm-powerpc/dcr-native.h @@ -59,25 +59,36 @@ do { \ /* R/W of indirect DCRs make use of standard naming conventions for DCRs */ e...
c41f4af8fef6ef5bec7c9d2335ba19636058d2a7
Analyze and fix the following issue in the Linux kernel code: [POWERPC] 4xx: Fix offset value on Warp board
Problem Details: While merging, I found a small bug that I forgot to send. I add an offset to a value twice. Signed-off-by: Sean MacLennan <smaclennan@pikatech.com> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
```diff diff --git a/arch/powerpc/platforms/44x/warp.c b/arch/powerpc/platforms/44x/warp.c index 8f01563dbd2a..da5b7b7599db 100644 --- a/arch/powerpc/platforms/44x/warp.c +++ b/arch/powerpc/platforms/44x/warp.c @@ -137,7 +137,7 @@ static int __init pika_dtm_start(void) } of_node_put(np); - fpga = ioremap(res.star...
fde9d16faee27907852b59e7c0cd0741975c37eb
Analyze and fix the following issue in the Linux kernel code: [POWERPC] 4xx: Fix Walnut build
Problem Details: The addition of of_rtc for the Walnut board was only half complete. Select OF_RTC in the Kconfig and include the appropriate header to make it compile. Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
```diff diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig index 74f31177e47a..a9260e21451e 100644 --- a/arch/powerpc/platforms/40x/Kconfig +++ b/arch/powerpc/platforms/40x/Kconfig @@ -72,6 +72,7 @@ config WALNUT default y select 405GP select PCI + select OF_RTC help This o...
a869981423b96045c49420a6884c72528836cea8
Analyze and fix the following issue in the Linux kernel code: [SCTP]: Fix kernel panic while received ASCONF chunk with bad serial number
Problem Details: While recevied ASCONF chunk with serial number less then needed, kernel will treat this chunk as a retransmitted ASCONF chunk and find cached ASCONF-ACK chunk used sctp_assoc_lookup_asconf_ack(). But this function will always return NO-NULL. So response with cached ASCONF-ACKs chunk will cause kernel p...
```diff diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 13931a91f667..d29f792e0529 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c @@ -1525,7 +1525,7 @@ struct sctp_chunk *sctp_assoc_lookup_asconf_ack( const struct sctp_association *asoc, __be32 serial) { - struct sctp_chunk *ac...
727674435470537a5e75e5f81f96d5d97de57956
Analyze and fix the following issue in the Linux kernel code: 9p: fix p9_printfcall export
Problem Details: ERROR: "p9_printfcall" [net/9p/9pnet_virtio.ko] undefined! Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Eric Van Hensbergen <ericvh@gmail.com>
```diff diff --git a/net/9p/fcprint.c b/net/9p/fcprint.c index b1ae8ec57d54..40244fbd9b0d 100644 --- a/net/9p/fcprint.c +++ b/net/9p/fcprint.c @@ -347,12 +347,12 @@ p9_printfcall(char *buf, int buflen, struct p9_fcall *fc, int extended) return ret; } - #else int p9_printfcall(char *buf, int buflen, struct p9_fc...
dea7bbb603735ceceb07bb370eca17198faf7c8d
Analyze and fix the following issue in the Linux kernel code: 9p: Convert semaphore to spinlock for p9_idpool
Problem Details: When booting from v9fs, down_interruptible in p9_idpool_get() triggered a BUG as it was being called with IRQs disabled. A spinlock seems like the right thing to be using since the idr functions go out of their way not to sleep. This patch eliminates the BUG by converting the semaphore to a spinlock....
```diff diff --git a/net/9p/util.c b/net/9p/util.c index 22077b79395d..ef7215565d88 100644 --- a/net/9p/util.c +++ b/net/9p/util.c @@ -33,7 +33,7 @@ #include <net/9p/9p.h> struct p9_idpool { - struct semaphore lock; + spinlock_t lock; struct idr pool; }; @@ -45,7 +45,7 @@ struct p9_idpool *p9_idpool_create(voi...
14b8869ff4f00f105ea76678997b4d49d27baae3
Analyze and fix the following issue in the Linux kernel code: 9p: fix mmap to be read-only
Problem Details: v9fs was allowing writable mmap which could lead to kernel BUG() cases. This sets the mmap function to generic_file_readonly_mmap which (correctly) returns an error to applications which open mmap for writing. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
```diff diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index ba4b1caa9c43..a616fff8906d 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -184,7 +184,7 @@ static const struct file_operations v9fs_cached_file_operations = { .open = v9fs_file_open, .release = v9fs_dir_release, .lock = v9fs_file_lock, - .mma...
7c7d90f2dda6daec5a6aaf8f97aacc10ee4deb77
Analyze and fix the following issue in the Linux kernel code: 9p: Fix soft lockup in virtio transport
Problem Details: This fixes a poorly placed spinlock which could result in a soft lockup condition. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
```diff diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 0f590227943b..7853c31bd690 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -232,7 +232,6 @@ p9_virtio_rpc(struct p9_trans *t, struct p9_fcall *tc, struct p9_fcall **rc, rdata = (char *)*rc+sizeof(struct p9_fcall); - spin_lo...
c55703d807a8c6c239a5fea7b9cd7da08c27d7a9
Analyze and fix the following issue in the Linux kernel code: 9p: fix bug in attach-per-user
Problem Details: When a new user attached at a directory other than the root, he would end up in the parent directory of the cwd. This was due to a logic error in the code which attaches the user at the mount point and walks back to the cwd. This patch fixes that. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com...
```diff diff --git a/fs/9p/fid.c b/fs/9p/fid.c index b364da70ff28..dfebdbe7440e 100644 --- a/fs/9p/fid.c +++ b/fs/9p/fid.c @@ -175,7 +175,7 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry) if (!wnames) return ERR_PTR(-ENOMEM); - for (d = dentry, i = n; i >= 0; i--, d = d->d_parent) + for (d = dentry, i =...
afcf0c13aeac04a39fa4d1eafdb75604b81af860
Analyze and fix the following issue in the Linux kernel code: 9p: fix bug in p9_clone_stat
Problem Details: This patch fixes a bug in the copying of 9P stat information where string references weren't being updated properly. Signed-off-by: Martin Sava <martin.stava@gmail.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
```diff diff --git a/net/9p/client.c b/net/9p/client.c index af9199364049..069d9aa14205 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -901,16 +901,21 @@ static struct p9_stat *p9_clone_stat(struct p9_stat *st, int dotu) memmove(ret, st, sizeof(struct p9_stat)); p = ((char *) ret) + sizeof(struct p9_stat); ...
a80a438bd08827d0581fca849f3e4e539a22b39c
Analyze and fix the following issue in the Linux kernel code: docbook: dmapool: fix fatal changed filename
Problem Details: Docbook fatal error, file was moved: docproc: linux-2.6.24-git15/drivers/base/dmapool.c: No such file or directory Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl index 77436d735013..059aaf20951a 100644 --- a/Documentation/DocBook/kernel-api.tmpl +++ b/Documentation/DocBook/kernel-api.tmpl @@ -165,6 +165,7 @@ X!Ilib/string.c !Emm/vmalloc.c !Imm/page_alloc.c !Emm/mempool.c +!Emm/...
7dbb922cea70897dd0e76c6cf8a300b061ca2531
Analyze and fix the following issue in the Linux kernel code: [POWERPC] Fix compilation for CONFIG_DEBUGGER=n and CONFIG_KEXEC=y
Problem Details: Looks like "[POWERPC] kdump shutdown hook support" broke builds when CONFIG_DEBUGGER=n and CONFIG_KEXEC=y, such as in g5_defconfig: arch/powerpc/kernel/crash.c: In function 'default_machine_crash_shutdown': arch/powerpc/kernel/crash.c:388: error: '__debugger_fault_handler' undeclared (first use in thi...
```diff diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 848a20475db8..4b5b7ff4f78b 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -54,7 +54,7 @@ #endif #include <asm/kexec.h> -#ifdef CONFIG_DEBUGGER +#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC) i...
58d5d0d8dd52cbca988af24b5692a20b00285543
Analyze and fix the following issue in the Linux kernel code: x86: fix deadlock, make pgd_lock irq-safe
Problem Details: lockdep just caught this one: ================================= [ INFO: inconsistent lock state ] 2.6.24 #38 --------------------------------- inconsistent {in-softirq-W} -> {softirq-on-W} usage. swapper/1 [HC0[0]:SC0[0]:HE1:SE1] takes: (pgd_lock){-+..}, at: [<ffffffff8022a9ea>] mm_init+0x1da/0x250 {...
```diff diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index d8ed4006b3d2..621afb6343dc 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -958,11 +958,12 @@ void vmalloc_sync_all(void) for (address = start; address <= VMALLOC_END; address += PGDIR_SIZE) { if (!test_bit(pgd_index(address), insyn...
a09771bef9a375091f8ae706d992e20970e5d1e7
Analyze and fix the following issue in the Linux kernel code: virtio: fix trivial build bug
Problem Details: fix build bug: drivers/virtio/virtio_balloon.c: In function 'fill_balloon': drivers/virtio/virtio_balloon.c:98: error: implicit declaration of function 'msleep' Acked-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 622aece1acce..c8a4332d1132 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -23,6 +23,7 @@ #include <linux/swap.h> #include <linux/kthread.h> #include <linux/freezer.h> +#include <linux/d...
20651af9ac60fd6e31360688ad44861a7d05256a
Analyze and fix the following issue in the Linux kernel code: x86: fix mttr trimming
Problem Details: Pavel Emelyanov reported that his networking card did not work and bisected it down to: " The commit 093af8d7f0ba3c6be1485973508584ef081e9f93 x86_32: trim memory by updating e820 broke my e1000 card: on loading driver says that e1000: probe of 0000:04:03.0 failed with error -5 and the interf...
```diff diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c index 1e27b69a7a0e..b6e136f23d3d 100644 --- a/arch/x86/kernel/cpu/mtrr/main.c +++ b/arch/x86/kernel/cpu/mtrr/main.c @@ -659,7 +659,7 @@ static __init int amd_special_default_mtrr(void) */ int __init mtrr_trim_uncached_memory(unsig...
971a52d66a3e87d4d2f5d3455e62680447cdb8e9
Analyze and fix the following issue in the Linux kernel code: x86: delay CPA self-test and repeat it
Problem Details: delay the CPA self-test so that any impact (corruption) of user-space pagetables can be triggered. Repeat the test every 30 seconds. this would have prevented the bug fixed by 8cb2a7c1e95e472b5, at its source. Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 2e1e3af28c3a..fa555148823d 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -220,9 +220,9 @@ config DEBUG_BOOT_PARAMS This option will cause struct boot_params to be exported via debugfs. config CPA_DEBUG - bool "CPA se...
f1fbabb312d657262322f4ce68b30a95f501945c
Analyze and fix the following issue in the Linux kernel code: x86: fix 64-bit sections
Problem Details: fix 64-bit section warnings. Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index 4f283ad215ec..09b38d539b09 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S @@ -250,18 +250,13 @@ ENTRY(secondary_startup_64) lretq /* SMP bootup changes these two */ -#ifndef CONFIG_HOTPLUG_CPU - .pushsection ....
a57dae3aa4d00a000b5bac4238025438204c78b2
Analyze and fix the following issue in the Linux kernel code: x86: fix iret exception recovery on 64-bit
Problem Details: This change broke recovery of exceptions in iret: commit 72fe4858544292ad64600765cb78bc02298c6b1c Author: Glauber de Oliveira Costa <gcosta@redhat.com> x86: replace privileged instructions with paravirt macros The ENTRY(native_iret) macro adds alignment padding before the iretq instruct...
```diff diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index e518928114db..c7341e81941c 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S @@ -582,7 +582,6 @@ retint_restore_args: /* return to kernel space */ TRACE_IRQS_IRETQ restore_args: RESTORE_ARGS 0,8,0 -iret_...
b5556a67f08559b6c1597f6396c1f9ef460f62b4
Analyze and fix the following issue in the Linux kernel code: cpuidle: dubious one-bit signed bitfield in cpuidle.h
Problem Details: fix these sparse warnings: CHECK arch/x86/kernel/acpi/cstate.c include/linux/cpuidle.h:82:17: error: dubious one-bit signed bitfield CHECK arch/x86/kernel/acpi/processor.c include/linux/cpuidle.h:82:17: error: dubious one-bit signed bitfield CHECK arch/x86/kernel/cpu/cpufreq/powernow-k7.c ...
```diff diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index c4e00161a247..b0fd85ab9efb 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -79,7 +79,7 @@ struct cpuidle_state_kobj { }; struct cpuidle_device { - int enabled:1; + unsigned int enabled:1; unsigned int cpu; i...
d7ac12fa05ed839d5a426795409fdf1a480e3f7a
Analyze and fix the following issue in the Linux kernel code: x86: fix sparse warnings in powernow-k8.c
Problem Details: arch/x86/kernel/cpu/cpufreq/powernow-k8.c:830:7: warning: symbol 'hi' shadows an earlier one arch/x86/kernel/cpu/cpufreq/powernow-k8.c:824:6: originally declared here arch/x86/kernel/cpu/cpufreq/powernow-k8.c:830:15: warning: symbol 'lo' shadows an earlier one arch/x86/kernel/cpu/cpufreq/powernow-k8.c:...
```diff diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index a0522735dd9d..5affe91ca1e5 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c @@ -827,7 +827,6 @@ static int fill_powernow_table_pstate(struct powernow_k8_...
deef79ef351225a9fe02e41a40cb125ed03a3e6b
Analyze and fix the following issue in the Linux kernel code: x86: fix sparse error in traps_32.c
Problem Details: This was being used to ensure the proper alignment of the FXSAVE/FXRSTOR data. This would create a sparse error in the _correct_ cases, hiding further warnings. Use BUILD_BUG_ON instead. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Sig...
```diff diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c index 3cf72977d012..b22c01e05a18 100644 --- a/arch/x86/kernel/traps_32.c +++ b/arch/x86/kernel/traps_32.c @@ -1176,17 +1176,12 @@ void __init trap_init(void) #endif set_trap_gate(19,&simd_coprocessor_error); + /* + * Verify that the FXSA...
c63855d04034c96db791a7217954c93aa66d24cb
Analyze and fix the following issue in the Linux kernel code: x86 ptrace: disallow null cs/ss
Problem Details: In my revamp of the x86 ptrace code for setting register values, I accidentally omitted a check that was there in the old code. Allowing %cs to be 0 causes a bad crash in recovery from iret failure. This patch fixes that regression against 2.6.24, and adds a comment that should help prevent this subtle...
```diff diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 96286df1bb81..702c33efea84 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c @@ -103,9 +103,26 @@ static int set_segment_reg(struct task_struct *task, if (invalid_selector(value)) return -EIO; - if (offset != offset...
2d684cd6d9cf0c6a0e28978362671b6e2d8fb56c
Analyze and fix the following issue in the Linux kernel code: x86: remove X2 workaround
Problem Details: With the spurious handler fix, the X2 does not lock up anymore. Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 16ce841f08d6..c870424aa9ad 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -260,17 +260,6 @@ try_preserve_large_page(pte_t *kpte, unsigned long address, pgprot_t old_prot, new_prot; int level, do_split = 1; - /* - * An...
3aa4b37d3e899cfe7a9cbdcda2b277df4c1f210d
Analyze and fix the following issue in the Linux kernel code: x86: make traps on entry code be debuggable in user space, 64-bit
Problem Details: Unify the x86-64 behavior for 32-bit processes that set bogus %cs/%ss values (the only ones that can fault in iret) match what the native i386 behavior is. (do not kill the task via do_exit but generate a SIGSEGV signal) [ tglx@linutronix.de: build fix ] Signed-off-by: Roland McGrath <roland@redhat.c...
```diff diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index bea8474744ff..e518928114db 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S @@ -593,13 +593,22 @@ ENTRY(native_iret) .quad native_iret, bad_iret .previous .section .fixup,"ax" - /* force a signal here? this ...
55850f47333c6e7d932e6426eaed863b27c9cd7f
Analyze and fix the following issue in the Linux kernel code: fb: fix warning: no return statement in function returning non-void
Problem Details: Warning is reproducible with selected FB_CFB_REV_PIXELS_IN_BYTE. CC drivers/video/sysfillrect.o In file included from drivers/video/sysfillrect.c:18: drivers/video/fb_draw.h: In function `fb_rev_pixels_in_long': drivers/video/fb_draw.h:94: warning: no return statement in function returning non-...
```diff diff --git a/drivers/video/fb_draw.h b/drivers/video/fb_draw.h index cdafbe14ef1f..a2a0618d86a5 100644 --- a/drivers/video/fb_draw.h +++ b/drivers/video/fb_draw.h @@ -91,6 +91,7 @@ static inline unsigned long fb_rev_pixels_in_long(unsigned long val, val = comp(val >> 2, val << 2, REV_PIXELS_MASK2); if (bsw...
6659a0f0bb7481d0f94ca3f203a4e1e406a9694d
Analyze and fix the following issue in the Linux kernel code: virtio: add missing #include <linux/delay.h>
Problem Details: Include linux/delay.h to fix compiler error: drivers/virtio/virtio_balloon.c: In function 'fill_balloon': drivers/virtio/virtio_balloon.c:98: error: implicit declaration of function 'msleep' Signed-off-by: Johann Felix Soden <johfel@users.sourceforge.net> Cc: Rusty Russell <rusty@rustcorp.com.au> Sig...
```diff diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 622aece1acce..c8a4332d1132 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -23,6 +23,7 @@ #include <linux/swap.h> #include <linux/kthread.h> #include <linux/freezer.h> +#include <linux/d...
bd1939de9061dbc5cac44ffb4425aaf4c9b894f1
Analyze and fix the following issue in the Linux kernel code: ext3: fix lock inversion in direct IO
Problem Details: We cannot start transaction in ext3_direct_IO() and just let it last during the whole write because dio_get_page() acquires mmap_sem which ranks above transaction start (e.g. because we have dependency chain mmap_sem->PageLock->journal_start, or because we update atime while holding mmap_sem) and thus...
```diff diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index a4f2d673d382..8a9ce2d09bde 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c @@ -939,55 +939,45 @@ out: return err; } -#define DIO_CREDITS (EXT3_RESERVE_TRANS_BLOCKS + 32) +/* Maximum number of blocks we map for direct IO at once. */ +#define DIO_MAX_BL...
fb01bfdac733f1925561eea52c60072f2fbcdc97
Analyze and fix the following issue in the Linux kernel code: ext[234]: remove unused argument for ext[234]_find_goal()
Problem Details: The argument chain for ext[234]_find_goal() is not used. This patch removes it and fixes comment as well. Cc: <linux-ext4@vger.kernel.org> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-founda...
```diff diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 7a1fcc9fde92..03978ec2a91c 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -286,15 +286,12 @@ static unsigned long ext2_find_near(struct inode *inode, Indirect *ind) * ext2_find_goal - find a prefered place for allocation. * @inode: owner * @block...
144704e5227362cbd694b0b3c3aa4ac99a0115c9
Analyze and fix the following issue in the Linux kernel code: ext[234]: fix comment for nonexistent variable
Problem Details: The comment in ext[234]_new_blocks() describes about "i". But there is no local variable called "i" in that scope. I guess it has been renamed to group_no. Cc: <linux-ext4@vger.kernel.org> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> S...
```diff diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index a51bdf82450f..f86207b345a9 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c @@ -1315,8 +1315,8 @@ retry_alloc: smp_rmb(); /* - * Now search the rest of the groups. We assume that - * i and gdp correctly point to the last group visited. + * No...
feda58d37ae0efe22e711a74e26fb541d4eb1baa
Analyze and fix the following issue in the Linux kernel code: ext3: return after ext3_error in case of failures
Problem Details: This fixes some instances where we were continuing after calling ext3_error. ext3_error calls panic only if errors=panic mount option is set. So we need to make sure we return correctly after ext3_error call Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: <linux-ext4@vger.kerne...
```diff diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c index a26e683780be..d2dface9a423 100644 --- a/fs/ext3/balloc.c +++ b/fs/ext3/balloc.c @@ -530,11 +530,13 @@ do_more: in_range (block, le32_to_cpu(desc->bg_inode_table), sbi->s_itb_per_group) || in_range (block + count - 1, le32_to_cpu(desc->b...
445a1d3e24b806bff01e422f0ddadf68e0eb5d0f
Analyze and fix the following issue in the Linux kernel code: PNP: disable Supermicro H8DCE motherboard resources that overlap SATA BARs
Problem Details: Some Supermicro BIOSes describe a SATA PCI BAR as a motherboard resource. The PNP system driver claims motherboard resources, and this prevents the sata_nv driver from requesting it later. This patch disables the PNP0C01/PNP0C02 resources so they won't be claimed by the PNP system driver, so they'll a...
```diff diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c index e903b8c2b1fa..4065139753b6 100644 --- a/drivers/pnp/quirks.c +++ b/drivers/pnp/quirks.c @@ -17,6 +17,7 @@ #include <linux/slab.h> #include <linux/pnp.h> #include <linux/io.h> +#include <linux/dmi.h> #include <linux/kallsyms.h> #include "base.h"...