rpms/kernel/FC-6 linux-2.6-gfs2-update.patch, 1.4, 1.5 linux-2.6-ipc-shm-fix-user-leakage.patch, NONE, 1.1 linux-2.6-libata-ata_piix_fix_pio-mwdma-programming.patch, NONE, 1.1 linux-2.6-libata_pata_atiixp_add_ati_sb700.patch, NONE, 1.1 linux-2.6-sdhci-ene-controller-quirk.patch, NONE, 1.1 linux-2.6-sdhci-fix-interrupt-mask.patch, NONE, 1.1 linux-2.6-seq_operations-leak.patch, NONE, 1.1 kernel-2.6.spec, 1.2989, 1.2990 linux-2.6-sched-cfs.patch, 1.6, 1.7

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Jul 17 19:10:59 UTC 2007


Author: cebbert

Update of /cvs/dist/rpms/kernel/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv18276

Modified Files:
	kernel-2.6.spec linux-2.6-sched-cfs.patch 
Added Files:
	linux-2.6-gfs2-update.patch 
	linux-2.6-ipc-shm-fix-user-leakage.patch 
	linux-2.6-libata-ata_piix_fix_pio-mwdma-programming.patch 
	linux-2.6-libata_pata_atiixp_add_ati_sb700.patch 
	linux-2.6-sdhci-ene-controller-quirk.patch 
	linux-2.6-sdhci-fix-interrupt-mask.patch 
	linux-2.6-seq_operations-leak.patch 
Log Message:
* Tue Jul 17 2007 Chuck Ebbert <cebbert at redhat.com>
- gfs2: update to the latest
- sched: fix show_task()/show_tasks() output
- sched: fix newly idle load balance in case of SMT
- sched: fix the all pinned logic in load_balance_newidle()
- fix leaks of struct seq_operations
- fix leaks of ref to user struct
- pata_atiixp: add SB700 PCI ID
- ata_piix: fix pio/mwdma programming
- sdhci: add ene controller id
- sdhci: Fix "Unexpected interrupt" handling


linux-2.6-gfs2-update.patch:
 a/fs/gfs2/ondisk.c               |  246 ---------------------
 b/fs/dlm/Makefile                |    1 
 b/fs/dlm/config.c                |   15 -
 b/fs/dlm/config.h                |    1 
 b/fs/dlm/debug_fs.c              |    9 
 b/fs/dlm/dlm_internal.h          |   10 
 b/fs/dlm/lock.c                  |   47 ++--
 b/fs/dlm/lock.h                  |    2 
 b/fs/dlm/lockspace.c             |    8 
 b/fs/dlm/lowcomms.c              |    9 
 b/fs/dlm/main.c                  |   11 
 b/fs/dlm/member.c                |    5 
 b/fs/dlm/netlink.c               |  155 +++++++++++++
 b/fs/dlm/rcom.c                  |    4 
 b/fs/dlm/recoverd.c              |    4 
 b/fs/dlm/user.c                  |    2 
 b/fs/gfs2/Makefile               |    2 
 b/fs/gfs2/bmap.c                 |    6 
 b/fs/gfs2/daemon.c               |   11 
 b/fs/gfs2/dir.c                  |   56 +++-
 b/fs/gfs2/dir.h                  |    9 
 b/fs/gfs2/eattr.c                |    6 
 b/fs/gfs2/glock.c                |    7 
 b/fs/gfs2/glock.h                |    1 
 b/fs/gfs2/glops.c                |    2 
 b/fs/gfs2/incore.h               |    4 
 b/fs/gfs2/inode.c                |   80 ++-----
 b/fs/gfs2/inode.h                |   18 +
 b/fs/gfs2/locking/dlm/lock.c     |   11 
 b/fs/gfs2/locking/dlm/lock_dlm.h |    2 
 b/fs/gfs2/locking/dlm/mount.c    |    2 
 b/fs/gfs2/locking/dlm/plock.c    |    2 
 b/fs/gfs2/locking/dlm/thread.c   |   11 
 b/fs/gfs2/log.c                  |    5 
 b/fs/gfs2/lops.c                 |    2 
 b/fs/gfs2/lops.h                 |   23 ++
 b/fs/gfs2/meta_io.c              |    8 
 b/fs/gfs2/meta_io.h              |    2 
 b/fs/gfs2/mount.c                |   25 +-
 b/fs/gfs2/ondisk.c               |   37 ---
 b/fs/gfs2/ops_address.c          |   29 ++
 b/fs/gfs2/ops_address.h          |    5 
 b/fs/gfs2/ops_dentry.c           |   24 --
 b/fs/gfs2/ops_export.c           |   29 +-
 b/fs/gfs2/ops_file.c             |    4 
 b/fs/gfs2/ops_fstype.c           |   16 -
 b/fs/gfs2/ops_fstype.h           |    1 
 b/fs/gfs2/ops_inode.c            |   20 -
 b/fs/gfs2/ops_super.c            |    8 
 b/fs/gfs2/ops_vm.c               |    2 
 b/fs/gfs2/quota.c                |    4 
 b/fs/gfs2/recovery.c             |   22 +
 b/fs/gfs2/rgrp.c                 |   60 ++++-
 b/fs/gfs2/rgrp.h                 |    1 
 b/fs/gfs2/super.c                |    2 
 b/fs/gfs2/super.h                |    2 
 b/fs/gfs2/util.c                 |    4 
 b/include/linux/dlm.h            |    7 
 b/include/linux/dlm_device.h     |   21 +
 b/include/linux/dlm_netlink.h    |   60 ++++-
 b/include/linux/gfs2_ondisk.h    |   11 
 fs/dlm/config.c                  |   10 
 fs/dlm/debug_fs.c                |  247 +++++++++++++++++----
 fs/dlm/dlm_internal.h            |   11 
 fs/dlm/lock.c                    |  445 ++++++++++++++++++++++++++++++---------
 fs/dlm/lock.h                    |   11 
 fs/dlm/lockspace.c               |   89 +++++--
 fs/dlm/lowcomms.c                |   18 +
 fs/dlm/member.c                  |    6 
 fs/dlm/netlink.c                 |    2 
 fs/dlm/rcom.c                    |   16 -
 fs/dlm/user.c                    |  127 ++++++++---
 fs/gfs2/bmap.c                   |   17 -
 fs/gfs2/dir.c                    |   19 -
 fs/gfs2/eattr.c                  |    8 
 fs/gfs2/glock.c                  |  120 ++++------
 fs/gfs2/incore.h                 |   77 +++++-
 fs/gfs2/inode.c                  |  244 ++++++++++++++++-----
 fs/gfs2/inode.h                  |   14 +
 fs/gfs2/locking/dlm/plock.c      |    6 
 fs/gfs2/log.c                    |  150 ++++++++++---
 fs/gfs2/lops.c                   |   69 ++----
 fs/gfs2/ondisk.c                 |   10 
 fs/gfs2/ops_address.c            |   45 +++
 fs/gfs2/ops_address.h            |    3 
 fs/gfs2/ops_export.c             |   54 ++--
 fs/gfs2/ops_export.h             |   22 -
 fs/gfs2/ops_fstype.c             |   19 -
 fs/gfs2/ops_inode.c              |   12 -
 fs/gfs2/quota.c                  |   53 ++++
 fs/gfs2/rgrp.c                   |  379 ++++++++++++++++++++++-----------
 fs/gfs2/super.c                  |   77 +++++-
 fs/gfs2/util.c                   |    2 
 include/linux/dlm.h              |    7 
 include/linux/dlm_device.h       |    1 
 include/linux/gfs2_ondisk.h      |  143 +-----------
 96 files changed, 2437 insertions(+), 1289 deletions(-)

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.4 -r 1.5 linux-2.6-gfs2-update.patch
Index: linux-2.6-gfs2-update.patch
===================================================================
RCS file: linux-2.6-gfs2-update.patch
diff -N linux-2.6-gfs2-update.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-gfs2-update.patch	17 Jul 2007 19:10:57 -0000	1.5
@@ -0,0 +1,9916 @@
+From b524fe646c9a226a847e30ca1221dc22e952f16b Mon Sep 17 00:00:00 2001
+From: Benjamin Marzinski <bmarzins at redhat.com>
+Date: Wed, 2 May 2007 09:44:03 -0500
+Subject: [PATCH] [GFS2] flush the glock completely in inode_go_sync
+
+Fix for bz #231910
+When filemap_fdatawrite() is called on the inode mapping in data=ordered mode,
+it will add the glock to the log. In inode_go_sync(), if you do the
+gfs2_log_flush() before this, after the filemap_fdatawrite() call, the glock
+and its associated data buffers will be on the log again. This means you can
+demote a lock from exclusive, without having it flushed from the log. The
+attached patch simply moves the gfs2_log_flush up to after the
+filemap_fdatawrite() call.
+
+Originally, I tried moving the gfs2_log_flush to after gfs2_meta_sync(), but
+that caused me to trip the following assert.
+
+GFS2: fsid=cypher-36:test.0: fatal: assertion "!buffer_busy(bh)" failed
+GFS2: fsid=cypher-36:test.0:   function = gfs2_ail_empty_gl, file = fs/gfs2/glops.c, line = 61
+
+It appears that gfs2_log_flush() puts some of the glocks buffers in the busy
+state and the filemap_fdatawrite() call is necessary to flush them. This makes
+me worry slightly that a related problem could happen because of moving the
+gfs2_log_flush() after the initial filemap_fdatawrite(), but I assume that
+gfs2_ail_empty_gl() would catch that case as well.
+
+Signed-off-by: Benjamin E. Marzinski <bmarzins at redhat.com>
+Signed-off-by: Steven Whitehouse <swhiteho at redhat.com>
+
+diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
+index 7b82657..777ca46 100644
+--- a/fs/gfs2/glops.c
++++ b/fs/gfs2/glops.c
+@@ -156,9 +156,9 @@ static void inode_go_sync(struct gfs2_glock *gl)
+ 		ip = NULL;
+ 
+ 	if (test_bit(GLF_DIRTY, &gl->gl_flags)) {
+-		gfs2_log_flush(gl->gl_sbd, gl);
+ 		if (ip)
+ 			filemap_fdatawrite(ip->i_inode.i_mapping);
++		gfs2_log_flush(gl->gl_sbd, gl);
+ 		gfs2_meta_sync(gl);
+ 		if (ip) {
+ 			struct address_space *mapping = ip->i_inode.i_mapping;
+-- 
+1.5.1.2
+
+From 3168b0780d06ace875696f8a648d04d6089654e5 Mon Sep 17 00:00:00 2001
+From: Satyam Sharma <ssatyam at cse.iitk.ac.in>
+Date: Tue, 8 May 2007 09:18:58 +0100
+Subject: [PATCH] [DLM] fix a couple of races
+
+Fix two races in fs/dlm/config.c:
+
+(1) Grab the configfs subsystem semaphore before calling
+config_group_find_obj() in get_space(). This solves a potential race
+between get_space() and concurrent mkdir(2) or rmdir(2).
+
+(2) Grab a reference on the found config_item _while_ holding the configfs
+subsystem semaphore in get_comm(), and not after it. This solves a
+potential race between get_comm() and concurrent rmdir(2).
+
+Signed-off-by: Satyam Sharma <ssatyam at cse.iitk.ac.in>
+Signed-off-by: David Teigland <teigland at redhat.com>
+Signed-off-by: Steven Whitehouse <swhiteho at redhat.com>
+
+diff --git a/fs/dlm/config.c b/fs/dlm/config.c
+index 822abdc..5a3d390 100644
+--- a/fs/dlm/config.c
++++ b/fs/dlm/config.c
+@@ -748,9 +748,16 @@ static ssize_t node_weight_write(struct node *nd, const char *buf, size_t len)
+ 
+ static struct space *get_space(char *name)
+ {
++	struct config_item *i;
++
+ 	if (!space_list)
+ 		return NULL;
+-	return to_space(config_group_find_obj(space_list, name));
++
++	down(&space_list->cg_subsys->su_sem);
++	i = config_group_find_obj(space_list, name);
++	up(&space_list->cg_subsys->su_sem);
++
++	return to_space(i);
+ }
+ 
+ static void put_space(struct space *sp)
+@@ -776,20 +783,20 @@ static struct comm *get_comm(int nodeid, struct sockaddr_storage *addr)
+ 			if (cm->nodeid != nodeid)
+ 				continue;
+ 			found = 1;
++			config_item_get(i);
+ 			break;
+ 		} else {
+ 			if (!cm->addr_count ||
+ 			    memcmp(cm->addr[0], addr, sizeof(*addr)))
+ 				continue;
+ 			found = 1;
++			config_item_get(i);
+ 			break;
+ 		}
+ 	}
+ 	up(&clusters_root.subsys.su_sem);
+ 
+-	if (found)
+-		config_item_get(i);
+-	else
++	if (!found)
+ 		cm = NULL;
+ 	return cm;
+ }
+-- 
+1.5.1.2
+
+From 7ae8fa8451dfb3879ecbc04f2760a707dc65b988 Mon Sep 17 00:00:00 2001
+From: Robert Peterson <rpeterso at redhat.com>
+Date: Wed, 9 May 2007 09:37:57 -0500
+Subject: [PATCH] [GFS2] kernel changes to support new gfs2_grow command
+
+This is another revision of my gfs2 kernel patch that allows
+gfs2_grow to function properly.
+
+Steve Whitehouse expressed some concerns about the previous
+patch and I restructured it based on his comments.
+The previous patch was doing the statfs_change at file close time,
+under its own transaction.  The current patch does the statfs_change
+inside the gfs2_commit_write function, which keeps it under the
+umbrella of the inode transaction.
+
+I can't call ri_update to re-read the rindex file during the
+transaction because the transaction may have outstanding unwritten
+buffers attached to the rgrps that would be otherwise blown away.
+So instead, I created a new function, gfs2_ri_total, that will
+re-read the rindex file just to total the file system space
+for the sake of the statfs_change.  The ri_update will happen
+later, when gfs2 realizes the version number has changed, as it
+happened before my patch.
+
+Since the statfs_change is happening at write_commit time and there
+may be multiple writes to the rindex file for one grow operation.
+So one consequence of this restructuring is that instead of getting
+one kernel message to indicate the change, you may see several.
+For example, before when you did a gfs2_grow, you'd get a single
+message like:
+
+GFS2: File system extended by 247876 blocks (968MB)
+
+Now you get something like:
+
+GFS2: File system extended by 207896 blocks (812MB)
+GFS2: File system extended by 39980 blocks (156MB)
+
+This version has also been successfully run against the hours-long
+"gfs2_fsck_hellfire" test that does several gfs2_grow and gfs2_fsck
+while interjecting file system damage.  It does this repeatedly
+under a variety Resource Group conditions.
+
+Signed-off-By: Bob Peterson <rpeterso at redhat.com>
+Signed-off-by: Steven Whitehouse <swhiteho at redhat.com>
+
+diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
+index 30c1562..846c0ff 100644
+--- a/fs/gfs2/ops_address.c
++++ b/fs/gfs2/ops_address.c
+@@ -1,6 +1,6 @@
+ /*
+  * Copyright (C) Sistina Software, Inc.  1997-2003 All rights reserved.
+- * Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
++ * Copyright (C) 2004-2007 Red Hat, Inc.  All rights reserved.
+  *
+  * This copyrighted material is made available to anyone wishing to use,
+  * modify, copy, or redistribute it subject to the terms and conditions
+@@ -450,6 +450,30 @@ out_uninit:
+ }
+ 
+ /**
++ * adjust_fs_space - Adjusts the free space available due to gfs2_grow
++ * @inode: the rindex inode
++ */
++static void adjust_fs_space(struct inode *inode)
++{
++	struct gfs2_sbd *sdp = inode->i_sb->s_fs_info;
++	struct gfs2_statfs_change_host *m_sc = &sdp->sd_statfs_master;
++	struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local;
++	u64 fs_total, new_free;
++
++	/* Total up the file system space, according to the latest rindex. */
++	fs_total = gfs2_ri_total(sdp);
++
++	spin_lock(&sdp->sd_statfs_spin);
++	if (fs_total > (m_sc->sc_total + l_sc->sc_total))
++		new_free = fs_total - (m_sc->sc_total + l_sc->sc_total);
[...9523 lines suppressed...]
+ 				break;
+ 		}
+ 		bh = NULL;
++		BUG_ON(total_dbuf < num);
+ 		total_dbuf -= num;
+ 		total_jdata -= num;
+ 	}
+-- 
+1.5.1.2
+
+From 09ffcaa4fddaf44d9e1af8e14575fd625f8486d4 Mon Sep 17 00:00:00 2001
+From: Bob Peterson <rpeterso at redhat.com>
+Date: Thu, 12 Jul 2007 16:58:50 -0500
+Subject: [PATCH] [GFS2] soft lockup in rgblk_search
+
+This patch seems to fix the problem described in bugzilla bug 246114.
+It was written by Steve Whitehouse with some tweaking by me.
+
+The code was looping in the relatively new section of code designed to
+search for and reuse unlinked inodes.  In cases where it was finding an
+appropriate inode to reuse, it was looping around and finding the same
+block over and over because a "<=" check should have been a "<" when
+comparing the goal block to the last unlinked block found.
+
+Signed-off-by: Bob Peterson <rpeterso at redhat.com>
+Signed-off-by: Steven Whitehouse <swhiteho at redhat.com>
+
+diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
+index e4e0406..bb58e69 100644
+--- a/fs/gfs2/rgrp.c
++++ b/fs/gfs2/rgrp.c
+@@ -863,16 +863,19 @@ static struct inode *try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked)
+ 	u64 no_addr;
+ 
+ 	for(;;) {
++		if (goal >= rgd->rd_data)
++			break;
+ 		goal = rgblk_search(rgd, goal, GFS2_BLKST_UNLINKED,
+ 				    GFS2_BLKST_UNLINKED);
+ 		if (goal == 0)
+-			return 0;
++			break;
+ 		no_addr = goal + rgd->rd_data0;
+-		if (no_addr <= *last_unlinked)
++		goal++;
++		if (no_addr < *last_unlinked)
+ 			continue;
+ 		*last_unlinked = no_addr;
+ 		inode = gfs2_inode_lookup(rgd->rd_sbd->sd_vfs, DT_UNKNOWN,
+-					no_addr, -1);
++					  no_addr, -1);
+ 		if (!IS_ERR(inode))
+ 			return inode;
+ 	}
+-- 
+1.5.1.2
+
+From c70c2c4f9fcb8d88badff29e8aea1666345a82ac Mon Sep 17 00:00:00 2001
+From: David Teigland <teigland at redhat.com>
+Date: Fri, 13 Jul 2007 14:49:06 -0500
+Subject: [PATCH] [DLM] fix NULL ls usage
+
+Fix regression in recent patch "[DLM] variable allocation" which
+attempts to dereference an "ls" struct when it's NULL.
+
+Signed-off-by: David Teigland <teigland at redhat.com>
+Signed-off-by: Steven Whitehouse <swhiteho at redhat.com>
+
+diff --git a/fs/dlm/rcom.c b/fs/dlm/rcom.c
+index e3a1527..188b91c 100644
+--- a/fs/dlm/rcom.c
++++ b/fs/dlm/rcom.c
+@@ -386,8 +386,7 @@ static void receive_rcom_lock_reply(struct dlm_ls *ls, struct dlm_rcom *rc_in)
+ 	dlm_recover_process_copy(ls, rc_in);
+ }
+ 
+-static int send_ls_not_ready(struct dlm_ls *ls, int nodeid,
+-			     struct dlm_rcom *rc_in)
++static int send_ls_not_ready(int nodeid, struct dlm_rcom *rc_in)
+ {
+ 	struct dlm_rcom *rc;
+ 	struct rcom_config *rf;
+@@ -395,7 +394,7 @@ static int send_ls_not_ready(struct dlm_ls *ls, int nodeid,
+ 	char *mb;
+ 	int mb_len = sizeof(struct dlm_rcom) + sizeof(struct rcom_config);
+ 
+-	mh = dlm_lowcomms_get_buffer(nodeid, mb_len, ls->ls_allocation, &mb);
++	mh = dlm_lowcomms_get_buffer(nodeid, mb_len, GFP_NOFS, &mb);
+ 	if (!mh)
+ 		return -ENOBUFS;
+ 	memset(mb, 0, mb_len);
+@@ -465,7 +464,7 @@ void dlm_receive_rcom(struct dlm_header *hd, int nodeid)
+ 		log_print("lockspace %x from %d type %x not found",
+ 			  hd->h_lockspace, nodeid, rc->rc_type);
+ 		if (rc->rc_type == DLM_RCOM_STATUS)
+-			send_ls_not_ready(ls, nodeid, rc);
++			send_ls_not_ready(nodeid, rc);
+ 		return;
+ 	}
+ 
+-- 
+1.5.1.2
+
+From eed9cc50c6c562521a757de050e6d47c3a7f1b0b Mon Sep 17 00:00:00 2001
+From: Steven Whitehouse <swhiteho at redhat.com>
+Date: Tue, 17 Jul 2007 10:26:56 +0100
+Subject: [PATCH] [GFS2] Fix incorrect return code in rgrp.c
+
+
+The following patch fixes a bug where 0 was being used as a return code
+to indicate "nothing to do" when in fact 0 was a valid block location
+which might be returned by the function.
+
+Signed-off-by: Steven Whitehouse <swhiteho at redhat.com>
+
+diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
+index bb58e69..ce48c45 100644
+--- a/fs/gfs2/rgrp.c
++++ b/fs/gfs2/rgrp.c
+@@ -867,7 +867,7 @@ static struct inode *try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked)
+ 			break;
+ 		goal = rgblk_search(rgd, goal, GFS2_BLKST_UNLINKED,
+ 				    GFS2_BLKST_UNLINKED);
+-		if (goal == 0)
++		if (goal == BFITNOENT)
+ 			break;
+ 		no_addr = goal + rgd->rd_data0;
+ 		goal++;
+@@ -1316,7 +1316,7 @@ static u32 rgblk_search(struct gfs2_rgrpd *rgd, u32 goal,
+ 				    bi->bi_len, blk, new_state);
+ 	}
+ 
+-	return (blk == BFITNOENT) ? 0 : (bi->bi_start * GFS2_NBBY) + blk;
++	return (blk == BFITNOENT) ? blk : (bi->bi_start * GFS2_NBBY) + blk;
+ }
+ 
+ /**
+@@ -1396,6 +1396,7 @@ u64 gfs2_alloc_data(struct gfs2_inode *ip)
+ 		goal = rgd->rd_last_alloc_data;
+ 
+ 	blk = rgblk_search(rgd, goal, GFS2_BLKST_FREE, GFS2_BLKST_USED);
++	BUG_ON(blk == BFITNOENT);
+ 	rgd->rd_last_alloc_data = blk;
+ 
+ 	block = rgd->rd_data0 + blk;
+@@ -1440,6 +1441,7 @@ u64 gfs2_alloc_meta(struct gfs2_inode *ip)
+ 		goal = rgd->rd_last_alloc_meta;
+ 
+ 	blk = rgblk_search(rgd, goal, GFS2_BLKST_FREE, GFS2_BLKST_USED);
++	BUG_ON(blk == BFITNOENT);
+ 	rgd->rd_last_alloc_meta = blk;
+ 
+ 	block = rgd->rd_data0 + blk;
+@@ -1481,6 +1483,7 @@ u64 gfs2_alloc_di(struct gfs2_inode *dip, u64 *generation)
+ 
+ 	blk = rgblk_search(rgd, rgd->rd_last_alloc_meta,
+ 			   GFS2_BLKST_FREE, GFS2_BLKST_DINODE);
++	BUG_ON(blk == BFITNOENT);
+ 
+ 	rgd->rd_last_alloc_meta = blk;
+ 
+-- 
+1.5.1.2
+
+From aed340859b506db2f143d0c64163640bf8960caf Mon Sep 17 00:00:00 2001
+From: Steven Whitehouse <swhiteho at redhat.com>
+Date: Tue, 17 Jul 2007 10:29:02 +0100
+Subject: [PATCH] [GFS2] Fix incorrect error path in prepare_write()
+
+
+The error path in prepare_write() was incorrect in the (very rare) event
+that the transaction fails to start. The following prevents a NULL
+pointer dereference,
+
+Signed-off-by: Steven Whitehouse <swhiteho at redhat.com>
+
+diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
+index 26c8888..ebfaade 100644
+--- a/fs/gfs2/ops_address.c
++++ b/fs/gfs2/ops_address.c
+@@ -416,7 +416,7 @@ static int gfs2_prepare_write(struct file *file, struct page *page,
+ 
+ 	error = gfs2_trans_begin(sdp, rblocks, 0);
+ 	if (error)
+-		goto out;
++		goto out_trans_fail;
+ 
+ 	if (gfs2_is_stuffed(ip)) {
+ 		if (end > sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode)) {
+@@ -434,6 +434,7 @@ prepare_write:
+ out:
+ 	if (error) {
+ 		gfs2_trans_end(sdp);
++out_trans_fail:
+ 		if (alloc_required) {
+ 			gfs2_inplace_release(ip);
+ out_qunlock:
+-- 
+1.5.1.2
+

linux-2.6-ipc-shm-fix-user-leakage.patch:
 shm.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE linux-2.6-ipc-shm-fix-user-leakage.patch ---
When user locks an ipc shmem segmant with SHM_LOCK ctl and the
segment is already locked the shmem_lock() function returns 0. After this the subsequent code leaks the existing user struct:

== ipc/shm.c: sys_shmctl() ==
    ...
    err = shmem_lock(shp->shm_file, 1, user);
    if (!err) {
         shp->shm_perm.mode |= SHM_LOCKED;
         shp->mlock_user = user;
    }
    ...
==

Other results of this are:
1. the new shp->mlock_user is not get-ed and will point to freed
  memory when the task dies.
2. the RLIMIT_MEMLOCK is screwed on both user structs.

The exploit looks like this:

==
   id = shmget(...);
   setresuid(uid, 0, 0);
   shmctl(id, SHM_LOCK, NULL);
   setresuid(uid + 1, 0, 0);
   shmctl(id, SHM_LOCK, NULL);
==

My solution is to return 0 to the userspace and do not change the
segment's user.

Signed-off-by: Pavel Emelianov <xemul at openvz.org>

---

--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -716,7 +716,7 @@ asmlinkage long sys_shmctl (int shmid, i
 			struct user_struct * user = current->user;
 			if (!is_file_hugepages(shp->shm_file)) {
 				err = shmem_lock(shp->shm_file, 1, user);
-				if (!err) {
+				if (!err && !(shp->shm_perm.mode & SHM_LOCKED)) {
 					shp->shm_perm.mode |= SHM_LOCKED;
 					shp->mlock_user = user;
 				}

linux-2.6-libata-ata_piix_fix_pio-mwdma-programming.patch:
 ata_piix.c |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

--- NEW FILE linux-2.6-libata-ata_piix_fix_pio-mwdma-programming.patch ---
Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a5bf5f5a370ba7c10f5362265e360952145a7da1
Commit:     a5bf5f5a370ba7c10f5362265e360952145a7da1
Parent:     dab632e8c483532bd84e1f3401c72612e39a7c40
Author:     Tejun Heo <htejun at gmail.com>
AuthorDate: Fri May 25 19:16:58 2007 +0200
Committer:  Jeff Garzik <jeff at garzik.org>
CommitDate: Mon Jul 9 12:17:34 2007 -0400

    ata_piix: fix pio/mwdma programming
    
    Fix various bugs in pio/mwdma mode programming.
    
    * Control bits in the timing register wasn't cleared properly while
      programming PIO mode.
    
    * MWDMA mode programming cleared the wrong part of control bits.
    
    * MWDMA mode programming cleared udma_mask even when the controller
      doesn't support UDMA.
    
    Signed-off-by: Tejun Heo <htejun at gmail.com>
    Cc: Art Haas <ahaas at airmail.net>
    Signed-off-by: Jeff Garzik <jeff at garzik.org>
---
 drivers/ata/ata_piix.c |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 9c07b88..924e447 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -685,8 +685,14 @@ static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev)
 	if (adev->class == ATA_DEV_ATA)
 		control |= 4;	/* PPE enable */
 
+	/* PIO configuration clears DTE unconditionally.  It will be
+	 * programmed in set_dmamode which is guaranteed to be called
+	 * after set_piomode if any DMA mode is available.
+	 */
 	pci_read_config_word(dev, master_port, &master_data);
 	if (is_slave) {
+		/* clear TIME1|IE1|PPE1|DTE1 */
+		master_data &= 0xff0f;
 		/* Enable SITRE (seperate slave timing register) */
 		master_data |= 0x4000;
 		/* enable PPE1, IE1 and TIME1 as needed */
@@ -694,12 +700,14 @@ static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev)
 		pci_read_config_byte(dev, slave_port, &slave_data);
 		slave_data &= (ap->port_no ? 0x0f : 0xf0);
 		/* Load the timing nibble for this slave */
-		slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << (ap->port_no ? 4 : 0);
+		slave_data |= ((timings[pio][0] << 2) | timings[pio][1])
+						<< (ap->port_no ? 4 : 0);
 	} else {
-		/* Master keeps the bits in a different format */
-		master_data &= 0xccf8;
+		/* clear ISP|RCT|TIME0|IE0|PPE0|DTE0 */
+		master_data &= 0xccf0;
 		/* Enable PPE, IE and TIME as appropriate */
 		master_data |= control;
+		/* load ISP and RCT */
 		master_data |=
 			(timings[pio][0] << 12) |
 			(timings[pio][1] << 8);
@@ -816,7 +824,7 @@ static void do_pata_set_dmamode (struct ata_port *ap, struct ata_device *adev, i
 			master_data &= 0xFF4F;  /* Mask out IORDY|TIME1|DMAONLY */
 			master_data |= control << 4;
 			pci_read_config_byte(dev, 0x44, &slave_data);
-			slave_data &= (0x0F + 0xE1 * ap->port_no);
+			slave_data &= (ap->port_no ? 0x0f : 0xf0);
 			/* Load the matching timing */
 			slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << (ap->port_no ? 4 : 0);
 			pci_write_config_byte(dev, 0x44, slave_data);
@@ -828,8 +836,11 @@ static void do_pata_set_dmamode (struct ata_port *ap, struct ata_device *adev, i
 				(timings[pio][0] << 12) |
 				(timings[pio][1] << 8);
 		}
-		udma_enable &= ~(1 << devid);
-		pci_write_config_word(dev, master_port, master_data);
+
+		if (ap->udma_mask) {
+			udma_enable &= ~(1 << devid);
+			pci_write_config_word(dev, master_port, master_data);
+		}
 	}
 	/* Don't scribble on 0x48 if the controller does not support UDMA */
 	if (ap->udma_mask)

linux-2.6-libata_pata_atiixp_add_ati_sb700.patch:
 pata_atiixp.c |    1 +
 1 files changed, 1 insertion(+)

--- NEW FILE linux-2.6-libata_pata_atiixp_add_ati_sb700.patch ---
Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1ca972c2028edd6cd6a6ca40bd1f58b91fb4ea58
Commit:     1ca972c2028edd6cd6a6ca40bd1f58b91fb4ea58
Parent:     64578a3de723d502621860f9d4d28f34d001b066
Author:     Jeff Garzik <jeff at garzik.org>
AuthorDate: Thu May 24 23:05:25 2007 -0400
Committer:  Jeff Garzik <jeff at garzik.org>
CommitDate: Mon Jul 9 12:17:32 2007 -0400

    [libata] pata_atiixp: add SB700 PCI ID
    
    From AMD.
    
    Signed-off-by: Jeff Garzik <jeff at garzik.org>
---
 drivers/ata/pata_atiixp.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c
index 8449146..eceea6c 100644
--- a/drivers/ata/pata_atiixp.c
+++ b/drivers/ata/pata_atiixp.c
@@ -285,6 +285,7 @@ static const struct pci_device_id atiixp[] = {
 	{ PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP300_IDE), },
 	{ PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP400_IDE), },
 	{ PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP600_IDE), },
+	{ PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP700_IDE), },
 
 	{ },
 };

linux-2.6-sdhci-ene-controller-quirk.patch:
 drivers/mmc/host/sdhci.c |    8 ++++++++
 include/linux/pci_ids.h  |    1 +
 2 files changed, 9 insertions(+)

--- NEW FILE linux-2.6-sdhci-ene-controller-quirk.patch ---
Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7de064ebc67d9baf6c933d3a7046feb9b4eced05
Commit:     7de064ebc67d9baf6c933d3a7046feb9b4eced05
Parent:     98ccf14909ba02a41c5925b0b2c92aeeef23d3b9
Author:     Milko Krachounov <milko at 3mhz.net>
AuthorDate: Sat May 19 01:18:03 2007 +0200
Committer:  Pierre Ossman <drzeus at drzeus.cx>
CommitDate: Mon Jul 9 21:23:08 2007 +0200

    sdhci: add ene controller id
    
    ENE has a very weird design where an SDHCI device (0805) is presented
    on the PCI bus, but that device is non-functional, and the real device
    is hidden as a more generic device.
    
    Signed-off-by: Milko Krachounov <milko at 3mhz.net>
    Signed-off-by: Pierre Ossman <drzeus at drzeus.cx>
---
 drivers/mmc/host/sdhci.c |    8 ++++++++
 include/linux/pci_ids.h  |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index a359efd..5e9a6ce 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -70,6 +70,14 @@ static const struct pci_device_id pci_ids[] __devinitdata = {
 		.driver_data	= SDHCI_QUIRK_SINGLE_POWER_WRITE,
 	},
 
+	{
+		.vendor		= PCI_VENDOR_ID_ENE,
+		.device		= PCI_DEVICE_ID_ENE_CB712_SD_2,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= SDHCI_QUIRK_SINGLE_POWER_WRITE,
+	},
+
 	{	/* Generic SD host controller */
 		PCI_DEVICE_CLASS((PCI_CLASS_SYSTEM_SDHCI << 8), 0xFFFF00)
 	},
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 5b1c999..75c4d4d 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2000,6 +2000,7 @@
 
 #define PCI_VENDOR_ID_ENE		0x1524
 #define PCI_DEVICE_ID_ENE_CB712_SD	0x0550
+#define PCI_DEVICE_ID_ENE_CB712_SD_2	0x0551
 #define PCI_DEVICE_ID_ENE_1211		0x1211
 #define PCI_DEVICE_ID_ENE_1225		0x1225
 #define PCI_DEVICE_ID_ENE_1410		0x1410

linux-2.6-sdhci-fix-interrupt-mask.patch:
 sdhci.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE linux-2.6-sdhci-fix-interrupt-mask.patch ---
Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9d26a5d3f2b9c4fe4b2ba491683c6989ecd6ae04
Commit:     9d26a5d3f2b9c4fe4b2ba491683c6989ecd6ae04
Parent:     8c75deae1ab99661975da098f8b721bafbb247c4
Author:     Rolf Eike Beer <eike-kernel at sf-tec.de>
AuthorDate: Tue Jun 26 13:31:16 2007 +0200
Committer:  Pierre Ossman <drzeus at drzeus.cx>
CommitDate: Mon Jul 9 21:28:35 2007 +0200

    sdhci: Fix "Unexpected interrupt" handling
    
    Whenever a power interrupt is signaled it is also reported as an unexpected
    one. All other unexpected interrupts get lost. Cause is a not inversed
    bitmask to remove power interrupts from the status.
    
    Signed-off-by: Rolf Eike Beer <eike-kernel at sf-tec.de>
    Signed-off-by: Pierre Ossman <drzeus at drzeus.cx>
---
 drivers/mmc/host/sdhci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 5e9a6ce..10d15c3 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1030,7 +1030,7 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
 		writel(SDHCI_INT_BUS_POWER, host->ioaddr + SDHCI_INT_STATUS);
 	}
 
-	intmask &= SDHCI_INT_BUS_POWER;
+	intmask &= ~SDHCI_INT_BUS_POWER;
 
 	if (intmask) {
 		printk(KERN_ERR "%s: Unexpected interrupt 0x%08x.\n",

linux-2.6-seq_operations-leak.patch:
 fs/proc/base.c            |    2 +-
 kernel/sched_debug.c      |    2 +-
 kernel/time/timer_list.c  |    2 +-
 kernel/time/timer_stats.c |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

--- NEW FILE linux-2.6-seq_operations-leak.patch ---
Date: Tue, 17 Jul 2007 16:25:11 +0400
From: Alexey Dobriyan <adobriyan at sw.ru>
To: akpm at osdl.org, mingo at elte.hu
Subject: [PATCH] Fix leaks on
	/proc/{*/sched,sched_debug,timer_list,timer_stats}
Cc: linux-kernel at vger.kernel.org, devel at openvz.org

On every open/close one struct seq_operations leaks.
Kudos to /proc/slab_allocators.

Signed-off-by: Alexey Dobriyan <adobriyan at sw.ru>
---

 fs/proc/base.c            |    2 +-
 kernel/sched_debug.c      |    2 +-
 kernel/time/timer_list.c  |    2 +-
 kernel/time/timer_stats.c |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -926,7 +926,7 @@ static const struct file_operations proc_pid_sched_operations = {
 	.read		= seq_read,
 	.write		= sched_write,
 	.llseek		= seq_lseek,
-	.release	= seq_release,
+	.release	= single_release,
 };
 
 #endif
--- a/kernel/sched_debug.c
+++ b/kernel/sched_debug.c
@@ -200,7 +200,7 @@ static struct file_operations sched_debug_fops = {
 	.open		= sched_debug_open,
 	.read		= seq_read,
 	.llseek		= seq_lseek,
-	.release	= seq_release,
+	.release	= single_release,
 };
 
 static int __init init_sched_debug_procfs(void)
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -267,7 +267,7 @@ static struct file_operations timer_list_fops = {
 	.open		= timer_list_open,
 	.read		= seq_read,
 	.llseek		= seq_lseek,
-	.release	= seq_release,
+	.release	= single_release,
 };
 
 static int __init init_timer_list_procfs(void)
--- a/kernel/time/timer_stats.c
+++ b/kernel/time/timer_stats.c
@@ -399,7 +399,7 @@ static struct file_operations tstats_fops = {
 	.read		= seq_read,
 	.write		= tstats_write,
 	.llseek		= seq_lseek,
-	.release	= seq_release,
+	.release	= single_release,
 };
 
 void __init init_timer_stats(void)


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-6/kernel-2.6.spec,v
retrieving revision 1.2989
retrieving revision 1.2990
diff -u -r1.2989 -r1.2990
--- kernel-2.6.spec	16 Jul 2007 20:55:05 -0000	1.2989
+++ kernel-2.6.spec	17 Jul 2007 19:10:56 -0000	1.2990
@@ -545,6 +545,7 @@
 Patch401: linux-2.6-aacraid-ioctl-security.patch
 Patch420: linux-2.6-squashfs.patch
 Patch421: linux-2.6-jbd-fix-transaction-dropping.patch
+Patch422: linux-2.6-gfs2-update.patch
 Patch430: linux-2.6-net-silence-noisy-printks.patch
 Patch431: linux-2.6-tcp-sack-fix-leak-msgs.patch
 Patch432: linux-2.6-net_sched_fix_deadlock.patch
@@ -567,10 +568,14 @@
 Patch663: linux-2.6-ata-quirk.patch
 Patch664: linux-2.6-libata-unbreak-smart.patch
 Patch666: linux-2.6-libata-unbreak-smart-2.patch
+Patch667: linux-2.6-libata-ata_piix_fix_pio-mwdma-programming.patch
+Patch668: linux-2.6-libata_pata_atiixp_add_ati_sb700.patch
 Patch680: git-wireless-dev.patch
 Patch690: linux-2.6-e1000-ich9.patch
 Patch710: linux-2.6-bcm43xx-pci-neuter.patch
 Patch711: linux-2.6-sky2-restore-workarounds.patch
+Patch740: linux-2.6-sdhci-ene-controller-quirk.patch
+Patch741: linux-2.6-sdhci-fix-interrupt-mask.patch
 #Patch780: linux-2.6-clockevents-fix-resume-logic.patch
 Patch790: linux-2.6-acpi-dock-oops.patch
 Patch791: linux-2.6-cpufreq-acpi-fix-msr-write.patch
@@ -582,6 +587,8 @@
 Patch1020: linux-2.6-usb-autosuspend-default-disable.patch
 Patch1030: linux-2.6-nfs-nosharecache.patch
 Patch1400: linux-2.6-pcspkr-use-the-global-pit-lock.patch
+Patch1420: linux-2.6-seq_operations-leak.patch
+Patch1421: linux-2.6-ipc-shm-fix-user-leakage.patch
 
 %endif
 
@@ -1145,6 +1152,8 @@
 ApplyPatch linux-2.6-squashfs.patch
 # jbd: fix transaction dropping
 ApplyPatch linux-2.6-jbd-fix-transaction-dropping.patch
+# gfs2 update to latest
+ApplyPatch linux-2.6-gfs2-update.patch
 
 # Networking
 # Disable easy to trigger printk's.
@@ -1200,6 +1209,10 @@
 # Unbreak SMART on libata.
 ApplyPatch linux-2.6-libata-unbreak-smart.patch
 ApplyPatch linux-2.6-libata-unbreak-smart-2.patch
+# NSIA
+ApplyPatch linux-2.6-libata-ata_piix_fix_pio-mwdma-programming.patch
+# add ID for sb700 to the pata driver
+ApplyPatch linux-2.6-libata_pata_atiixp_add_ati_sb700.patch
 
 # Add the new wireless stack and drivers from wireless-dev
 ApplyPatch git-wireless-dev.patch
@@ -1211,6 +1224,13 @@
 #       maintainer wanted this in 2.6.22
 ApplyPatch linux-2.6-sky2-restore-workarounds.patch
 
+# sdhci
+#
+# fix weird ENE controller
+ApplyPatch linux-2.6-sdhci-ene-controller-quirk.patch
+# fix interrupt masking
+ApplyPatch linux-2.6-sdhci-fix-interrupt-mask.patch
+
 # ACPI patches
 # Fix ACPI dock oops (#238054)
 ApplyPatch linux-2.6-acpi-dock-oops.patch
@@ -1230,6 +1250,11 @@
 
 ApplyPatch linux-2.6-pcspkr-use-the-global-pit-lock.patch
 
+# fix leaks of struct seq_operations
+ApplyPatch linux-2.6-seq_operations-leak.patch
+# fix leaks of ref to user struct
+ApplyPatch linux-2.6-ipc-shm-fix-user-leakage.patch
+
 # END OF PATCH APPLICATIONS
 
 # Any further pre-build tree manipulations happen here.
@@ -2151,6 +2176,18 @@
 %endif
 
 %changelog
+* Tue Jul 17 2007 Chuck Ebbert <cebbert at redhat.com>
+- gfs2: update to the latest
+- sched: fix show_task()/show_tasks() output
+- sched: fix newly idle load balance in case of SMT
+- sched: fix the all pinned logic in load_balance_newidle()
+- fix leaks of struct seq_operations
+- fix leaks of ref to user struct
+- pata_atiixp: add SB700 PCI ID
+- ata_piix: fix pio/mwdma programming
+- sdhci: add ene controller id
+- sdhci: Fix "Unexpected interrupt" handling
+
 * Mon Jul 16 2007 Chuck Ebbert <cebbert at redhat.com>
 - bluetooth: hangup tty before releasing rfcomm
 - driver core: get driver properly during release

linux-2.6-sched-cfs.patch:
 b/kernel/sched.c                          |   26 
 kernel/sched.c                            |   14 
 linux-2.6.22.noarch/kernel/time.c         |    1 
 linux/Documentation/kernel-parameters.txt |   43 
 linux/Documentation/sched-design-CFS.txt  |  119 +
 linux/arch/i386/kernel/smpboot.c          |   12 
 linux/arch/i386/kernel/tsc.c              |    9 
 linux/arch/ia64/kernel/setup.c            |    6 
 linux/arch/mips/kernel/smp.c              |   11 
 linux/arch/sparc/kernel/smp.c             |   10 
 linux/arch/sparc64/kernel/smp.c           |   27 
 linux/block/cfq-iosched.c                 |    3 
 linux/fs/proc/array.c                     |   59 
 linux/fs/proc/base.c                      |   71 
 linux/include/asm-generic/bitops/sched.h  |   21 
 linux/include/linux/hardirq.h             |   13 
 linux/include/linux/sched.h               |  258 +-
 linux/include/linux/topology.h            |   14 
 linux/init/main.c                         |    5 
 linux/kernel/delayacct.c                  |   10 
 linux/kernel/exit.c                       |    5 
 linux/kernel/fork.c                       |    5 
 linux/kernel/posix-cpu-timers.c           |   34 
 linux/kernel/sched.c                      | 2980 +++++++++++-------------------
 linux/kernel/sched_debug.c                |  276 ++
 linux/kernel/sched_fair.c                 | 1107 +++++++++++
 linux/kernel/sched_idletask.c             |   71 
 linux/kernel/sched_rt.c                   |  255 ++
 linux/kernel/sched_stats.h                |  235 ++
 linux/kernel/softirq.c                    |    1 
 linux/kernel/sysctl.c                     |   76 
 linux/kernel/time.c                       |   27 
 linux/lib/Kconfig.debug                   |    9 
 33 files changed, 3681 insertions(+), 2132 deletions(-)

Index: linux-2.6-sched-cfs.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-6/linux-2.6-sched-cfs.patch,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- linux-2.6-sched-cfs.patch	13 Jul 2007 22:39:58 -0000	1.6
+++ linux-2.6-sched-cfs.patch	17 Jul 2007 19:10:57 -0000	1.7
@@ -10,8 +10,17 @@
 45f384a64f0769bb9a3caf0516de88a629f48e61
 sched: remove stale version info from kernel/sched_debug.c
 
-[not committed upstream yet, but obvious]
-sched: fix another prio_to_wmult[] entry
+4fd885170bf13841ada921495b7b00c4b9971cf9
+CFS: Fix missing digit off in wmult table
+
+4bd77321a833077c5c9ac7b9d284e261e4a8906e
+sched: fix show_task()/show_tasks() output
+
+[not in mainline yet]
+sched: fix newly idle load balance in case of SMT
+
+[not in mainline yet]
+sched: fix the all pinned logic in load_balance_newidle()
 
 Index: linux/Documentation/kernel-parameters.txt
 ===================================================================
@@ -7733,3 +7742,171 @@
  
  #include <asm/uaccess.h>
  #include <asm/unistd.h>
+Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4bd77321a833077c5c9ac7b9d284e261e4a8906e
+Commit:     4bd77321a833077c5c9ac7b9d284e261e4a8906e
+Parent:     45f384a64f0769bb9a3caf0516de88a629f48e61
+Author:     Ingo Molnar <mingo at elte.hu>
+AuthorDate: Wed Jul 11 21:21:47 2007 +0200
+Committer:  Linus Torvalds <torvalds at woody.linux-foundation.org>
+CommitDate: Fri Jul 13 10:11:17 2007 -0700
+
+    [PATCH] sched: fix show_task()/show_tasks() output
+    
+    fix show_task()/show_tasks() output:
+    
+    - there's no sibling info anymore
+    
+    - the fields were not aligned properly with the description
+    
+    - get rid of the lazy-TLB output: it's been quite some time since
+      we last had a bug there, and when we had a bug it wasnt helped a
+      bit by this debug output.
+    
+    Signed-off-by: Ingo Molnar <mingo at elte.hu>
+    Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
+---
+ kernel/sched.c |   26 ++++++++++----------------
+ 1 files changed, 10 insertions(+), 16 deletions(-)
+
+diff --git a/kernel/sched.c b/kernel/sched.c
+index 9088c2d..0559665 100644
+--- a/kernel/sched.c
++++ b/kernel/sched.c
+@@ -4647,14 +4647,14 @@ static void show_task(struct task_struct *p)
+ 	state = p->state ? __ffs(p->state) + 1 : 0;
+ 	printk("%-13.13s %c", p->comm,
+ 		state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?');
+-#if (BITS_PER_LONG == 32)
++#if BITS_PER_LONG == 32
+ 	if (state == TASK_RUNNING)
+-		printk(" running ");
++		printk(" running  ");
+ 	else
+-		printk(" %08lX ", thread_saved_pc(p));
++		printk(" %08lx ", thread_saved_pc(p));
+ #else
+ 	if (state == TASK_RUNNING)
+-		printk("  running task   ");
++		printk("  running task    ");
+ 	else
+ 		printk(" %016lx ", thread_saved_pc(p));
+ #endif
+@@ -4666,11 +4666,7 @@ static void show_task(struct task_struct *p)
+ 		free = (unsigned long)n - (unsigned long)end_of_stack(p);
+ 	}
+ #endif
+-	printk("%5lu %5d %6d", free, p->pid, p->parent->pid);
+-	if (!p->mm)
+-		printk(" (L-TLB)\n");
+-	else
+-		printk(" (NOTLB)\n");
++	printk("%5lu %5d %6d\n", free, p->pid, p->parent->pid);
+ 
+ 	if (state != TASK_RUNNING)
+ 		show_stack(p, NULL);
+@@ -4680,14 +4676,12 @@ void show_state_filter(unsigned long state_filter)
+ {
+ 	struct task_struct *g, *p;
+ 
+-#if (BITS_PER_LONG == 32)
+-	printk("\n"
+-	       "                         free                        sibling\n");
+-	printk("  task             PC    stack   pid father child younger older\n");
++#if BITS_PER_LONG == 32
++	printk(KERN_INFO
++		"  task                PC stack   pid father\n");
+ #else
+-	printk("\n"
+-	       "                                 free                        sibling\n");
+-	printk("  task                 PC        stack   pid father child younger older\n");
++	printk(KERN_INFO
++		"  task                        PC stack   pid father\n");
+ #endif
+ 	read_lock(&tasklist_lock);
+ 	do_each_thread(g, p) {
+Subject: sched: fix newly idle load balance in case of SMT
+From: Suresh Siddha <suresh.b.siddha at intel.com>
+
+In the presence of SMT, newly idle balance was never happening for multi-core
+and SMP domains(even when both the logical siblings are idle).
+
+If thread 0 is already idle and when thread 1 is about to go to idle, newly
+idle load balance always think that one of the threads is not idle and skips
+doing the newly idle load balance for multi-core and SMP domains.
+
+This is because of the idle_cpu() macro, which checks if the current
+process on a cpu is an idle process. But this is not the case for the
+thread doing the load_balance_newidle().
+
+Fix this by using runqueue's nr_running field instead of idle_cpu(). And
+also skip the logic of 'only one idle cpu in the group will be doing load
+balancing' during newly idle case.
+
+Signed-off-by: Suresh Siddha <suresh.b.siddha at intel.com>
+---
+
+diff --git a/kernel/sched.c b/kernel/sched.c
+index 3332bbb..623cee9 100644
+--- a/kernel/sched.c
++++ b/kernel/sched.c
+@@ -2226,7 +2226,7 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
+ 
+ 			rq = cpu_rq(i);
+ 
+-			if (*sd_idle && !idle_cpu(i))
++			if (*sd_idle && rq->nr_running)
+ 				*sd_idle = 0;
+ 
+ 			/* Bias balancing toward cpus of our domain */
+@@ -2248,9 +2248,11 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
+ 		/*
+ 		 * First idle cpu or the first cpu(busiest) in this sched group
+ 		 * is eligible for doing load balancing at this and above
+-		 * domains.
++		 * domains. In the newly idle case, we will allow all the cpu's
++		 * to do the newly idle load balance.
+ 		 */
+-		if (local_group && balance_cpu != this_cpu && balance) {
++		if (idle != CPU_NEWLY_IDLE && local_group &&
++		    balance_cpu != this_cpu && balance) {
+ 			*balance = 0;
+ 			goto ret;
+ 		}
+Subject: sched: fix the all pinned logic in load_balance_newidle()
+From: Suresh Siddha <suresh.b.siddha at intel.com>
+
+nr_moved is not the correct check for triggering all pinned logic. Fix
+the all pinned logic in the case of load_balance_newidle().
+
+Signed-off-by: Suresh Siddha <suresh.b.siddha at intel.com>
+Signed-off-by: Ingo Molnar <mingo at elte.hu>
+---
+ kernel/sched.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+Index: linux/kernel/sched.c
+===================================================================
+--- linux.orig/kernel/sched.c
++++ linux/kernel/sched.c
+@@ -2679,6 +2679,7 @@ load_balance_newidle(int this_cpu, struc
+ 	unsigned long imbalance;
+ 	int nr_moved = 0;
+ 	int sd_idle = 0;
++	int all_pinned = 0;
+ 	cpumask_t cpus = CPU_MASK_ALL;
+ 
+ 	/*
+@@ -2717,10 +2718,11 @@ redo:
+ 		double_lock_balance(this_rq, busiest);
+ 		nr_moved = move_tasks(this_rq, this_cpu, busiest,
+ 					minus_1_or_zero(busiest->nr_running),
+-					imbalance, sd, CPU_NEWLY_IDLE, NULL);
++					imbalance, sd, CPU_NEWLY_IDLE,
++					&all_pinned);
+ 		spin_unlock(&busiest->lock);
+ 
+-		if (!nr_moved) {
++		if (unlikely(all_pinned)) {
+ 			cpu_clear(cpu_of(busiest), cpus);
+ 			if (!cpus_empty(cpus))
+ 				goto redo;




More information about the fedora-cvs-commits mailing list