Merge changes from sid branch up to 3.2.14-1

Drop changes to preserve ABI on sid branch.

Drop some patches already included in 3.3.1.

svn path=/dists/trunk/linux-2.6/; revision=18909
This commit is contained in:
Ben Hutchings 2012-04-06 20:59:33 +00:00
commit 5ba5ce0d66
32 changed files with 787 additions and 3676 deletions

52
debian/changelog vendored
View File

@ -26,6 +26,58 @@ linux-2.6 (3.3~rc6-1~experimental.1) experimental; urgency=low
-- Ben Hutchings <ben@decadent.org.uk> Sun, 04 Mar 2012 20:27:42 +0000
linux-2.6 (3.2.14-1) unstable; urgency=low
* New upstream stable update:
http://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.2.14
- mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem
read mode (CVE-2012-1179)
- hugetlbfs: avoid taking i_mutex from hugetlbfs_read()
- md/bitmap: ensure to load bitmap when creating via sysfs
(Closes: #661558)
- md: dont set md arrays to readonly on shutdown
- md/raid1,raid10: avoid deadlock during resync/recovery (Closes: #584881)
- md: fix clearing of the changed flags for the bad blocks list
- xfs: fix inode lookup race
- sysctl: protect poll() in entries that may go away
- NFSv4: Rate limit the state manager warning messages (Closes: #666121)
- jbd2: clear BH_Delay & BH_Unwritten in journal_unmap_buffer
- ext4: ignore EXT4_INODE_JOURNAL_DATA flag with delalloc
- ext4: fix race between sync and completed io work
- ext4: check for zero length extent
- vfs: fix d_ancestor() case in d_materialize_unique
- udf: Fix deadlock in udf_release_file()
- dm crypt: add missing error handling
- dm thin: fix stacked bi_next usage
- xfs: Fix oops on IO error during xlog_recover_process_iunlinks()
- NFSv4: Fix two infinite loops in the mount code
- drm/i915: suspend fbdev device around suspend/hibernate
(Closes: #645547)
- net: fix a potential rcu_read_lock() imbalance in rt6_fill_node()
- [x86] tls: Off by one limit check
- PCI: ASPM: Fix pcie devices with non-pcie children (Closes: #665420)
[ Jonathan Nieder ]
* ata: Enable PATA_IT8213 as module (Closes: #666506)
-- Ben Hutchings <ben@decadent.org.uk> Thu, 05 Apr 2012 05:02:45 +0100
linux-2.6 (3.2.13-1) unstable; urgency=low
* New upstream stable update:
http://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.2.13
[ Ben Hutchings ]
* kbuild: do not check for ancient modutils tools
[ Uwe Kleine-König ]
* [rt] bump version to 3.2.12-rt22
[ Bastian Blank ]
* [s390x] Ignore ABI change.
-- Bastian Blank <waldi@debian.org> Wed, 28 Mar 2012 13:40:26 +0200
linux-2.6 (3.2.12-1) unstable; urgency=high
* New upstream stable update:

View File

@ -128,7 +128,7 @@ CONFIG_PATA_CMD64X=m
# CONFIG_PATA_HPT37X is not set
# CONFIG_PATA_HPT3X2N is not set
# CONFIG_PATA_HPT3X3 is not set
# CONFIG_PATA_IT8213 is not set
CONFIG_PATA_IT8213=m
CONFIG_PATA_IT821X=m
CONFIG_PATA_JMICRON=m
CONFIG_PATA_MARVELL=m

View File

@ -0,0 +1,45 @@
From: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Date: Tue, 17 Jan 2012 14:50:51 -0200
Subject: [PATCH] kbuild: do not check for ancient modutils tools
commit 620c231c7a7f48745094727bb612f6321cfc8844 upstream.
scripts/depmod.sh checks for the output of '-V' expecting that it has
module-init-tools in it. It's a hack to prevent users from using
modutils instead of module-init-tools, that only works with 2.4.x
kernels. This however prints an annoying warning for kmod tool, that is
currently replacing module-init-tools.
Rather than putting another check for kmod's version, just remove it
since users of 2.4.x kernel are unlikely to upgrade to 3.x, and if they
do, let depmod fail in that case because they should know what they are
doing.
Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Acked-by: WANG Cong <amwang@redhat.com>
Acked-By: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
scripts/depmod.sh | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/scripts/depmod.sh b/scripts/depmod.sh
index a272356..2ae4817 100755
--- a/scripts/depmod.sh
+++ b/scripts/depmod.sh
@@ -9,12 +9,6 @@ fi
DEPMOD=$1
KERNELRELEASE=$2
-if ! "$DEPMOD" -V 2>/dev/null | grep -q module-init-tools; then
- echo "Warning: you may need to install module-init-tools" >&2
- echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt" >&2
- sleep 1
-fi
-
if ! test -r System.map -a -x "$DEPMOD"; then
exit 0
fi
--
1.7.9.1

View File

@ -1,3 +1,7 @@
From: Gordon Farquharson <gordonfarquharson@gmail.com>
Subject: [arm] Disable SCSI_ACARD
Date: Mon, 12 Nov 2007 04:08:38 +0000
ERROR: "__bad_udelay" [drivers/scsi/atp870u.ko] undefined!
make[1]: *** [__modpost] Error 1

View File

@ -1,4 +1,6 @@
ixp4xx: add io{read,write}{16,32}be functions
From: Arnaud Patard <arnaud.patard@rtp-net.org>
Subject: ixp4xx: add io{read,write}{16,32}be functions
Date: 2011-11-13 19:27:56 +0000
Some driver are now requiring some be io functions, add noted in
commit (06901bd83412db5a31de7526e637101ed0c2c472). Otherwise, it may lead

View File

@ -1,3 +1,25 @@
From: dann frazier <dannf@debian.org>
Subject: Hardcode arch script output
Date: Mon, 26 Mar 2007 16:30:51 -0600
Bug-Debian: http://bugs.debian.org/392592
Here's a patch that simply uses hardcoded definitions instead of
doing the dynamic tests that require architecture-specific scripts.
I don't particularly like this approach because it restricts
portability and diverts from upstream. But, it is simpler, and this
really needs to be fixed somehow before etch (along with a rebuild of
linux-modules-extra-2.6), so I'm willing to live with it if my other
patch is deemed unacceptable.
My primary concern is that, in the future, the output of these scripts
will change and we (or our successors) will either not notice or
forget to update the hardcoded values.
Including the scripts in linux-kbuild will avoid this manual step
altogether, and allow for the possibility of other archs to provide
their own scripts in the future.
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile
index e7cbaa0..c8af869 100644
--- a/arch/ia64/Makefile

View File

@ -1,3 +1,7 @@
From: Martin Michlmayr <tbm@cyrius.com>
Date: Sat, 19 Jan 2008 18:25:02 +0000
Subject: [arm, mips] Disable Advansys
Florian Lohoff <flo@rfc822.org> reports the following build failure on IP32:
MODPOST 552 modules

View File

@ -1,3 +1,11 @@
From: Ben Hutchings <ben@decadent.org.uk>
Subject: Fix console selection in PowerPC LPAR environment
Date: Tue, 27 Sep 2011 06:04:39 +0100
Do not override the preferred console set through the kernel parameter.
Original version by Bastian Blank <waldi@debian.org>.
--- a/drivers/tty/hvc/hvc_vio.c
+++ b/drivers/tty/hvc/hvc_vio.c
@@ -48,6 +48,7 @@

View File

@ -1,3 +1,14 @@
From: Bastian Blank <waldi@debian.org>
Subject: DocBook: Make Documentation/DocBook -j clean
Date: Tue, 14 Jun 2006 00:05:06 +0200
Two concurrent calls to cmd_db2man may attempt to compress manual
pages generated by each other. gzip can then fail due to an input
file having already been compressed and removed.
Since dh_compress will compress manual pages later, we don't need
to run gzip here at all.
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index 5a2882d..71c7077 100644
--- a/Documentation/DocBook/Makefile

View File

@ -1,3 +1,16 @@
From: Bastian Blank <waldi@debian.org>
Subject: kbuild: Make the toolchain variables easily overwritable
Date: Sun, 22 Feb 2009 15:39:35 +0100
Allow make variables to be overridden for each flavour by a file in
the build tree, .kernelvariables.
We currently use this for ARCH, KERNELRELEASE, CC, and in some cases
also CROSS_COMPILE, CFLAGS_KERNEL and CFLAGS_MODULE.
This file can only be read after we establish the build tree, and all
use of $(ARCH) needs to be moved after this.
--- a/Makefile
+++ b/Makefile
@@ -198,46 +198,6 @@

View File

@ -0,0 +1,205 @@
From a7a1dde3ec3bc0503a0c5ecbcabf27b42b9f51d0 Mon Sep 17 00:00:00 2001
From: Ben Hutchings <ben@decadent.org.uk>
Date: Tue, 3 Apr 2012 04:07:11 +0100
Subject: [PATCH] Revert "CIFS: Respect negotiated MaxMpxCount"
This reverts commit a3f7edf2fcb8e3e9c530c596a6c07479aeed418b.
It's a high-risk change which hasn't been well-tested yet. Leave it a
while to see if further fixes are needed.
---
fs/cifs/cifsfs.c | 8 ++++----
fs/cifs/cifsglob.h | 10 +++++++---
fs/cifs/cifssmb.c | 9 ++-------
fs/cifs/connect.c | 11 +++++++----
fs/cifs/dir.c | 6 ++----
fs/cifs/file.c | 4 ++--
fs/cifs/transport.c | 4 ++--
7 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index b4c2c99..8f1fe32 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -76,7 +76,7 @@ MODULE_PARM_DESC(cifs_min_small, "Small network buffers in pool. Default: 30 "
unsigned int cifs_max_pending = CIFS_MAX_REQ;
module_param(cifs_max_pending, int, 0444);
MODULE_PARM_DESC(cifs_max_pending, "Simultaneous requests to server. "
- "Default: 32767 Range: 2 to 32767.");
+ "Default: 50 Range: 2 to 256");
unsigned short echo_retries = 5;
module_param(echo_retries, ushort, 0644);
MODULE_PARM_DESC(echo_retries, "Number of echo attempts before giving up and "
@@ -1116,9 +1116,9 @@ init_cifs(void)
if (cifs_max_pending < 2) {
cifs_max_pending = 2;
cFYI(1, "cifs_max_pending set to min of 2");
- } else if (cifs_max_pending > CIFS_MAX_REQ) {
- cifs_max_pending = CIFS_MAX_REQ;
- cFYI(1, "cifs_max_pending set to max of %u", CIFS_MAX_REQ);
+ } else if (cifs_max_pending > 256) {
+ cifs_max_pending = 256;
+ cFYI(1, "cifs_max_pending set to max of 256");
}
rc = cifs_fscache_register();
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index c467ac8..8238aa1 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -55,9 +55,14 @@
/*
* MAX_REQ is the maximum number of requests that WE will send
- * on one socket concurrently.
+ * on one socket concurrently. It also matches the most common
+ * value of max multiplex returned by servers. We may
+ * eventually want to use the negotiated value (in case
+ * future servers can handle more) when we are more confident that
+ * we will not have problems oveloading the socket with pending
+ * write data.
*/
-#define CIFS_MAX_REQ 32767
+#define CIFS_MAX_REQ 50
#define RFC1001_NAME_LEN 15
#define RFC1001_NAME_LEN_WITH_NULL (RFC1001_NAME_LEN + 1)
@@ -258,7 +263,6 @@ struct TCP_Server_Info {
bool session_estab; /* mark when very first sess is established */
u16 dialect; /* dialect index that server chose */
enum securityEnum secType;
- bool oplocks:1; /* enable oplocks */
unsigned int maxReq; /* Clients should submit no more */
/* than maxReq distinct unanswered SMBs to the server when using */
/* multiplexed reads or writes */
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 0e6adac..6600aa2 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -458,10 +458,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifs_ses *ses)
goto neg_err_exit;
}
server->sec_mode = (__u8)le16_to_cpu(rsp->SecurityMode);
- server->maxReq = min_t(unsigned int,
- le16_to_cpu(rsp->MaxMpxCount),
- cifs_max_pending);
- server->oplocks = server->maxReq > 1 ? enable_oplocks : false;
+ server->maxReq = le16_to_cpu(rsp->MaxMpxCount);
server->maxBuf = le16_to_cpu(rsp->MaxBufSize);
server->max_vcs = le16_to_cpu(rsp->MaxNumberVcs);
/* even though we do not use raw we might as well set this
@@ -567,9 +564,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifs_ses *ses)
/* one byte, so no need to convert this or EncryptionKeyLen from
little endian */
- server->maxReq = min_t(unsigned int, le16_to_cpu(pSMBr->MaxMpxCount),
- cifs_max_pending);
- server->oplocks = server->maxReq > 1 ? enable_oplocks : false;
+ server->maxReq = le16_to_cpu(pSMBr->MaxMpxCount);
/* probably no need to store and check maxvcs */
server->maxBuf = le32_to_cpu(pSMBr->MaxBufferSize);
server->max_rw = le32_to_cpu(pSMBr->MaxRawSize);
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 9e0675a..bdb62c8 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -625,10 +625,14 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server)
spin_unlock(&GlobalMid_Lock);
wake_up_all(&server->response_q);
- /* Check if we have blocked requests that need to free. */
+ /*
+ * Check if we have blocked requests that need to free. Note that
+ * cifs_max_pending is normally 50, but can be set at module install
+ * time to as little as two.
+ */
spin_lock(&GlobalMid_Lock);
- if (atomic_read(&server->inFlight) >= server->maxReq)
- atomic_set(&server->inFlight, server->maxReq - 1);
+ if (atomic_read(&server->inFlight) >= cifs_max_pending)
+ atomic_set(&server->inFlight, cifs_max_pending - 1);
/*
* We do not want to set the max_pending too low or we could end up
* with the counter going negative.
@@ -1886,7 +1890,6 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
tcp_ses->noautotune = volume_info->noautotune;
tcp_ses->tcp_nodelay = volume_info->sockopt_tcp_nodelay;
atomic_set(&tcp_ses->inFlight, 0);
- tcp_ses->maxReq = 1; /* enough to send negotiate request */
init_waitqueue_head(&tcp_ses->response_q);
init_waitqueue_head(&tcp_ses->request_q);
INIT_LIST_HEAD(&tcp_ses->pending_mid_q);
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 6937e7c..bf68b4f 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -171,7 +171,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
}
tcon = tlink_tcon(tlink);
- if (tcon->ses->server->oplocks)
+ if (enable_oplocks)
oplock = REQ_OPLOCK;
if (nd)
@@ -492,7 +492,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
{
int xid;
int rc = 0; /* to get around spurious gcc warning, set to zero here */
- __u32 oplock;
+ __u32 oplock = enable_oplocks ? REQ_OPLOCK : 0;
__u16 fileHandle = 0;
bool posix_open = false;
struct cifs_sb_info *cifs_sb;
@@ -518,8 +518,6 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
}
pTcon = tlink_tcon(tlink);
- oplock = pTcon->ses->server->oplocks ? REQ_OPLOCK : 0;
-
/*
* Don't allow the separator character in a path component.
* The VFS will not allow "/", but "\" is allowed by posix.
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 159fcc5..8e02dbd 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -380,7 +380,7 @@ int cifs_open(struct inode *inode, struct file *file)
cFYI(1, "inode = 0x%p file flags are 0x%x for %s",
inode, file->f_flags, full_path);
- if (tcon->ses->server->oplocks)
+ if (enable_oplocks)
oplock = REQ_OPLOCK;
else
oplock = 0;
@@ -505,7 +505,7 @@ static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush)
cFYI(1, "inode = 0x%p file flags 0x%x for %s",
inode, pCifsFile->f_flags, full_path);
- if (tcon->ses->server->oplocks)
+ if (enable_oplocks)
oplock = REQ_OPLOCK;
else
oplock = 0;
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index 99a27cf..0cc9584 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -265,12 +265,12 @@ static int wait_for_free_request(struct TCP_Server_Info *server,
spin_lock(&GlobalMid_Lock);
while (1) {
- if (atomic_read(&server->inFlight) >= server->maxReq) {
+ if (atomic_read(&server->inFlight) >= cifs_max_pending) {
spin_unlock(&GlobalMid_Lock);
cifs_num_waiters_inc(server);
wait_event(server->request_q,
atomic_read(&server->inFlight)
- < server->maxReq);
+ < cifs_max_pending);
cifs_num_waiters_dec(server);
spin_lock(&GlobalMid_Lock);
} else {
--
1.7.9.5

View File

@ -0,0 +1,60 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Wed, 4 Apr 2012 05:32:11 +0100
Subject: [PATCH] Revert "rtc: Provide flag for rtc devices that don't support
UIE"
This reverts commit 61d38cd909ad35ff497bf1a84cd57b2baf6d9c49.
It changes ABI and is only needed for rtc-mpc5121 which we don't
enable.
---
drivers/rtc/interface.c | 5 -----
drivers/rtc/rtc-mpc5121.c | 2 --
include/linux/rtc.h | 3 +--
3 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 565742b..c1edbf8 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -445,11 +445,6 @@ int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled)
if (rtc->uie_rtctimer.enabled == enabled)
goto out;
- if (rtc->uie_unsupported) {
- err = -EINVAL;
- goto out;
- }
-
if (enabled) {
struct rtc_time tm;
ktime_t now, onesec;
diff --git a/drivers/rtc/rtc-mpc5121.c b/drivers/rtc/rtc-mpc5121.c
index 0fc2d22..da60915 100644
--- a/drivers/rtc/rtc-mpc5121.c
+++ b/drivers/rtc/rtc-mpc5121.c
@@ -360,8 +360,6 @@ static int __devinit mpc5121_rtc_probe(struct platform_device *op)
&mpc5200_rtc_ops, THIS_MODULE);
}
- rtc->rtc->uie_unsupported = 1;
-
if (IS_ERR(rtc->rtc)) {
err = PTR_ERR(rtc->rtc);
goto out_free_irq;
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index fcabfb4..93f4d03 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -202,8 +202,7 @@ struct rtc_device
struct hrtimer pie_timer; /* sub second exp, so needs hrtimer */
int pie_enabled;
struct work_struct irqwork;
- /* Some hardware can't support UIE mode */
- int uie_unsupported;
+
#ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL
struct work_struct uie_task;
--
1.7.9.5

View File

@ -0,0 +1,87 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Wed, 4 Apr 2012 02:08:12 +0100
Subject: [PATCH] Revert "x86/ioapic: Add register level checks to detect
bogus io-apic entries"
This reverts commit 273fb194e86b795b08a724c7646d0f694949070b.
It is reported to break Xen support (not sure which domains/modes).
---
arch/x86/kernel/apic/io_apic.c | 40 ++++++++--------------------------------
1 file changed, 8 insertions(+), 32 deletions(-)
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index a25e276..6d939d7 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3963,36 +3963,18 @@ int mp_find_ioapic_pin(int ioapic, u32 gsi)
static __init int bad_ioapic(unsigned long address)
{
if (nr_ioapics >= MAX_IO_APICS) {
- pr_warn("WARNING: Max # of I/O APICs (%d) exceeded (found %d), skipping\n",
- MAX_IO_APICS, nr_ioapics);
+ printk(KERN_WARNING "WARNING: Max # of I/O APICs (%d) exceeded "
+ "(found %d), skipping\n", MAX_IO_APICS, nr_ioapics);
return 1;
}
if (!address) {
- pr_warn("WARNING: Bogus (zero) I/O APIC address found in table, skipping!\n");
+ printk(KERN_WARNING "WARNING: Bogus (zero) I/O APIC address"
+ " found in table, skipping!\n");
return 1;
}
return 0;
}
-static __init int bad_ioapic_register(int idx)
-{
- union IO_APIC_reg_00 reg_00;
- union IO_APIC_reg_01 reg_01;
- union IO_APIC_reg_02 reg_02;
-
- reg_00.raw = io_apic_read(idx, 0);
- reg_01.raw = io_apic_read(idx, 1);
- reg_02.raw = io_apic_read(idx, 2);
-
- if (reg_00.raw == -1 && reg_01.raw == -1 && reg_02.raw == -1) {
- pr_warn("I/O APIC 0x%x registers return all ones, skipping!\n",
- mpc_ioapic_addr(idx));
- return 1;
- }
-
- return 0;
-}
-
void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
{
int idx = 0;
@@ -4009,12 +3991,6 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
ioapics[idx].mp_config.apicaddr = address;
set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address);
-
- if (bad_ioapic_register(idx)) {
- clear_fixmap(FIX_IO_APIC_BASE_0 + idx);
- return;
- }
-
ioapics[idx].mp_config.apicid = io_apic_unique_id(id);
ioapics[idx].mp_config.apicver = io_apic_get_version(idx);
@@ -4035,10 +4011,10 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
if (gsi_cfg->gsi_end >= gsi_top)
gsi_top = gsi_cfg->gsi_end + 1;
- pr_info("IOAPIC[%d]: apic_id %d, version %d, address 0x%x, GSI %d-%d\n",
- idx, mpc_ioapic_id(idx),
- mpc_ioapic_ver(idx), mpc_ioapic_addr(idx),
- gsi_cfg->gsi_base, gsi_cfg->gsi_end);
+ printk(KERN_INFO "IOAPIC[%d]: apic_id %d, version %d, address 0x%x, "
+ "GSI %d-%d\n", idx, mpc_ioapic_id(idx),
+ mpc_ioapic_ver(idx), mpc_ioapic_addr(idx),
+ gsi_cfg->gsi_base, gsi_cfg->gsi_end);
nr_ioapics++;
}
--
1.7.9.5

View File

@ -1,3 +1,10 @@
From: Ben Hutchings <ben@decadent.org.uk>
Subject: sched: Do not enable autogrouping by default
Date: Wed, 16 Mar 2011 03:17:06 +0000
We want to provide the option of autogrouping but without enabling
it by default yet.
--- a/kernel/sched/auto_group.c
+++ b/kernel/sched/auto_group.c
@@ -9,7 +9,7 @@

View File

@ -1,3 +1,10 @@
From: Bastian Blank <waldi@debian.org>
Subject: Allow access to sensitive SysRq keys to be restricted by default
Date: Sun, 14 Feb 2010 16:11:35 +0100
Add a Kconfig variable to set the initial value of the Magic
SysRq mask (sysctl: kernel.sysrq).
--- a/include/linux/sysrq.h
+++ b/include/linux/sysrq.h
@@ -18,7 +18,7 @@

View File

@ -1,3 +1,25 @@
From: Bastian Blank <waldi@debian.org>
Subject: Add debian version information to kernel version string
Date: Sun, 20 May 2007 11:46:51 +0200
Include the package version in /proc/version and the initial log
banner.
Determine the target distribution ($DISTRIBUTION) with lsb_release,
defaulting to Debian.
For distribution binary packages we assume
$DISTRIBUTION_OFFICIAL_BUILD is set. Add $DISTRIBUTION and
$DISTRIBUTION_VERSION after the kernel version (UTS_RELEASE), and
replace the account name used to build the package with
$DISTRIBUTION_UPLOADER.
[bwh: Changed $DISTRIBUTION_UPLOADER to $DISTRIBUTION_MAINTAINER.]
For custom packages built from a linux-source package, read the
package version from version.$DISTRIBUTION and add that after
the kernel version string.
--- a/init/version.c
+++ b/init/version.c
@@ -36,12 +36,31 @@ struct uts_namespace init_uts_ns = {

View File

@ -12,20 +12,20 @@ Remove it.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 7 ++-----
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 6 +-----
drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 3 +--
drivers/net/ethernet/chelsio/cxgb/sge.c | 3 +--
drivers/net/ethernet/neterion/s2io.c | 7 +------
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 7 +++----
drivers/net/ethernet/tehuti/tehuti.c | 9 ++-------
drivers/net/rionet.c | 6 +-----
7 files changed, 11 insertions(+), 31 deletions(-)
7 files changed, 10 insertions(+), 31 deletions(-)
Index: linux-3.2/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
===================================================================
--- linux-3.2.orig/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ linux-3.2/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -2236,11 +2236,8 @@ static netdev_tx_t atl1c_xmit_frame(stru
@@ -2236,11 +2236,7 @@ static netdev_tx_t atl1c_xmit_frame(stru
}
tpd_req = atl1c_cal_tpd_req(skb);
@ -35,7 +35,6 @@ Index: linux-3.2/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
- return NETDEV_TX_LOCKED;
- }
+ spin_lock_irqsave(&adapter->tx_lock, flags);
+
if (atl1c_tpd_avail(adapter, type) < tpd_req) {
/* no enough descriptor, just stop queue */

View File

@ -1,22 +0,0 @@
---
fs/namei.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -679,13 +679,13 @@
return 0;
/* Check parent directory mode and owner. */
- spin_lock(&dentry->d_lock);
+ seq_spin_lock(&dentry->d_lock);
parent = dentry->d_parent->d_inode;
if ((parent->i_mode & (S_ISVTX|S_IWOTH)) == (S_ISVTX|S_IWOTH) &&
parent->i_uid != inode->i_uid) {
error = -EACCES;
}
- spin_unlock(&dentry->d_lock);
+ seq_spin_unlock(&dentry->d_lock);
if (error)
audit_log_link_denied("follow_link", link);

View File

@ -12,7 +12,8 @@ Cc: stable-rt@vger.kernel.org
fs/autofs4/autofs_i.h | 1 +
fs/autofs4/expire.c | 2 +-
fs/dcache.c | 7 ++++---
3 files changed, 6 insertions(+), 4 deletions(-)
fs/namespace.c | 3 ++-
4 files changed, 8 insertions(+), 5 deletions(-)
Index: linux-3.2/fs/autofs4/autofs_i.h
===================================================================
@ -32,13 +33,13 @@ Index: linux-3.2/fs/autofs4/expire.c
+++ linux-3.2/fs/autofs4/expire.c
@@ -170,7 +170,7 @@ again:
parent = p->d_parent;
if (!seq_spin_trylock(&parent->d_lock)) {
seq_spin_unlock(&p->d_lock);
if (!spin_trylock(&parent->d_lock)) {
spin_unlock(&p->d_lock);
- cpu_relax();
+ cpu_chill();
goto relock;
}
seq_spin_unlock(&p->d_lock);
spin_unlock(&p->d_lock);
Index: linux-3.2/fs/dcache.c
===================================================================
--- linux-3.2.orig/fs/dcache.c
@ -54,7 +55,7 @@ Index: linux-3.2/fs/dcache.c
@@ -410,7 +411,7 @@ static inline struct dentry *dentry_kill
if (inode && !spin_trylock(&inode->i_lock)) {
relock:
seq_spin_unlock(&dentry->d_lock);
spin_unlock(&dentry->d_lock);
- cpu_relax();
+ cpu_chill();
return dentry; /* try again with same dentry */
@ -62,19 +63,40 @@ Index: linux-3.2/fs/dcache.c
if (IS_ROOT(dentry))
@@ -796,7 +797,7 @@ relock:
if (!seq_spin_trylock(&dentry->d_lock)) {
if (!spin_trylock(&dentry->d_lock)) {
spin_unlock(&dcache_lru_lock);
- cpu_relax();
+ cpu_chill();
goto relock;
}
@@ -1974,7 +1975,7 @@ again:
@@ -1975,7 +1976,7 @@ again:
if (dentry->d_count == 1) {
if (inode && !spin_trylock(&inode->i_lock)) {
seq_spin_unlock(&dentry->d_lock);
spin_unlock(&dentry->d_lock);
- cpu_relax();
+ cpu_chill();
goto again;
}
dentry->d_flags &= ~DCACHE_CANT_MOUNT;
Index: linux-3.2/fs/namespace.c
===================================================================
--- linux-3.2.orig/fs/namespace.c
+++ linux-3.2/fs/namespace.c
@@ -31,6 +31,7 @@
#include <linux/idr.h>
#include <linux/fs_struct.h>
#include <linux/fsnotify.h>
+#include <linux/delay.h>
#include <asm/uaccess.h>
#include <asm/unistd.h>
#include "pnode.h"
@@ -346,7 +347,7 @@ int mnt_want_write(struct vfsmount *mnt)
*/
while (mnt->mnt_flags & MNT_WRITE_HOLD) {
preempt_enable();
- cpu_relax();
+ cpu_chill();
preempt_disable();
}
/*

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +0,0 @@
Subject: fs: namespace: Use cpu_chill() instead of cpu_relax()
From: Thomas Gleixner <tglx@linutronix.de>
Date: Wed, 07 Mar 2012 21:05:19 +0100
Retry loops on RT might loop forever when the modifying side was
preempted. Use cpu_chill() instead of cpu_relax() to let the system
make progress.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable-rt@vger.kernel.org
---
fs/namespace.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: linux-3.2/fs/namespace.c
===================================================================
--- linux-3.2.orig/fs/namespace.c
+++ linux-3.2/fs/namespace.c
@@ -31,6 +31,7 @@
#include <linux/idr.h>
#include <linux/fs_struct.h>
#include <linux/fsnotify.h>
+#include <linux/delay.h>
#include <asm/uaccess.h>
#include <asm/unistd.h>
#include "pnode.h"
@@ -346,7 +347,7 @@ int mnt_want_write(struct vfsmount *mnt)
*/
while (mnt->mnt_flags & MNT_WRITE_HOLD) {
preempt_enable();
- cpu_relax();
+ cpu_chill();
preempt_disable();
}
/*

View File

@ -1,31 +0,0 @@
Subject: fs: Protect open coded isize seqcount
From: Thomas Gleixner <tglx@linutronix.de>
Date: Thu, 01 Mar 2012 16:12:47 +0100
A writer might be preempted in the write side critical section on
RT. Disable preemption to avoid endless spinning of a preempting
reader.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable-rt@vger.kernel.org
---
include/linux/fs.h | 2 ++
1 file changed, 2 insertions(+)
Index: linux-3.2/include/linux/fs.h
===================================================================
--- linux-3.2.orig/include/linux/fs.h
+++ linux-3.2/include/linux/fs.h
@@ -903,9 +903,11 @@ static inline loff_t i_size_read(const s
static inline void i_size_write(struct inode *inode, loff_t i_size)
{
#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
+ preempt_disable_rt();
write_seqcount_begin(&inode->i_size_seqcount);
inode->i_size = i_size;
write_seqcount_end(&inode->i_size_seqcount);
+ preempt_enable_rt();
#elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPT)
preempt_disable();
inode->i_size = i_size;

View File

@ -1,339 +0,0 @@
Subject: fs: fs_struct use seqlock
From: Thomas Gleixner <tglx@linutronix.de>
Date: Mon, 27 Feb 2012 17:58:13 +0100
Replace the open coded seqlock with a real one, so RT can handle it.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable-rt@vger.kernel.org
---
fs/exec.c | 4 ++--
fs/fhandle.c | 4 ++--
fs/fs_struct.c | 46 ++++++++++++++++++----------------------------
fs/namei.c | 14 +++++++-------
include/linux/fs_struct.h | 16 +++++++---------
kernel/fork.c | 10 +++++-----
6 files changed, 41 insertions(+), 53 deletions(-)
Index: linux-3.2/fs/exec.c
===================================================================
--- linux-3.2.orig/fs/exec.c
+++ linux-3.2/fs/exec.c
@@ -1239,7 +1239,7 @@ int check_unsafe_exec(struct linux_binpr
}
n_fs = 1;
- spin_lock(&p->fs->lock);
+ seq_spin_lock(&p->fs->lock);
rcu_read_lock();
for (t = next_thread(p); t != p; t = next_thread(t)) {
if (t->fs == p->fs)
@@ -1256,7 +1256,7 @@ int check_unsafe_exec(struct linux_binpr
res = 1;
}
}
- spin_unlock(&p->fs->lock);
+ seq_spin_unlock(&p->fs->lock);
return res;
}
Index: linux-3.2/fs/fhandle.c
===================================================================
--- linux-3.2.orig/fs/fhandle.c
+++ linux-3.2/fs/fhandle.c
@@ -115,10 +115,10 @@ static struct vfsmount *get_vfsmount_fro
if (fd == AT_FDCWD) {
struct fs_struct *fs = current->fs;
- spin_lock(&fs->lock);
+ seq_spin_lock(&fs->lock);
path = fs->pwd;
mntget(path.mnt);
- spin_unlock(&fs->lock);
+ seq_spin_unlock(&fs->lock);
} else {
int fput_needed;
struct file *file = fget_light(fd, &fput_needed);
Index: linux-3.2/fs/fs_struct.c
===================================================================
--- linux-3.2.orig/fs/fs_struct.c
+++ linux-3.2/fs/fs_struct.c
@@ -26,13 +26,11 @@ void set_fs_root(struct fs_struct *fs, s
{
struct path old_root;
- spin_lock(&fs->lock);
- write_seqcount_begin(&fs->seq);
+ write_seqlock(&fs->lock);
old_root = fs->root;
fs->root = *path;
path_get_longterm(path);
- write_seqcount_end(&fs->seq);
- spin_unlock(&fs->lock);
+ write_sequnlock(&fs->lock);
if (old_root.dentry)
path_put_longterm(&old_root);
}
@@ -45,13 +43,11 @@ void set_fs_pwd(struct fs_struct *fs, st
{
struct path old_pwd;
- spin_lock(&fs->lock);
- write_seqcount_begin(&fs->seq);
+ write_seqlock(&fs->lock);
old_pwd = fs->pwd;
fs->pwd = *path;
path_get_longterm(path);
- write_seqcount_end(&fs->seq);
- spin_unlock(&fs->lock);
+ write_sequnlock(&fs->lock);
if (old_pwd.dentry)
path_put_longterm(&old_pwd);
@@ -68,8 +64,7 @@ void chroot_fs_refs(struct path *old_roo
task_lock(p);
fs = p->fs;
if (fs) {
- spin_lock(&fs->lock);
- write_seqcount_begin(&fs->seq);
+ write_seqlock(&fs->lock);
if (fs->root.dentry == old_root->dentry
&& fs->root.mnt == old_root->mnt) {
path_get_longterm(new_root);
@@ -82,8 +77,7 @@ void chroot_fs_refs(struct path *old_roo
fs->pwd = *new_root;
count++;
}
- write_seqcount_end(&fs->seq);
- spin_unlock(&fs->lock);
+ write_sequnlock(&fs->lock);
}
task_unlock(p);
} while_each_thread(g, p);
@@ -106,12 +100,10 @@ void exit_fs(struct task_struct *tsk)
if (fs) {
int kill;
task_lock(tsk);
- spin_lock(&fs->lock);
- write_seqcount_begin(&fs->seq);
+ write_seqlock(&fs->lock);
tsk->fs = NULL;
kill = !--fs->users;
- write_seqcount_end(&fs->seq);
- spin_unlock(&fs->lock);
+ write_sequnlock(&fs->lock);
task_unlock(tsk);
if (kill)
free_fs_struct(fs);
@@ -125,16 +117,15 @@ struct fs_struct *copy_fs_struct(struct
if (fs) {
fs->users = 1;
fs->in_exec = 0;
- spin_lock_init(&fs->lock);
- seqcount_init(&fs->seq);
+ seqlock_init(&fs->lock);
fs->umask = old->umask;
- spin_lock(&old->lock);
+ seq_spin_lock(&old->lock);
fs->root = old->root;
path_get_longterm(&fs->root);
fs->pwd = old->pwd;
path_get_longterm(&fs->pwd);
- spin_unlock(&old->lock);
+ seq_spin_unlock(&old->lock);
}
return fs;
}
@@ -149,10 +140,10 @@ int unshare_fs_struct(void)
return -ENOMEM;
task_lock(current);
- spin_lock(&fs->lock);
+ seq_spin_lock(&fs->lock);
kill = !--fs->users;
current->fs = new_fs;
- spin_unlock(&fs->lock);
+ seq_spin_unlock(&fs->lock);
task_unlock(current);
if (kill)
@@ -171,8 +162,7 @@ EXPORT_SYMBOL(current_umask);
/* to be mentioned only in INIT_TASK */
struct fs_struct init_fs = {
.users = 1,
- .lock = __SPIN_LOCK_UNLOCKED(init_fs.lock),
- .seq = SEQCNT_ZERO,
+ .lock = __SEQLOCK_UNLOCKED(init_fs.lock),
.umask = 0022,
};
@@ -185,14 +175,14 @@ void daemonize_fs_struct(void)
task_lock(current);
- spin_lock(&init_fs.lock);
+ seq_spin_lock(&init_fs.lock);
init_fs.users++;
- spin_unlock(&init_fs.lock);
+ seq_spin_unlock(&init_fs.lock);
- spin_lock(&fs->lock);
+ seq_spin_lock(&fs->lock);
current->fs = &init_fs;
kill = !--fs->users;
- spin_unlock(&fs->lock);
+ seq_spin_unlock(&fs->lock);
task_unlock(current);
if (kill)
Index: linux-3.2/fs/namei.c
===================================================================
--- linux-3.2.orig/fs/namei.c
+++ linux-3.2/fs/namei.c
@@ -428,7 +428,7 @@ static int unlazy_walk(struct nameidata
BUG_ON(!(nd->flags & LOOKUP_RCU));
if (nd->root.mnt && !(nd->flags & LOOKUP_ROOT)) {
want_root = 1;
- spin_lock(&fs->lock);
+ seq_spin_lock(&fs->lock);
if (nd->root.mnt != fs->root.mnt ||
nd->root.dentry != fs->root.dentry)
goto err_root;
@@ -458,7 +458,7 @@ static int unlazy_walk(struct nameidata
spin_unlock(&parent->d_lock);
if (want_root) {
path_get(&nd->root);
- spin_unlock(&fs->lock);
+ seq_spin_unlock(&fs->lock);
}
mntget(nd->path.mnt);
@@ -473,7 +473,7 @@ err_parent:
spin_unlock(&parent->d_lock);
err_root:
if (want_root)
- spin_unlock(&fs->lock);
+ seq_spin_unlock(&fs->lock);
return -ECHILD;
}
@@ -567,10 +567,10 @@ static __always_inline void set_root_rcu
unsigned seq;
do {
- seq = read_seqcount_begin(&fs->seq);
+ seq = read_seqbegin(&fs->lock);
nd->root = fs->root;
nd->seq = __read_seqcount_begin(&nd->root.dentry->d_seq);
- } while (read_seqcount_retry(&fs->seq, seq));
+ } while (read_seqretry(&fs->lock, seq));
}
}
@@ -1519,10 +1519,10 @@ static int path_init(int dfd, const char
rcu_read_lock();
do {
- seq = read_seqcount_begin(&fs->seq);
+ seq = read_seqbegin(&fs->lock);
nd->path = fs->pwd;
nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq);
- } while (read_seqcount_retry(&fs->seq, seq));
+ } while (read_seqretry(&fs->lock, seq));
} else {
get_fs_pwd(current->fs, &nd->path);
}
Index: linux-3.2/include/linux/fs_struct.h
===================================================================
--- linux-3.2.orig/include/linux/fs_struct.h
+++ linux-3.2/include/linux/fs_struct.h
@@ -2,13 +2,11 @@
#define _LINUX_FS_STRUCT_H
#include <linux/path.h>
-#include <linux/spinlock.h>
#include <linux/seqlock.h>
struct fs_struct {
int users;
- spinlock_t lock;
- seqcount_t seq;
+ seqlock_t lock;
int umask;
int in_exec;
struct path root, pwd;
@@ -26,29 +24,29 @@ extern int unshare_fs_struct(void);
static inline void get_fs_root(struct fs_struct *fs, struct path *root)
{
- spin_lock(&fs->lock);
+ seq_spin_lock(&fs->lock);
*root = fs->root;
path_get(root);
- spin_unlock(&fs->lock);
+ seq_spin_unlock(&fs->lock);
}
static inline void get_fs_pwd(struct fs_struct *fs, struct path *pwd)
{
- spin_lock(&fs->lock);
+ seq_spin_lock(&fs->lock);
*pwd = fs->pwd;
path_get(pwd);
- spin_unlock(&fs->lock);
+ seq_spin_unlock(&fs->lock);
}
static inline void get_fs_root_and_pwd(struct fs_struct *fs, struct path *root,
struct path *pwd)
{
- spin_lock(&fs->lock);
+ seq_spin_lock(&fs->lock);
*root = fs->root;
path_get(root);
*pwd = fs->pwd;
path_get(pwd);
- spin_unlock(&fs->lock);
+ seq_spin_unlock(&fs->lock);
}
#endif /* _LINUX_FS_STRUCT_H */
Index: linux-3.2/kernel/fork.c
===================================================================
--- linux-3.2.orig/kernel/fork.c
+++ linux-3.2/kernel/fork.c
@@ -825,13 +825,13 @@ static int copy_fs(unsigned long clone_f
struct fs_struct *fs = current->fs;
if (clone_flags & CLONE_FS) {
/* tsk->fs is already what we want */
- spin_lock(&fs->lock);
+ seq_spin_lock(&fs->lock);
if (fs->in_exec) {
- spin_unlock(&fs->lock);
+ seq_spin_unlock(&fs->lock);
return -EAGAIN;
}
fs->users++;
- spin_unlock(&fs->lock);
+ seq_spin_unlock(&fs->lock);
return 0;
}
tsk->fs = copy_fs_struct(fs);
@@ -1717,13 +1717,13 @@ SYSCALL_DEFINE1(unshare, unsigned long,
if (new_fs) {
fs = current->fs;
- spin_lock(&fs->lock);
+ seq_spin_lock(&fs->lock);
current->fs = new_fs;
if (--fs->users)
new_fs = NULL;
else
new_fs = fs;
- spin_unlock(&fs->lock);
+ seq_spin_unlock(&fs->lock);
}
if (new_fd) {

View File

@ -14,4 +14,4 @@ Index: linux-3.2/localversion-rt
--- /dev/null
+++ linux-3.2/localversion-rt
@@ -0,0 +1 @@
+-rt20
+-rt22

View File

@ -1,34 +0,0 @@
Subject: net: u64_stat: Protect seqcount
From: Thomas Gleixner <tglx@linutronix.de>
Date: Thu, 01 Mar 2012 16:16:02 +0100
On RT we must prevent that the writer gets preempted inside the write
section. Otherwise a preempting reader might spin forever.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable-rt@vger.kernel.org
---
include/linux/u64_stats_sync.h | 2 ++
1 file changed, 2 insertions(+)
Index: linux-3.2/include/linux/u64_stats_sync.h
===================================================================
--- linux-3.2.orig/include/linux/u64_stats_sync.h
+++ linux-3.2/include/linux/u64_stats_sync.h
@@ -70,6 +70,7 @@ struct u64_stats_sync {
static inline void u64_stats_update_begin(struct u64_stats_sync *syncp)
{
#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
+ preempt_disable_rt();
write_seqcount_begin(&syncp->seq);
#endif
}
@@ -78,6 +79,7 @@ static inline void u64_stats_update_end(
{
#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
write_seqcount_end(&syncp->seq);
+ preempt_enable_rt();
#endif
}

View File

@ -9,19 +9,56 @@ To prevent this let the reader grab the spinlock, so it blocks and
eventually boosts the writer. This way the writer can proceed and
endless spinning is prevented.
For seqcount writers we disable preemption over the update code
path. Thaanks to Al Viro for distangling some VFS code to make that
possible.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable-rt@vger.kernel.org
---
include/linux/seqlock.h | 23 +++++++++++++++++++++++
include/net/neighbour.h | 2 +-
2 files changed, 24 insertions(+), 1 deletion(-)
include/linux/seqlock.h | 55 +++++++++++++++++++++++++++++++++++++++---------
include/net/neighbour.h | 2 -
2 files changed, 46 insertions(+), 11 deletions(-)
Index: linux-3.2/include/linux/seqlock.h
===================================================================
--- linux-3.2.orig/include/linux/seqlock.h
+++ linux-3.2/include/linux/seqlock.h
@@ -177,10 +177,33 @@ typedef struct {
@@ -125,18 +125,30 @@ static inline int read_seqcount_retry(co
* Sequence counter only version assumes that callers are using their
* own mutexing.
*/
-static inline void write_seqcount_begin(seqcount_t *s)
+static inline void __write_seqcount_begin(seqcount_t *s)
{
s->sequence++;
smp_wmb();
}
-static inline void write_seqcount_end(seqcount_t *s)
+static inline void write_seqcount_begin(seqcount_t *s)
+{
+ preempt_disable_rt();
+ __write_seqcount_begin(s);
+}
+
+static inline void __write_seqcount_end(seqcount_t *s)
{
smp_wmb();
s->sequence++;
}
+static inline void write_seqcount_end(seqcount_t *s)
+{
+ __write_seqcount_end(s);
+ preempt_enable_rt();
+}
+
/**
* write_seqcount_barrier - invalidate in-progress read-side seq operations
* @s: pointer to seqcount_t
@@ -177,10 +189,33 @@ typedef struct {
/*
* Read side functions for starting and finalizing a read side section.
*/
@ -55,6 +92,67 @@ Index: linux-3.2/include/linux/seqlock.h
static inline unsigned read_seqretry(const seqlock_t *sl, unsigned start)
{
@@ -195,36 +230,36 @@ static inline unsigned read_seqretry(con
static inline void write_seqlock(seqlock_t *sl)
{
spin_lock(&sl->lock);
- write_seqcount_begin(&sl->seqcount);
+ __write_seqcount_begin(&sl->seqcount);
}
static inline void write_sequnlock(seqlock_t *sl)
{
- write_seqcount_end(&sl->seqcount);
+ __write_seqcount_end(&sl->seqcount);
spin_unlock(&sl->lock);
}
static inline void write_seqlock_bh(seqlock_t *sl)
{
spin_lock_bh(&sl->lock);
- write_seqcount_begin(&sl->seqcount);
+ __write_seqcount_begin(&sl->seqcount);
}
static inline void write_sequnlock_bh(seqlock_t *sl)
{
- write_seqcount_end(&sl->seqcount);
+ __write_seqcount_end(&sl->seqcount);
spin_unlock_bh(&sl->lock);
}
static inline void write_seqlock_irq(seqlock_t *sl)
{
spin_lock_irq(&sl->lock);
- write_seqcount_begin(&sl->seqcount);
+ __write_seqcount_begin(&sl->seqcount);
}
static inline void write_sequnlock_irq(seqlock_t *sl)
{
- write_seqcount_end(&sl->seqcount);
+ __write_seqcount_end(&sl->seqcount);
spin_unlock_irq(&sl->lock);
}
@@ -233,7 +268,7 @@ static inline unsigned long __write_seql
unsigned long flags;
spin_lock_irqsave(&sl->lock, flags);
- write_seqcount_begin(&sl->seqcount);
+ __write_seqcount_begin(&sl->seqcount);
return flags;
}
@@ -243,7 +278,7 @@ static inline unsigned long __write_seql
static inline void
write_sequnlock_irqrestore(seqlock_t *sl, unsigned long flags)
{
- write_seqcount_end(&sl->seqcount);
+ __write_seqcount_end(&sl->seqcount);
spin_unlock_irqrestore(&sl->lock, flags);
}
Index: linux-3.2/include/net/neighbour.h
===================================================================
--- linux-3.2.orig/include/net/neighbour.h

View File

@ -1,94 +0,0 @@
Subject: seqlock: Provide seq_spin_* functions
From: Thomas Gleixner <tglx@linutronix.de>
Date: Mon, 27 Feb 2012 17:55:11 +0100
In some cases it's desirable to lock the seqlock w/o changing the
seqcount. Provide functions for this, so we can avoid open coded
constructs.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable-rt@vger.kernel.org
---
include/linux/seqlock.h | 64 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
Index: rt/include/linux/seqlock.h
===================================================================
--- rt.orig/include/linux/seqlock.h
+++ rt/include/linux/seqlock.h
@@ -188,6 +188,19 @@ static inline unsigned read_seqretry(con
}
/*
+ * Ditto w/o barriers
+ */
+static inline unsigned __read_seqbegin(const seqlock_t *sl)
+{
+ return __read_seqcount_begin(&sl->seqcount);
+}
+
+static inline unsigned __read_seqretry(const seqlock_t *sl, unsigned start)
+{
+ return __read_seqcount_retry(&sl->seqcount, start);
+}
+
+/*
* Lock out other writers and update the count.
* Acts like a normal spin_lock/unlock.
* Don't need preempt_disable() because that is in the spin_lock already.
@@ -247,4 +260,55 @@ write_sequnlock_irqrestore(seqlock_t *sl
spin_unlock_irqrestore(&sl->lock, flags);
}
+/*
+ * Instead of open coding a spinlock and a seqcount, the following
+ * functions allow to serialize on the seqlock w/o touching seqcount.
+ */
+static inline void seq_spin_lock(seqlock_t *sl)
+{
+ spin_lock(&sl->lock);
+}
+
+static inline int seq_spin_trylock(seqlock_t *sl)
+{
+ return spin_trylock(&sl->lock);
+}
+
+static inline void seq_spin_unlock(seqlock_t *sl)
+{
+ spin_unlock(&sl->lock);
+}
+
+static inline void assert_seq_spin_locked(seqlock_t *sl)
+{
+ assert_spin_locked(&sl->lock);
+}
+
+static inline void seq_spin_lock_nested(seqlock_t *sl, int subclass)
+{
+ spin_lock_nested(&sl->lock, subclass);
+}
+
+/*
+ * For writers which need to take/release the lock w/o updating seqcount for
+ * whatever reasons the following functions allow to update the count
+ * after the lock has been acquired or before it is released.
+ */
+static inline void write_seqlock_begin(seqlock_t *sl)
+{
+ assert_spin_locked(&sl->lock);
+ write_seqcount_begin(&sl->seqcount);
+}
+
+static inline void write_seqlock_end(seqlock_t *sl)
+{
+ assert_spin_locked(&sl->lock);
+ write_seqcount_end(&sl->seqcount);
+}
+
+static inline void write_seqlock_barrier(seqlock_t *sl)
+{
+ write_seqcount_barrier(&sl->seqcount);
+}
+
#endif /* __LINUX_SEQLOCK_H */

View File

@ -5,7 +5,6 @@
############################################################
# UPSTREAM changes queued for 3.3 or 3.2
############################################################
x88-derandom-tsc-delay-64-bit.patch
x86_64-patch-for-idle-notifiers.patch
re-possible-slab-deadlock-while-doing-ifenslave-1.patch
@ -106,9 +105,12 @@ ia64-vdso-use-seqcount.patch
# SEQLOCK
seqlock-remove-unused-functions.patch
seqlock-use-seqcount.patch
seqlock-provide-seq-spin-lock.patch
fs-struct-use-seqlock.patch
fs-dentry-use-seqlock.patch
#seqlock-provide-seq-spin-lock.patch
#fs-struct-use-seqlock.patch
#fs-dentry-use-seqlock.patch
# VFS. Al Viro provided this so we can deal with the seqcount simpler
vfs-fstruct-move-code-out-of-seqcount-write-sections.patch
# RAW SPINLOCKS
timekeeping-split-xtime-lock.patch
@ -578,8 +580,8 @@ cpumask-disable-offstack-on-rt.patch
# Various fixes - fold them back
seqlock-prevent-rt-starvation.patch
fs-protect-opencoded-isize-seqcount.patch
net-u64-stat-protect-seqcount.patch
#fs-protect-opencoded-isize-seqcount.patch
#net-u64-stat-protect-seqcount.patch
rfc-timer-fix-hotplug-for-rt.patch
rfc-futex-rt-fix-possible-lockup-when-taking-pi_lock-in-proxy-handler.patch
rfc-ring-buffer-rt-check-for-irqs-disabled-before-grabbing-reader-lock.patch
@ -592,7 +594,6 @@ softirq-preempt-fix-3-re.txt
rt-introduce-cpu-chill.patch
fs-dcache-use-cpu-chill-in-trylock-loops.patch
fs-more-cpu-chill-fixups.patch
net-use-cpu-chill.patch
# Enable full RT

View File

@ -1,54 +0,0 @@
From 0bf0d69e1a358e93e5c9b256bb18cab4041e7d8f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
Date: Sun, 11 Mar 2012 17:14:22 +0100
Subject: [PATCH RT] staging/pohmelfs: convert struct fs->lock usage to seq_spin_{,un}lock
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This fixes:
drivers/staging/pohmelfs/path_entry.c:47:2: warning: passing argument 1 of rt_spin_lock from incompatible pointer type [enabled by default]
include/linux/spinlock_rt.h:19:56: note: expected struct spinlock_t * but argument is of type struct seqlock_t *
drivers/staging/pohmelfs/path_entry.c:49:2: warning: passing argument 1 of rt_spin_unlock from incompatible pointer type [enabled by default]
include/linux/spinlock_rt.h:22:56: note: expected struct spinlock_t * but argument is of type struct seqlock_t *
drivers/staging/pohmelfs/path_entry.c:95:2: warning: passing argument 1 of rt_spin_lock from incompatible pointer type [enabled by default]
include/linux/spinlock_rt.h:19:56: note: expected struct spinlock_t * but argument is of type struct seqlock_t *
drivers/staging/pohmelfs/path_entry.c:97:2: warning: passing argument 1 of rt_spin_unlock from incompatible pointer type [enabled by default]
include/linux/spinlock_rt.h:22:56: note: expected struct spinlock_t * but argument is of type struct seqlock_t *
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Forwarded: http://mid.gmane.org/1331482999-32252-1-git-send-email-u.kleine-koenig@pengutronix.de
---
drivers/staging/pohmelfs/path_entry.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/pohmelfs/path_entry.c b/drivers/staging/pohmelfs/path_entry.c
index 400a9fc..fc0c3fe 100644
--- a/drivers/staging/pohmelfs/path_entry.c
+++ b/drivers/staging/pohmelfs/path_entry.c
@@ -44,9 +44,9 @@ int pohmelfs_construct_path_string(struct pohmelfs_inode *pi, void *data, int le
return -ENOENT;
}
- spin_lock(&current->fs->lock);
+ seq_spin_lock(&current->fs->lock);
path.mnt = mntget(current->fs->root.mnt);
- spin_unlock(&current->fs->lock);
+ seq_spin_unlock(&current->fs->lock);
path.dentry = d;
@@ -92,9 +92,9 @@ int pohmelfs_path_length(struct pohmelfs_inode *pi)
return -ENOENT;
}
- spin_lock(&current->fs->lock);
+ seq_spin_lock(&current->fs->lock);
root = dget(current->fs->root.dentry);
- spin_unlock(&current->fs->lock);
+ seq_spin_unlock(&current->fs->lock);
rename_retry:
len = 1; /* Root slash */

View File

@ -0,0 +1,85 @@
Subject: vfs: fs_struct: Move code out of seqcount write sections
From: Al Viro <viro@ZenIV.linux.org.uk>
Date: Thu, 15 Mar 2012 18:39:40 +0000
RT cannot disable preemption in the seqcount write sections due to
functions called which take "sleeping" spinlocks.
Move the code out of those sections. It does not need to be there.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
diff --git a/fs/fs_struct.c b/fs/fs_struct.c
index 78b519c..f5818c4 100644
--- a/fs/fs_struct.c
+++ b/fs/fs_struct.c
@@ -26,11 +26,11 @@ void set_fs_root(struct fs_struct *fs, struct path *path)
{
struct path old_root;
+ path_get_longterm(path);
spin_lock(&fs->lock);
write_seqcount_begin(&fs->seq);
old_root = fs->root;
fs->root = *path;
- path_get_longterm(path);
write_seqcount_end(&fs->seq);
spin_unlock(&fs->lock);
if (old_root.dentry)
@@ -45,11 +45,11 @@ void set_fs_pwd(struct fs_struct *fs, struct path *path)
{
struct path old_pwd;
+ path_get_longterm(path);
spin_lock(&fs->lock);
write_seqcount_begin(&fs->seq);
old_pwd = fs->pwd;
fs->pwd = *path;
- path_get_longterm(path);
write_seqcount_end(&fs->seq);
spin_unlock(&fs->lock);
@@ -57,6 +57,14 @@ void set_fs_pwd(struct fs_struct *fs, struct path *path)
path_put_longterm(&old_pwd);
}
+static inline int replace_path(struct path *p, const struct path *old, const struct path *new)
+{
+ if (likely(p->dentry != old->dentry || p->mnt != old->mnt))
+ return 0;
+ *p = *new;
+ return 1;
+}
+
void chroot_fs_refs(struct path *old_root, struct path *new_root)
{
struct task_struct *g, *p;
@@ -68,21 +76,16 @@ void chroot_fs_refs(struct path *old_root, struct path *new_root)
task_lock(p);
fs = p->fs;
if (fs) {
+ int hits = 0;
spin_lock(&fs->lock);
write_seqcount_begin(&fs->seq);
- if (fs->root.dentry == old_root->dentry
- && fs->root.mnt == old_root->mnt) {
- path_get_longterm(new_root);
- fs->root = *new_root;
+ hits += replace_path(&fs->root, old_root, new_root);
+ hits += replace_path(&fs->pwd, old_root, new_root);
+ write_seqcount_end(&fs->seq);
+ while (hits--) {
count++;
- }
- if (fs->pwd.dentry == old_root->dentry
- && fs->pwd.mnt == old_root->mnt) {
path_get_longterm(new_root);
- fs->pwd = *new_root;
- count++;
}
- write_seqcount_end(&fs->seq);
spin_unlock(&fs->lock);
}
task_unlock(p);

View File

@ -52,3 +52,9 @@
+ features/all/fs-hardlink-creation-restrictions.patch
+ features/all/fs-hardlink-creation-restrictions-fix.patch
+ features/all/fs-hardlink-creation-restriction-cleanup.patch
# Temporary, until the original change has been tested some more
+ debian/revert-CIFS-Respect-negotiated-MaxMpxCount.patch
# Temporary, until the Xen regression is fixed
+ debian/revert-x86-ioapic-Add-register-level-checks-to-detec.patch

View File

@ -18,9 +18,7 @@
+ features/all/rt/ia64-vdso-use-seqcount.patch featureset=rt
+ features/all/rt/seqlock-remove-unused-functions.patch featureset=rt
+ features/all/rt/seqlock-use-seqcount.patch featureset=rt
+ features/all/rt/seqlock-provide-seq-spin-lock.patch featureset=rt
+ features/all/rt/fs-struct-use-seqlock.patch featureset=rt
+ features/all/rt/fs-dentry-use-seqlock.patch featureset=rt
+ features/all/rt/vfs-fstruct-move-code-out-of-seqcount-write-sections.patch featureset=rt
+ features/all/rt/timekeeping-split-xtime-lock.patch featureset=rt
+ features/all/rt/intel_idle-convert-i7300_idle_lock-to-raw-spinlock.patch featureset=rt
+ features/all/rt/mm-memcg-shorten-preempt-disabled-section-around-event-checks.patch featureset=rt
@ -252,8 +250,6 @@
+ features/all/rt/dm-make-rt-aware.patch featureset=rt
+ features/all/rt/cpumask-disable-offstack-on-rt.patch featureset=rt
+ features/all/rt/seqlock-prevent-rt-starvation.patch featureset=rt
+ features/all/rt/fs-protect-opencoded-isize-seqcount.patch featureset=rt
+ features/all/rt/net-u64-stat-protect-seqcount.patch featureset=rt
+ features/all/rt/rfc-timer-fix-hotplug-for-rt.patch featureset=rt
+ features/all/rt/rfc-futex-rt-fix-possible-lockup-when-taking-pi_lock-in-proxy-handler.patch featureset=rt
+ features/all/rt/rfc-ring-buffer-rt-check-for-irqs-disabled-before-grabbing-reader-lock.patch featureset=rt
@ -263,9 +259,6 @@
+ features/all/rt/softirq-preempt-fix-3-re.txt featureset=rt
+ features/all/rt/rt-introduce-cpu-chill.patch featureset=rt
+ features/all/rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch featureset=rt
+ features/all/rt/fs-more-cpu-chill-fixups.patch featureset=rt
+ features/all/rt/net-use-cpu-chill.patch featureset=rt
+ features/all/rt/kconfig-disable-a-few-options-rt.patch featureset=rt
+ features/all/rt/kconfig-preempt-rt-full.patch featureset=rt
+ features/all/rt/fix-rt+link-creation-restrictions featureset=rt
+ features/all/rt/staging-pohmelfs-convert-struct-fs-lock-usage-to-.patch featureset=rt