Merge branch 'rawhide/user/kyle/kernel-git' into rawhide/user/myoung/xendom0

Conflicts:
	kernel.spec
This commit is contained in:
Michael Young 2010-12-02 14:14:04 +00:00
commit 9e46bf6efa
10 changed files with 1934 additions and 44 deletions

6
.gitignore vendored
View File

@ -3,7 +3,5 @@ patch-*.bz2
clog
*.rpm
kernel-2.6.*/
/patch-2.6.37-rc2.bz2
/patch-2.6.37-rc2-git5.bz2
/patch-2.6.37-rc2-git7.bz2
/patch-2.6.37-rc3.bz2
/patch-2.6.37-rc4.bz2
/patch-2.6.37-rc4-git1.bz2

View File

@ -3810,7 +3810,8 @@ CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_SCHED=y
CONFIG_CGROUP_MEM_RES_CTLR=y
CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y # XXX disabled by default, pass 'swapaccount'
# CONFIG_CGROUP_MEM_RES_CTLR_SWAP_ENABLED is not set
CONFIG_BLK_CGROUP=y
# CONFIG_DEBUG_BLK_CGROUP is not set

View File

@ -0,0 +1,17 @@
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 878f6d6..8d6867d 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1329,7 +1330,11 @@ static int tty_reopen(struct tty_struct *tty)
tty->driver = driver; /* N.B. why do this every time?? */
mutex_lock(&tty->ldisc_mutex);
- WARN_ON(!test_bit(TTY_LDISC, &tty->flags));
+ if (!test_bit(TTY_LDISC, &tty->flags)) {
+ printk("%s: !test_bit(TTY_LDISC, &tty->flags) dev=%s ldisc=%s flags=%x\n",
+ __func__, tty->name, tty->ldisc ? tty->ldisc->ops ? tty->ldisc->ops->name : NULL : NULL, tty->flags);
+ WARN_ON(1);
+ }
mutex_unlock(&tty->ldisc_mutex);
return 0;

1612
drm-fixes.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -83,9 +83,9 @@ Summary: The Linux kernel
# The next upstream release sublevel (base_sublevel+1)
%define upstream_sublevel %(echo $((%{base_sublevel} + 1)))
# The rc snapshot level
%define rcrev 3
%define rcrev 4
# The git snapshot level
%define gitrev 0
%define gitrev 1
# Set rpm version accordingly
%define rpmversion 2.6.%{upstream_sublevel}
%endif
@ -650,6 +650,7 @@ Patch1555: fix_xen_guest_on_old_EC2.patch
# DRM
# nouveau + drm fixes
Patch1801: drm-fixes.patch
Patch1810: drm-nouveau-updates.patch
Patch1819: drm-intel-big-hammer.patch
# intel drm is all merged upstream
@ -701,6 +702,11 @@ Patch12205: runtime_pm_fixups.patch
Patch12303: dmar-disable-when-ricoh-multifunction.patch
Patch12400: tty-dont-allow-reopen-when-ldisc-is-changing.patch
Patch12401: debug-tty-print-dev-name.patch
Patch12402: tty-ldisc-fix-open-flag-handling.patch
Patch12403: tty-open-hangup-race-fixup.patch
# Xen patches
# git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git branches
Patch20000: xen.next-2.6.37.patch
@ -1182,7 +1188,7 @@ ApplyPatch acpi-update-battery-information-on-notification-0x81.patch
ApplyPatch linux-2.6-debug-sizeof-structs.patch
ApplyPatch linux-2.6-debug-nmi-timeout.patch
ApplyPatch linux-2.6-debug-taint-vm.patch
###FIX###ApplyPatch linux-2.6-debug-vm-would-have-oomkilled.patch
ApplyPatch linux-2.6-debug-vm-would-have-oomkilled.patch
ApplyPatch linux-2.6-debug-always-inline-kzalloc.patch
#
@ -1248,6 +1254,7 @@ ApplyPatch linux-2.6-e1000-ich9-montevina.patch
ApplyPatch fix_xen_guest_on_old_EC2.patch
# DRM core
ApplyPatch drm-fixes.patch
# Nouveau DRM
ApplyOptionalPatch drm-nouveau-updates.patch
@ -1298,6 +1305,12 @@ ApplyPatch runtime_pm_fixups.patch
# rhbz#605888
ApplyPatch dmar-disable-when-ricoh-multifunction.patch
# rhbz#630464
ApplyPatch tty-dont-allow-reopen-when-ldisc-is-changing.patch
ApplyPatch debug-tty-print-dev-name.patch
ApplyPatch tty-ldisc-fix-open-flag-handling.patch
ApplyPatch tty-open-hangup-race-fixup.patch
# Xen patches
ApplyPatch xen.next-2.6.37.patch
#ApplyPatch xen.upstream.core.patch
@ -1916,6 +1929,38 @@ fi
# || ||
%changelog
* Wed Dec 01 2010 Kyle McMartin <kyle@redhat.com> 2.6.37-0.rc4.git1.1
- Linux 2.6.37-rc4-git1
- Pull in DRM fixes that are queued for -rc5 [3074adc8]
+ edp-fixes on top
* Tue Nov 30 2010 Kyle McMartin <kyle@redhat.com> 2.6.37-0.rc4.git0.1
- Linux 2.6.37-rc4
* Mon Nov 29 2010 Kyle McMartin <kyle@redhat.com>
- Update debug-vm-would_have_oomkilled patch.
* Mon Nov 29 2010 Kyle McMartin <kyle@redhat.com> 2.6.37-0.rc3.git6.1
- Linux 2.6.37-rc3-git6
- TTY: open/hangup race fixup (rhbz#630464)
* Fri Nov 26 2010 Kyle McMartin <kyle@redhat.com> 2.6.37-0.rc3.git3.1
- Linux 2.6.37-rc3-git3
- Print tty->flags as well in debugging patch...
* Fri Nov 26 2010 Kyle McMartin <kyle@redhat.com>
- Copy tty_open WARN_ON debugging patch from rawhide.
* Fri Nov 26 2010 Kyle McMartin <kyle@redhat.com> 2.6.37-0.rc3.git2.1
- Linux 2.6.37-rc3-git2
- CGROUP_MEM_RES_CTLR_SWAP_ENABLED is not set, so the cgroup memory
resource controller swap accounting is disabled by default. You can
enable it with 'swapaccount' if desired.
- TTY: don't allow reopen when ldisc is changing (rhbz#630464)
* Wed Nov 24 2010 Kyle McMartin <kyle@redhat.com> 2.6.37-0.rc3.git1.1
- Linux 2.6.37-rc3-git1
* Mon Nov 22 2010 Michael Young <m.a.young@durham.ac.uk>
- Update the xen/next-2.6.37 patch and rebuild for rc3

View File

@ -1,26 +1,30 @@
From 03657519851cd180983db4bd0c38eaeed4aa2962 Mon Sep 17 00:00:00 2001
From: Kyle McMartin <kyle@treachery.i.jkkm.org>
Date: Mon, 11 Jan 2010 08:25:12 -0500
Subject: linux-2.6-debug-vm-would-have-oomkilled.patch
From beb764ac03e52eba1a654afb4273fab1f9de3cff Mon Sep 17 00:00:00 2001
From: Kyle McMartin <kyle@mcmartin.ca>
Date: Mon, 29 Nov 2010 20:59:14 -0500
Subject: [PATCH] linux-2.6-debug-vm-would_have_oomkilled
---
kernel/sysctl.c | 8 ++++++++
mm/oom_kill.c | 7 +++++++
2 files changed, 15 insertions(+), 0 deletions(-)
include/linux/oom.h | 1 +
kernel/sysctl.c | 7 +++++++
mm/oom_kill.c | 8 ++++++++
3 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/include/linux/oom.h b/include/linux/oom.h
index 5e3aa83..79a27b4 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -72,5 +72,6 @@ extern struct task_struct *find_lock_task_mm(struct task_struct *p);
extern int sysctl_oom_dump_tasks;
extern int sysctl_oom_kill_allocating_task;
extern int sysctl_panic_on_oom;
+extern int sysctl_would_have_oomkilled;
#endif /* __KERNEL__*/
#endif /* _INCLUDE_LINUX_OOM_H */
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 8a68b24..72a4ff1 100644
index 5abfa15..a0fed6d 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -71,6 +71,7 @@ extern int sysctl_overcommit_ratio;
extern int sysctl_panic_on_oom;
extern int sysctl_oom_kill_allocating_task;
extern int sysctl_oom_dump_tasks;
+extern int sysctl_would_have_oomkilled;
extern int max_threads;
extern int core_uses_pid;
extern int suid_dumpable;
@@ -973,6 +974,13 @@ static struct ctl_table vm_table[] = {
@@ -1000,6 +1000,13 @@ static struct ctl_table vm_table[] = {
.proc_handler = proc_dointvec,
},
{
@ -28,37 +32,38 @@ index 8a68b24..72a4ff1 100644
+ .data = &sysctl_would_have_oomkilled,
+ .maxlen = sizeof(sysctl_would_have_oomkilled),
+ .mode = 0644,
+ .proc_handler = &proc_dointvec,
+ .proc_handler = proc_dointvec,
+ },
+ {
.procname = "overcommit_ratio",
.data = &sysctl_overcommit_ratio,
.maxlen = sizeof(sysctl_overcommit_ratio),
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index f52481b..a892f07 100644
index 7dcca55..281ac39 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -31,6 +31,7 @@
@@ -35,6 +35,7 @@
int sysctl_panic_on_oom;
int sysctl_oom_kill_allocating_task;
int sysctl_oom_dump_tasks;
int sysctl_oom_dump_tasks = 1;
+int sysctl_would_have_oomkilled;
static DEFINE_SPINLOCK(zone_scan_lock);
/* #define DEBUG */
@@ -396,6 +397,12 @@ static void __oom_kill_task(struct task_struct *p, int verbose)
return;
#ifdef CONFIG_NUMA
@@ -477,6 +478,13 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
}
+ if (sysctl_would_have_oomkilled == 1) {
+ printk(KERN_ERR "Would have killed process %d (%s). But continuing instead.\n",
+ task_pid_nr(p), p->comm);
+ return;
task_lock(p);
+ if (sysctl_would_have_oomkilled) {
+ printk(KERN_ERR "%s: would have killed process %d (%s), but continuing instead...\n",
+ __func__, task_pid_nr(p), p->comm);
+ task_unlock(p);
+ return 0;
+ }
+
if (verbose)
printk(KERN_ERR "Killed process %d (%s) "
"vsz:%lukB, anon-rss:%lukB, file-rss:%lukB\n",
pr_err("%s: Kill process %d (%s) score %d or sacrifice child\n",
message, task_pid_nr(p), p->comm, points);
task_unlock(p);
--
1.6.5.2
1.7.3.2

View File

@ -1,5 +1,3 @@
61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2
279da99f02bd89e85b1ae5f68f852c0e patch-2.6.37-rc2.bz2
7645b1df8d5741e87c32a9994a14c336 patch-2.6.37-rc2-git5.bz2
5b9f94c8cdc478788fdcdf4eb16cbbcb patch-2.6.37-rc2-git7.bz2
9a487f01d20f9ee6917395a4c3de8ea7 patch-2.6.37-rc3.bz2
854ca0c7eca8930a71a6382a7dabbf65 patch-2.6.37-rc4.bz2
c3146fe28bb10e77d8388bc26e16483c patch-2.6.37-rc4-git1.bz2

View File

@ -0,0 +1,84 @@
From jirislaby@gmail.com Thu Nov 25 12:16:42 2010
From: Jiri Slaby <jslaby@suse.cz>
Subject: [PATCH 1/1] TTY: don't allow reopen when ldisc is changing
Date: Thu, 25 Nov 2010 18:16:23 +0100
There are many WARNINGs like the following reported nowadays:
WARNING: at drivers/tty/tty_io.c:1331 tty_open+0x2a2/0x49a()
Hardware name: Latitude E6500
Modules linked in:
Pid: 1207, comm: plymouthd Not tainted 2.6.37-rc3-mmotm1123 #3
Call Trace:
[<ffffffff8103b189>] warn_slowpath_common+0x80/0x98
[<ffffffff8103b1b6>] warn_slowpath_null+0x15/0x17
[<ffffffff8128a3ab>] tty_open+0x2a2/0x49a
[<ffffffff810fd53f>] chrdev_open+0x11d/0x146
...
This means tty_reopen is called without TTY_LDISC set. For further
considerations, note tty_lock is held in tty_open. TTY_LDISC is cleared in:
1) __tty_hangup from tty_ldisc_hangup to tty_ldisc_enable. During this
section tty_lock is held.
2) tty_release via tty_ldisc_release till the end of tty existence. If
tty->count <= 1, tty_lock is taken, TTY_CLOSING bit set and then
tty_ldisc_release called. tty_reopen checks TTY_CLOSING before checking
TTY_LDISC.
3) tty_set_ldisc from tty_ldisc_halt to tty_ldisc_enable. We:
* take tty_lock, set TTY_LDISC_CHANGING, put tty_lock
* call tty_ldisc_halt (clear TTY_LDISC), tty_lock is _not_ held
* do some other work
* take tty_lock, call tty_ldisc_enable (set TTY_LDISC), put
tty_lock
So the only option I see is 3). The solution is to check
TTY_LDISC_CHANGING along with TTY_CLOSING in tty_reopen.
Nicely reproducible with two processes:
while (1) {
fd = open("/dev/ttyS1", O_RDWR);
if (fd < 0) {
warn("open");
continue;
}
close(fd);
}
--------
while (1) {
fd = open("/dev/ttyS1", O_RDWR);
ld1 = 0; ld2 = 2;
while (1) {
ioctl(fd, TIOCSETD, &ld1);
ioctl(fd, TIOCSETD, &ld2);
}
close(fd);
}
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Reported-by: <Valdis.Kletnieks@vt.edu>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
---
drivers/tty/tty_io.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index c05c5af..878f6d6 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1310,7 +1310,8 @@ static int tty_reopen(struct tty_struct *tty)
{
struct tty_driver *driver = tty->driver;
- if (test_bit(TTY_CLOSING, &tty->flags))
+ if (test_bit(TTY_CLOSING, &tty->flags) ||
+ test_bit(TTY_LDISC_CHANGING, &tty->flags))
return -EIO;
if (driver->type == TTY_DRIVER_TYPE_PTY &&
--
1.7.3.1

View File

@ -0,0 +1,54 @@
From linux-kernel-owner@vger.kernel.org Wed Nov 24 18:28:11 2010
From: Jiri Slaby <jslaby@suse.cz>
Subject: [PATCH 1/2] TTY: ldisc, fix open flag handling
Date: Thu, 25 Nov 2010 00:27:54 +0100
When a concrete ldisc open fails in tty_ldisc_open, we forget to clear
TTY_LDISC_OPEN. This causes a false warning on the next ldisc open:
WARNING: at drivers/char/tty_ldisc.c:445 tty_ldisc_open+0x26/0x38()
Hardware name: System Product Name
Modules linked in: ...
Pid: 5251, comm: a.out Tainted: G W 2.6.32-5-686 #1
Call Trace:
[<c1030321>] ? warn_slowpath_common+0x5e/0x8a
[<c1030357>] ? warn_slowpath_null+0xa/0xc
[<c119311c>] ? tty_ldisc_open+0x26/0x38
[<c11936c5>] ? tty_set_ldisc+0x218/0x304
...
So clear the bit when failing...
Introduced in c65c9bc3efa (tty: rewrite the ldisc locking) back in
2.6.31-rc1.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Reported-by: Sergey Lapin <slapin@ossfans.org>
Tested-by: Sergey Lapin <slapin@ossfans.org>
---
drivers/tty/tty_ldisc.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index d8e96b0..4214d58 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -454,6 +454,8 @@ static int tty_ldisc_open(struct tty_struct *tty, struct tty_ldisc *ld)
/* BTM here locks versus a hangup event */
WARN_ON(!tty_locked());
ret = ld->ops->open(tty);
+ if (ret)
+ clear_bit(TTY_LDISC_OPEN, &tty->flags);
return ret;
}
return 0;
--
1.7.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

View File

@ -0,0 +1,76 @@
From 9e88e8b9915b5e067507a087437d80e6a133d612 Mon Sep 17 00:00:00 2001
From: Jiri Slaby <jslaby@suse.cz>
Date: Sat, 27 Nov 2010 16:06:46 +0100
Subject: [PATCH 1/1] TTY: open/hangup race fixup
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/tty/tty_io.c | 10 +++++++++-
include/linux/tty.h | 1 +
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 878f6d6..35480dd 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -559,6 +559,9 @@ void __tty_hangup(struct tty_struct *tty)
tty_lock();
+ /* some functions below drop BTM, so we need this bit */
+ set_bit(TTY_HUPPING, &tty->flags);
+
/* inuse_filps is protected by the single tty lock,
this really needs to change if we want to flush the
workqueue with the lock held */
@@ -578,6 +581,10 @@ void __tty_hangup(struct tty_struct *tty)
}
spin_unlock(&tty_files_lock);
+ /*
+ * it drops BTM and thus races with reopen
+ * we protect the race by TTY_HUPPING
+ */
tty_ldisc_hangup(tty);
read_lock(&tasklist_lock);
@@ -615,7 +622,6 @@ void __tty_hangup(struct tty_struct *tty)
tty->session = NULL;
tty->pgrp = NULL;
tty->ctrl_status = 0;
- set_bit(TTY_HUPPED, &tty->flags);
spin_unlock_irqrestore(&tty->ctrl_lock, flags);
/* Account for the p->signal references we killed */
@@ -641,6 +647,7 @@ void __tty_hangup(struct tty_struct *tty)
* can't yet guarantee all that.
*/
set_bit(TTY_HUPPED, &tty->flags);
+ clear_bit(TTY_HUPPING, &tty->flags);
tty_ldisc_enable(tty);
tty_unlock();
@@ -1311,6 +1318,7 @@ static int tty_reopen(struct tty_struct *tty)
struct tty_driver *driver = tty->driver;
if (test_bit(TTY_CLOSING, &tty->flags) ||
+ test_bit(TTY_HUPPING, &tty->flags) ||
test_bit(TTY_LDISC_CHANGING, &tty->flags))
return -EIO;
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 032d79f..54e4eaa 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -366,6 +366,7 @@ struct tty_file_private {
#define TTY_HUPPED 18 /* Post driver->hangup() */
#define TTY_FLUSHING 19 /* Flushing to ldisc in progress */
#define TTY_FLUSHPENDING 20 /* Queued buffer flush pending */
+#define TTY_HUPPING 21 /* ->hangup() in progress */
#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty))
--
1.7.3.1