3.3.1-stable review
Subsystems (101)
Greg KH
maintainerPATCH 153/175 backlight: fix typo in tosa_lcd.c
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masanari Iida <[email protected]>
commit 8da00edc1069f01c34510fa405dc15d96c090a3f upstream.
Fix typo in drivers/video/backlight/tosa_lcd.c
"tosa_lcd_reume" should be "tosa_lcd_resume".
--- drivers/video/backlight/tosa_lcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/backlight/tosa_lcd.c +1 -1
@@ -271,7 +271,7 @@ static int tosa_lcd_resume(struct spi_de }#else #define tosa_lcd_suspend NULL -#define tosa_lcd_reume NULL +#define tosa_lcd_resume NULL#endif static struct spi_driver tosa_lcd_driver = {
Greg KH
maintainerPATCH 154/175 xfs: Fix oops on IO error during xlog_recover_process_iunlinks()
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit d97d32edcd732110758799ae60af725e5110b3dc upstream.
When an IO error happens during inode deletion run from xlog_recover_process_iunlinks() filesystem gets shutdown. Thus any subsequent attempt to read buffers fails. Code in xlog_recover_process_iunlinks() does not count with the fact that read of a buffer which was read a while ago can really fail which results in the oops on
agi = XFS_BUF_TO_AGI(agibp);
Fix the problem by cleaning up the buffer handling in xlog_recover_process_iunlinks() as suggested by Dave Chinner. We release buffer lock but keep buffer reference to AG buffer. That is enough for buffer to stay pinned in memory and we don't have to call xfs_read_agi() all the time.
--- fs/xfs/xfs_log_recover.c | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-)
fs/xfs/xfs_log_recover.c +11 -22
@@ -3161,37 +3161,26 @@ xlog_recover_process_iunlinks(*/ continue ; } +/* +* Unlock the buffer so that it can be acquired in the normal +* course of the transaction to truncate and free each inode. +* Because we are not racing with anyone else here for the AGI +* buffer, we don't even need to hold it locked to read the +* initial unlinked bucket entries out of the buffer. We keep +* buffer reference though, so that it stays pinned in memory +* while we need the buffer. +*/ agi =XFS_BUF_TO_AGI (agibp); +xfs_buf_unlock (agibp);for (bucket =0 ; bucket <XFS_AGI_UNLINKED_BUCKETS ; bucket++) { agino =be32_to_cpu (agi->agi_unlinked[bucket]);while (agino !=NULLAGINO ) { -/* -* Release the agi buffer so that it can -* be acquired in the normal course of the -* transaction to truncate and free the inode. -*/ -xfs_buf_relse (agibp); - agino =xlog_recover_process_one_iunlink (mp, agno, agino, bucket); - -/* -* Reacquire the agibuffer and continue around -* the loop. This should never fail as we know -* the buffer was good earlier on. -*/ - error =xfs_read_agi (mp,NULL , agno, &agibp); -ASSERT (error ==0 ); - agi =XFS_BUF_TO_AGI (agibp); } } - -/* -* Release the buffer for the current agi so we can -* go on to the next one. -*/ -xfs_buf_relse (agibp); +xfs_buf_rele (agibp); } mp->m_dmevmask = mp_dmevmask;
Greg KH
maintainerPATCH 155/175 slub: Do not hold slub_lock when calling sysfs_slab_add()
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Lameter <[email protected]>
commit 66c4c35c6bc5a1a452b024cf0364635b28fd94e4 upstream.
sysfs_slab_add() calls various sysfs functions that actually may end up in userspace doing all sorts of things.
Release the slub_lock after adding the kmem_cache structure to the list. At that point the address of the kmem_cache is not known so we are guaranteed exlusive access to the following modifications to the kmem_cache structure.
If the sysfs_slab_add fails then reacquire the slub_lock to remove the kmem_cache structure from the list.
--- mm/slub.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
mm/slub.c +2 -1
@@ -3929,13 +3929,14 @@ struct kmem_cache *kmem_cache_create(conif (kmem_cache_open (s, n, size, align, flags, ctor)) {list_add (&s->list, &slab_caches); +up_write (&slub_lock);if (sysfs_slab_add (s)) { +down_write (&slub_lock);list_del (&s->list);kfree (n);kfree (s); goto err; } -up_write (&slub_lock);return s; }kfree (n);
Greg KH
maintainerPATCH 156/175 NFSv4: Fix two infinite loops in the mount code
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit 05e9cfb408b24debb3a85fd98edbfd09dd148881 upstream.
We can currently loop forever in nfs4_lookup_root() and in nfs41_proc_secinfo_no_name(), if the first iteration returns a NFS4ERR_DELAY or something else that causes exception.retry to get set.
--- fs/nfs/nfs4proc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/nfs/nfs4proc.c +4 -2
@@ -2249,11 +2249,12 @@ static int nfs4_lookup_root(struct nfs_sswitch (err) {case 0 :case -NFS4ERR_WRONGSEC : -break ; + goto out;default : err =nfs4_handle_exception (server, err, &exception); } }while (exception.retry); +out:return err; }
@@ -6068,11 +6069,12 @@ nfs41_proc_secinfo_no_name(struct nfs_secase 0 :case -NFS4ERR_WRONGSEC :case -NFS4ERR_NOTSUPP : -break ; + goto out;default : err =nfs4_handle_exception (server, err, &exception); } }while (exception.retry); +out:return err; }
Greg KH
maintainerPATCH 157/175 NFSv4.1: Fix layoutcommit error handling
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit e59d27e05a6435f8c04d5ad843f37fa795f2eaaa upstream.
Firstly, task->tk_status will always return negative error values, so the current tests for 'NFS4ERR_DELEG_REVOKED' etc. are all being ignored.
Secondly, clean up the code so that we only need to test task->tk_status once!
--- fs/nfs/nfs4proc.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-)
fs/nfs/nfs4proc.c +13 -12
@@ -5952,21 +5952,22 @@ nfs4_layoutcommit_done(struct rpc_task *return ;switch (task->tk_status) {/* Just ignore these failures */ -case NFS4ERR_DELEG_REVOKED :/* layout was recalled */ -case NFS4ERR_BADIOMODE :/* no IOMODE_RW layout for range */ -case NFS4ERR_BADLAYOUT :/* no layout */ -case NFS4ERR_GRACE :/* loca_recalim always false */ +case -NFS4ERR_DELEG_REVOKED :/* layout was recalled */ +case -NFS4ERR_BADIOMODE :/* no IOMODE_RW layout for range */ +case -NFS4ERR_BADLAYOUT :/* no layout */ +case -NFS4ERR_GRACE :/* loca_recalim always false */ task->tk_status =0 ; - } - -if (nfs4_async_handle_error (task, server,NULL ) == -EAGAIN ) { -rpc_restart_call_prepare (task); -return ; - } - -if (task->tk_status ==0 ) +break ; +case 0 :nfs_post_op_update_inode_force_wcc (data->args.inode, data->res.fattr); +break ; +default : +if (nfs4_async_handle_error (task, server,NULL ) == -EAGAIN ) { +rpc_restart_call_prepare (task); +return ; + } + } }static void nfs4_layoutcommit_release (void *calldata)
Greg KH
maintainerPATCH 158/175 module: Remove module size limit
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sasha Levin <[email protected]>
commit f946eeb9313ff1470758e171a60fe7438a2ded3f upstream.
Module size was limited to 64MB, this was legacy limitation due to vmalloc() which was removed a while ago.
Limiting module size to 64MB is both pointless and affects real world use cases.
--- kernel/module.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/module.c +1 -2
@@ -2380,8 +2380,7 @@ static int copy_and_check(struct load_inreturn -ENOEXEC ;/* Suck in entire file: we'll want most of it. */ -/* vmalloc barfs on "unusual" numbers. Check here */ -if (len >64 *1024 *1024 || (hdr =vmalloc (len)) ==NULL ) +if ((hdr =vmalloc (len)) ==NULL )return -ENOMEM ;if (copy_from_user (hdr, umod, len) !=0 ) {
Greg KH
maintainerPATCH 159/175 drm/i915: suspend fbdev device around suspend/hibernate
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Airlie <[email protected]>
commit 3fa016a0b5c5237e9c387fc3249592b2cb5391c6 upstream.
Looking at hibernate overwriting I though it looked like a cursor, so I tracked down this missing piece to stop the cursor blink timer. I've no idea if this is sufficient to fix the hibernate problems people are seeing, but please test it.
Both radeon and nouveau have done this for a long time.
I've run this personally all night hib/resume cycles with no fails.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=37142
--- drivers/gpu/drm/i915/i915_drv.c | 7 +++++++ drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_fb.c | 10 ++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.c +7 -0
@@ -442,6 +442,10 @@ static int i915_drm_freeze(struct drm_de/* Modeset on resume, not lid events */ dev_priv->modeset_on_lid =0 ; +console_lock (); +intel_fbdev_set_suspend (dev,1 ); +console_unlock (); +return 0 ; }
@@ -514,6 +518,9 @@ static int i915_drm_thaw(struct drm_devi dev_priv->modeset_on_lid =0 ; +console_lock (); +intel_fbdev_set_suspend (dev,0 ); +console_unlock ();return error; }
drivers/gpu/drm/i915/intel_drv.h +1 -1
@@ -381,7 +381,7 @@ extern int intel_framebuffer_init(struct struct drm_i915_gem_object *obj);extern int intel_fbdev_init (struct drm_device *dev);extern void intel_fbdev_fini (struct drm_device *dev); - +extern void intel_fbdev_set_suspend (struct drm_device *dev,int state);extern void intel_prepare_page_flip (struct drm_device *dev,int plane);extern void intel_finish_page_flip (struct drm_device *dev,int pipe);extern void intel_finish_page_flip_plane (struct drm_device *dev,int plane);
drivers/gpu/drm/i915/intel_fb.c +10 -0
@@ -258,6 +258,16 @@ void intel_fbdev_fini(struct drm_devicekfree (dev_priv->fbdev); dev_priv->fbdev =NULL ; } + +void intel_fbdev_set_suspend (struct drm_device *dev,int state) +{ +drm_i915_private_t *dev_priv = dev->dev_private; +if (!dev_priv->fbdev) +return ; + +fb_set_suspend (dev_priv->fbdev->helper.fbdev, state); +} +MODULE_LICENSE ("GPL and additional rights" );void intel_fb_output_poll_changed (struct drm_device *dev)
Greg KH
maintainerPATCH 160/175 net: bpf_jit: fix BPF_S_LDX_B_MSH compilation
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit dc72d99dabb870ca5bd6d9fff674be853bb4a88d ]
Matt Evans spotted that x86 bpf_jit was incorrectly handling negative constant offsets in BPF_S_LDX_B_MSH instruction.
We need to abort JIT compilation like we do in common_load so that filter uses the interpreter code and can call __load_pointer()
Reference: http://lists.openwall.net/netdev/2011/07/19/11
Thanks to Indan Zupancic to bring back this issue.
--- arch/x86/net/bpf_jit_comp.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
arch/x86/net/bpf_jit_comp.c +5 -9
@@ -475,8 +475,10 @@ void bpf_jit_compile(struct sk_filter *fcase BPF_S_LD_W_ABS : func = sk_load_word; common_load: seen |=SEEN_DATAREF ; -if ((int )K <0 ) +if ((int )K <0 ) { +/* Abort the JIT because __load_pointer() is needed. */ goto out; + } t_offset = func - (image + addrs[i]);EMIT1_off32 (0xbe ,K );/* mov imm32,%esi */ EMIT1_off32 (0xe8 , t_offset);/* call */
@@ -489,14 +491,8 @@ common_load: seen |= SEEN_DATAREF; goto common_load;case BPF_S_LDX_B_MSH :if ((int )K <0 ) { -if (pc_ret0 >0 ) { -/* addrs[pc_ret0 - 1] is the start address */ -EMIT_JMP (addrs[pc_ret0 -1 ] - addrs[i]); -break ; - } -CLEAR_A (); -EMIT_JMP (cleanup_addr - addrs[i]); -break ; +/* Abort the JIT because __load_pointer() is needed. */ + goto out; } seen |=SEEN_DATAREF |SEEN_XREG ; t_offset = sk_load_byte_msh - (image + addrs[i]);
Greg KH
maintainerPATCH 161/175 ipv6: fix incorrent ipv6 ipsec packet fragment
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gao feng <[email protected]>
[ Upstream commit 1f85851e17b64cabd089a8a8839dddebc627948c ]
Since commit 299b0767(ipv6: Fix IPsec slowpath fragmentation problem) In func ip6_append_data,after call skb_put(skb, fraglen + dst_exthdrlen) the skb->len contains dst_exthdrlen,and we don't reduce dst_exthdrlen at last This will make fraggap>0 in next "while cycle",and cause the size of skb incorrent
Fix this by reserve headroom for dst_exthdrlen.
--- net/ipv6/ip6_output.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
net/ipv6/ip6_output.c +6 -5
@@ -1416,8 +1416,9 @@ alloc_new_skb:*/ skb->ip_summed = csummode; skb->csum =0 ; -/* reserve for fragmentation */ -skb_reserve (skb, hh_len+sizeof (struct frag_hdr )); +/* reserve for fragmentation and ipsec header */ +skb_reserve (skb, hh_len +sizeof (struct frag_hdr ) + + dst_exthdrlen);if (sk->sk_type ==SOCK_DGRAM )skb_shinfo (skb)->tx_flags = tx_flags;
@@ -1425,9 +1426,9 @@ alloc_new_skb:/* * Find where to start putting bytes */ - data =skb_put (skb, fraglen + dst_exthdrlen); -skb_set_network_header (skb, exthdrlen + dst_exthdrlen); - data += fragheaderlen + dst_exthdrlen; + data =skb_put (skb, fraglen); +skb_set_network_header (skb, exthdrlen); + data += fragheaderlen; skb->transport_header = (skb->network_header + fragheaderlen);if (fraggap) {
Greg KH
maintainerPATCH 162/175 Remove printk from rds_sendmsg
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jones <[email protected]>
[ Upstream commit a6506e1486181975d318344143aca722b2b91621 ]
no socket layer outputs a message for this error and neither should rds.
--- net/rds/send.c | 1 - 1 file changed, 1 deletion(-)
net/rds/send.c +0 -1
@@ -935,7 +935,6 @@ int rds_sendmsg(struct kiocb *iocb, stru/* Mirror Linux UDP mirror of BSD error message compatibility */ /* XXX: Perhaps MSG_MORE someday */ if (msg->msg_flags & ~(MSG_DONTWAIT |MSG_CMSG_COMPAT )) { -printk (KERN_INFO "msg_flags 0x%08X\n" , msg->msg_flags); ret = -EOPNOTSUPP ; goto out; }
Greg KH
maintainerPATCH 163/175 Fix pppol2tp getsockname()
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin LaHaise <[email protected]>
[ Upstream commit bbdb32cb5b73597386913d052165423b9d736145 ]
While testing L2TP functionality, I came across a bug in getsockname(). The IP address returned within the pppol2tp_addr's addr memember was not being set to the IP address in use. This bug is caused by using inet_sk() on the wrong socket (the L2TP socket rather than the underlying UDP socket), and was likely introduced during the addition of L2TPv3 support.
--- net/l2tp/l2tp_ppp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/l2tp/l2tp_ppp.c +1 -1
@@ -915,7 +915,7 @@ static int pppol2tp_getname(struct socke goto end_put_sess; } - inet =inet_sk (sk); + inet =inet_sk (tunnel->sock);if (tunnel->version ==2 ) {struct sockaddr_pppol2tp sp; len =sizeof (sp);
Greg KH
maintainerPATCH 164/175 net: fix napi_reuse_skb() skb reserve
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 2a2a459eeeff48640dc557548ce576d666ab06ed ]
napi->skb is allocated in napi_get_frags() using netdev_alloc_skb_ip_align(), with a reserve of NET_SKB_PAD + NET_IP_ALIGN bytes.
However, when such skb is recycled in napi_reuse_skb(), it ends with a reserve of NET_IP_ALIGN which is suboptimal.
--- net/core/dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/core/dev.c +2 -1
@@ -3569,7 +3569,8 @@ EXPORT_SYMBOL(napi_gro_receive);static void napi_reuse_skb (struct napi_struct *napi,struct sk_buff *skb) {__skb_pull (skb,skb_headlen (skb)); -skb_reserve (skb,NET_IP_ALIGN -skb_headroom (skb)); +/* restore the reserve we had after netdev_alloc_skb_ip_align() */ +skb_reserve (skb,NET_SKB_PAD +NET_IP_ALIGN -skb_headroom (skb)); skb->vlan_tci =0 ; skb->dev = napi->dev; skb->skb_iif =0 ;
Greg KH
maintainerPATCH 165/175 sky2: override for PCI legacy power management
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: stephen hemminger <[email protected]>
[ Upstream commit 5676cc7bfe1e388e87843f71daa229610385b41e ]
Some BIOS's don't setup power management correctly (what else is new) and don't allow use of PCI Express power control. Add a special exception module parameter to allow working around this issue. Based on slightly different patch by Knut Petersen.
--- drivers/net/ethernet/marvell/sky2.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/net/ethernet/marvell/sky2.c +11 -0
@@ -95,6 +95,10 @@ static int disable_msi = 0;module_param (disable_msi, int,0 );MODULE_PARM_DESC (disable_msi,"Disable Message Signaled Interrupt (MSI)" ); +static int legacy_pme =0 ; +module_param (legacy_pme, int,0 ); +MODULE_PARM_DESC (legacy_pme,"Legacy power management" ); +static DEFINE_PCI_DEVICE_TABLE (sky2_id_table) = { {PCI_DEVICE (PCI_VENDOR_ID_SYSKONNECT ,0x9000 ) },/* SK-9Sxx */ {PCI_DEVICE (PCI_VENDOR_ID_SYSKONNECT ,0x9E00 ) },/* SK-9Exx */
@@ -867,6 +871,13 @@ static void sky2_wol_init(struct sky2_po/* Disable PiG firmware */ sky2_write16 (hw,B0_CTST ,Y2_HW_WOL_OFF ); +/* Needed by some broken BIOSes, use PCI rather than PCI-e for WOL */ +if (legacy_pme) { +u32 reg1 =sky2_pci_read32 (hw,PCI_DEV_REG1 ); + reg1 |=PCI_Y2_PME_LEGACY ; +sky2_pci_write32 (hw,PCI_DEV_REG1 , reg1); + } +/* block receiver */ sky2_write8 (hw,SK_REG (port,RX_GMF_CTRL_T ),GMF_RST_SET );sky2_read32 (hw,B0_CTST );
Greg KH
maintainerPATCH 166/175 xfrm: Access the replay notify functions via the registered callbacks
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steffen Klassert <[email protected]>
[ Upstream commit 1265fd616782ef03b98fd19f65c2b47fcd4ea11f ]
We call the wrong replay notify function when we use ESN replay handling. This leads to the fact that we don't send notifications if we use ESN. Fix this by calling the registered callbacks instead of xfrm_replay_notify().
--- net/xfrm/xfrm_replay.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/xfrm/xfrm_replay.c +3 -3
@@ -167,7 +167,7 @@ static void xfrm_replay_advance(struct x }if (xfrm_aevent_is_on (xs_net (x))) -xfrm_replay_notify (x,XFRM_REPLAY_UPDATE ); + x->repl->notify (x,XFRM_REPLAY_UPDATE ); }static int xfrm_replay_overflow_bmp (struct xfrm_state *x,struct sk_buff *skb)
@@ -279,7 +279,7 @@ static void xfrm_replay_advance_bmp(stru replay_esn->bmp[nr] |= (1U << bitnr);if (xfrm_aevent_is_on (xs_net (x))) -xfrm_replay_notify (x,XFRM_REPLAY_UPDATE ); + x->repl->notify (x,XFRM_REPLAY_UPDATE ); }static void xfrm_replay_notify_bmp (struct xfrm_state *x,int event)
@@ -473,7 +473,7 @@ static void xfrm_replay_advance_esn(stru replay_esn->bmp[nr] |= (1U << bitnr);if (xfrm_aevent_is_on (xs_net (x))) -xfrm_replay_notify (x,XFRM_REPLAY_UPDATE ); + x->repl->notify (x,XFRM_REPLAY_UPDATE ); }static struct xfrm_replay xfrm_replay_legacy = {
Greg KH
maintainerPATCH 167/175 net: fix a potential rcu_read_lock() imbalance in rt6_fill_node()
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 94f826b8076e2cb92242061e92f21b5baa3eccc2 ]
Commit f2c31e32b378 (net: fix NULL dereferences in check_peer_redir() ) added a regression in rt6_fill_node(), leading to rcu_read_lock() imbalance.
Thats because NLA_PUT() can make a jump to nla_put_failure label.
Fix this by using nla_put()
Many thanks to Ben Greear for his help
--- net/ipv6/route.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
net/ipv6/route.c +6 -2
@@ -2461,8 +2461,12 @@ static int rt6_fill_node(struct net *netrcu_read_lock (); n =dst_get_neighbour_noref (&rt->dst); -if (n) -NLA_PUT (skb,RTA_GATEWAY ,16 , &n->primary_key); +if (n) { +if (nla_put (skb,RTA_GATEWAY ,16 , &n->primary_key) <0 ) { +rcu_read_unlock (); + goto nla_put_failure; + } + }rcu_read_unlock ();if (rt->dst.dev)
Greg KH
maintainerPATCH 168/175 lockd: fix arg parsing for grace_period and timeout.
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
commit de5b8e8e047534aac6bc9803f96e7257436aef9c upstream.
If you try to set grace_period or timeout via a module parameter to lockd, and do this on a big-endian machine where
sizeof(int) != sizeof(unsigned long)
it won't work. This number given will be effectively shifted right by the difference in those two sizes.
So cast kp->arg properly to get correct result.
--- fs/lockd/svc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/lockd/svc.c +1 -1
@@ -440,7 +440,7 @@ static int param_set_##name(const char *__typeof__ (type) num =which_strtol (val, &endp,0 ); \if (endp == val || *endp || num < (min) || num > (max)) \return -EINVAL ; \ - *((int *) kp->arg) = num; \ + *((type *) kp->arg) = num; \return 0 ; \ }
Greg KH
maintainerPATCH 169/175 x86, tsc: Skip refined tsc calibration on systems with reliable TSC
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alok Kataria <[email protected]>
commit 57779dc2b3b75bee05ef5d1ada47f615f7a13932 upstream.
While running the latest Linux as guest under VMware in highly over-committed situations, we have seen cases when the refined TSC algorithm fails to get a valid tsc_start value in tsc_refine_calibration_work from multiple attempts. As a result the kernel keeps on scheduling the tsc_irqwork task for later. Subsequently after several attempts when it gets a valid start value it goes through the refined calibration and either bails out or uses the new results. Given that the kernel originally read the TSC frequency from the platform, which is the best it can get, I don't think there is much value in refining it.
So for systems which get the TSC frequency from the platform we should skip the refined tsc algorithm.
We can use the TSC_RELIABLE cpu cap flag to detect this, right now it is set only on VMware and for Moorestown Penwell both of which have there own TSC calibration methods.
[jstultz: Reworked to simply not schedule the refining work, rather then scheduling the work and bombing out later]
--- arch/x86/kernel/tsc.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/x86/kernel/tsc.c +10 -0
@@ -932,6 +932,16 @@ static int __init init_tsc_clocksource(v clocksource_tsc.rating =0 ; clocksource_tsc.flags &= ~CLOCK_SOURCE_IS_CONTINUOUS ; } + +/* +* Trust the results of the earlier calibration on systems +* exporting a reliable TSC. +*/ +if (boot_cpu_has (X86_FEATURE_TSC_RELIABLE )) { +clocksource_register_khz (&clocksource_tsc, tsc_khz); +return 0 ; + } +schedule_delayed_work (&tsc_irqwork,0 );return 0 ; }
Greg KH
maintainerPATCH 170/175 x86, tls: Off by one limit check
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 8f0750f19789cf352d7e24a6cc50f2ab1b4f1372 upstream.
These are used as offsets into an array of GDT_ENTRY_TLS_ENTRIES members so GDT_ENTRY_TLS_ENTRIES is one past the end of the array.
--- arch/x86/kernel/tls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/tls.c +2 -2
@@ -163,7 +163,7 @@ int regset_tls_get(struct task_struct *t {const struct desc_struct *tls; -if (pos >GDT_ENTRY_TLS_ENTRIES *sizeof (struct user_desc ) || +if (pos >=GDT_ENTRY_TLS_ENTRIES *sizeof (struct user_desc ) || (pos %sizeof (struct user_desc )) !=0 || (count %sizeof (struct user_desc )) !=0 )return -EINVAL ;
@@ -198,7 +198,7 @@ int regset_tls_set(struct task_struct *tstruct user_desc infobuf[GDT_ENTRY_TLS_ENTRIES ];const struct user_desc *info; -if (pos >GDT_ENTRY_TLS_ENTRIES *sizeof (struct user_desc ) || +if (pos >=GDT_ENTRY_TLS_ENTRIES *sizeof (struct user_desc ) || (pos %sizeof (struct user_desc )) !=0 || (count %sizeof (struct user_desc )) !=0 )return -EINVAL ;
Greg KH
maintainerPATCH 171/175 compat: use sys_sendfile64() implementation for sendfile syscall
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Metcalf <[email protected]>
commit 1631fcea8399da5e80a80084b3b8c5bfd99d21e7 upstream.
<asm-generic/unistd.h> was set up to use sys_sendfile() for the 32-bit compat API instead of sys_sendfile64(), but in fact the right thing to do is to use sys_sendfile64() in all cases. The 32-bit sendfile64() API in glibc uses the sendfile64 syscall, so it has to be capable of doing full 64-bit operations. But the sys_sendfile() kernel implementation has a MAX_NON_LFS test in it which explicitly limits the offset to 2^32. So, we need to use the sys_sendfile64() implementation in the kernel for this case.
--- include/asm-generic/unistd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/asm-generic/unistd.h +1 -1
@@ -218,7 +218,7 @@ __SC_COMP(__NR_pwritev, sys_pwritev, com/* fs/sendfile.c */ #define __NR3264_sendfile 71 -__SC_3264 (__NR3264_sendfile, sys_sendfile64, sys_sendfile) +__SYSCALL (__NR3264_sendfile, sys_sendfile64) /* fs/select.c */#define __NR_pselect6 72
Greg KH
maintainerPATCH 172/175 rtc: Provide flag for rtc devices that dont support UIE
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Stultz <[email protected]>
commit 4a649903f91232d02284d53724b0a45728111767 upstream.
Richard Weinberger noticed that on some RTC hardware that doesn't support UIE mode, due to coarse granular alarms (like 1minute resolution), the current virtualized RTC support doesn't properly error out when UIE is enabled.
Instead the current code queues an alarm for the next second, but it won't fire until up to a miniute later.
This patch provides a generic way to flag this sort of hardware and fixes the issue on the mpc5121 where Richard noticed the problem.
--- drivers/rtc/interface.c | 5 +++++ drivers/rtc/rtc-mpc5121.c | 2 ++ include/linux/rtc.h | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-)
drivers/rtc/interface.c +5 -0
@@ -445,6 +445,11 @@ int rtc_update_irq_enable(struct rtc_devif (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;
drivers/rtc/rtc-mpc5121.c +2 -0
@@ -360,6 +360,8 @@ static int __devinit mpc5121_rtc_probe(s &mpc5200_rtc_ops, THIS_MODULE); } + rtc->rtc->uie_unsupported =1 ; +if (IS_ERR (rtc->rtc)) { err =PTR_ERR (rtc->rtc); goto out_free_irq;
include/linux/rtc.h +2 -1
@@ -202,7 +202,8 @@ struct rtc_devicestruct 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;
Greg KH
maintainerPATCH 173/175 nfsd: dont allow zero length strings in cache_parse()
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 6d8d17499810479eabd10731179c04b2ca22152f upstream.
There is no point in passing a zero length string here and quite a few of that cache_parse() implementations will Oops if count is zero.
--- net/sunrpc/cache.c | 2 ++ 1 file changed, 2 insertions(+)
net/sunrpc/cache.c +2 -0
@@ -828,6 +828,8 @@ static ssize_t cache_do_downcall(char *k {ssize_t ret; +if (count ==0 ) +return -EINVAL ;if (copy_from_user (kaddr, buf, count))return -EFAULT ; kaddr[count] ='\0' ;
Greg KH
maintainerPATCH 174/175 ARM: tegra: Fix device tree AUXDATA for USB/EHCI
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Warren <[email protected]>
commit 8c3ec84102d171a24f050a086bfc546e9de93f9f upstream.
Commit 4a53f4e "USB: ehci-tegra: add probing through device tree" added AUXDATA for Tegra's USB/EHCI controller. However, it pointed the platform data at a location containing the address of the intended platform data, rather than the platform data itself. This change fixes that.
--- arch/arm/mach-tegra/board-dt-tegra20.c | 6 +++--- arch/arm/mach-tegra/devices.c | 7 +++---- arch/arm/mach-tegra/devices.h | 5 +++++ 3 files changed, 11 insertions(+), 7 deletions(-)
arch/arm/mach-tegra/board-dt-tegra20.c +3 -3
@@ -68,11 +68,11 @@ struct of_dev_auxdata tegra20_auxdata_loOF_DEV_AUXDATA ("nvidia,tegra20-i2s" ,TEGRA_I2S2_BASE ,"tegra-i2s.1" ,NULL ),OF_DEV_AUXDATA ("nvidia,tegra20-das" ,TEGRA_APB_MISC_DAS_BASE ,"tegra-das" ,NULL ),OF_DEV_AUXDATA ("nvidia,tegra20-ehci" ,TEGRA_USB_BASE ,"tegra-ehci.0" , - &tegra_ehci1_device.dev.platform_data), + &tegra_ehci1_pdata),OF_DEV_AUXDATA ("nvidia,tegra20-ehci" ,TEGRA_USB2_BASE ,"tegra-ehci.1" , - &tegra_ehci2_device.dev.platform_data), + &tegra_ehci2_pdata),OF_DEV_AUXDATA ("nvidia,tegra20-ehci" ,TEGRA_USB3_BASE ,"tegra-ehci.2" , - &tegra_ehci3_device.dev.platform_data), + &tegra_ehci3_pdata), {} };
arch/arm/mach-tegra/devices.c +3 -4
@@ -23,7 +23,6 @@#include <linux/fsl_devices.h> #include <linux/serial_8250.h> #include <linux/i2c-tegra.h> -#include <linux/platform_data/tegra_usb.h> #include <asm/pmu.h> #include <mach/irqs.h> #include <mach/iomap.h>
@@ -446,18 +445,18 @@ static struct tegra_ulpi_config tegra_eh .clk = "cdev2", }; -static struct tegra_ehci_platform_data tegra_ehci1_pdata = { +struct tegra_ehci_platform_data tegra_ehci1_pdata = { .operating_mode =TEGRA_USB_OTG , .power_down_on_bus_suspend =1 , }; -static struct tegra_ehci_platform_data tegra_ehci2_pdata = { +struct tegra_ehci_platform_data tegra_ehci2_pdata = { .phy_config = &tegra_ehci2_ulpi_phy_config, .operating_mode =TEGRA_USB_HOST , .power_down_on_bus_suspend =1 , }; -static struct tegra_ehci_platform_data tegra_ehci3_pdata = { +struct tegra_ehci_platform_data tegra_ehci3_pdata = { .operating_mode =TEGRA_USB_HOST , .power_down_on_bus_suspend =1 , };
arch/arm/mach-tegra/devices.h +5 -0
@@ -20,6 +20,11 @@#define __MACH_TEGRA_DEVICES_H#include <linux/platform_device.h> +#include <linux/platform_data/tegra_usb.h> + +extern struct tegra_ehci_platform_data tegra_ehci1_pdata; +extern struct tegra_ehci_platform_data tegra_ehci2_pdata; +extern struct tegra_ehci_platform_data tegra_ehci3_pdata;extern struct platform_device tegra_gpio_device;extern struct platform_device tegra_pinmux_device;
Greg KH
maintainerPATCH 175/175 serial: sh-sci: fix a race of DMA submit_tx on transfer
In reply to Greg KH3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yoshii Takashi <[email protected]>
commit 49d4bcaddca977fffdea8b0b71f6e5da96dac78e upstream.
When DMA is enabled, sh-sci transfer begins with
uart_start()
sci_start_tx()
if (cookie_tx < 0) schedule_work()
Then, starts DMA when wq scheduled, -- (A)
process_one_work()
work_fn_rx()
cookie_tx = desc->submit_tx()
And finishes when DMA transfer ends, -- (B)
sci_dma_tx_complete()
async_tx_ack()
cookie_tx = -EINVAL
(possible another schedule_work())
This A to B sequence is not reentrant, since controlling variables (for example, cookie_tx above) are not queues nor lists. So, they must be invoked as A B A B..., otherwise results in kernel crash.
To ensure the sequence, sci_start_tx() seems to test if cookie_tx < 0 (represents "not used") to call schedule_work().
But cookie_tx will not be set (to a cookie, also means "used") until in the middle of work queue scheduled function work_fn_tx().
This gap between the test and set allows the breakage of the sequence under the very frequently call of uart_start().
Another gap between async_tx_ack() and another schedule_work() results in the same issue, too.
This patch introduces a new condition "cookie_tx == 0" just to mark it is "busy" and assign it within spin-locked region to fill the gaps.
--- drivers/tty/serial/sh-sci.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/tty/serial/sh-sci.c +10 -5
@@ -1229,17 +1229,20 @@ static void sci_dma_tx_complete(void *ar port->icount.tx +=sg_dma_len (&s->sg_tx);async_tx_ack (s->desc_tx); - s->cookie_tx = -EINVAL ; s->desc_tx =NULL ;if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )uart_write_wakeup (port);if (!uart_circ_empty (xmit)) { + s->cookie_tx =0 ;schedule_work (&s->work_tx); - }else if (port->type ==PORT_SCIFA || port->type ==PORT_SCIFB ) { -u16 ctrl =sci_in (port,SCSCR ); -sci_out (port,SCSCR , ctrl & ~SCSCR_TIE ); + }else { + s->cookie_tx = -EINVAL ; +if (port->type ==PORT_SCIFA || port->type ==PORT_SCIFB ) { +u16 ctrl =sci_in (port,SCSCR ); +sci_out (port,SCSCR , ctrl & ~SCSCR_TIE ); + } }spin_unlock_irqrestore (&port->lock, flags);
@@ -1501,8 +1504,10 @@ static void sci_start_tx(struct uart_por }if (s->chan_tx && !uart_circ_empty (&s->port.state->xmit) && - s->cookie_tx <0 ) + s->cookie_tx <0 ) { + s->cookie_tx =0 ;schedule_work (&s->work_tx); + }#endif if (!s->chan_tx || port->type ==PORT_SCIFA || port->type ==PORT_SCIFB ) {
Greg KH
maintainercover 3.3.1-stable review
This is the start of the stable review cycle for the 3.3.1 release. There are 175 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Apr 1 19:48:16 UTC 2012. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.3.1-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Makefile | 4 +- arch/arm/mach-shmobile/setup-sh7372.c | 2 + arch/arm/mach-tegra/Kconfig | 12 ++ arch/arm/mach-tegra/board-dt-tegra20.c | 6 +- arch/arm/mach-tegra/devices.c | 7 +- arch/arm/mach-tegra/devices.h | 5 + arch/x86/kernel/apic/io_apic.c | 40 ++++- arch/x86/kernel/entry_32.S | 17 +- arch/x86/kernel/tls.c | 4 +- arch/x86/kernel/tsc.c | 10 ++ arch/x86/kernel/vm86_32.c | 2 + arch/x86/net/bpf_jit_comp.c | 14 +- arch/x86/syscalls/syscall_32.tbl | 2 +- drivers/ata/ahci.c | 2 - drivers/ata/ahci.h | 6 + drivers/ata/ahci_platform.c | 11 ++ drivers/ata/libahci.c | 5 + drivers/ata/pata_legacy.c | 3 +- drivers/base/power/domain.c | 67 ++++++-- drivers/bluetooth/ath3k.c | 1 + drivers/bluetooth/btusb.c | 1 + drivers/char/tpm/Kconfig | 1 - drivers/char/tpm/tpm.c | 3 +- drivers/clocksource/sh_cmt.c | 4 + drivers/clocksource/sh_mtu2.c | 4 + drivers/clocksource/sh_tmu.c | 4 + drivers/firewire/ohci.c | 5 +- drivers/gpio/gpio-davinci.c | 26 +-- drivers/gpio/gpio-omap.c | 5 +- drivers/gpu/drm/gma500/framebuffer.c | 2 +- drivers/gpu/drm/i915/i915_drv.c | 7 + drivers/gpu/drm/i915/i915_gem.c | 7 +- drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_fb.c | 10 ++ drivers/gpu/drm/radeon/atombios_crtc.c | 8 +- drivers/gpu/drm/radeon/atombios_dp.c | 3 + drivers/gpu/drm/radeon/atombios_encoders.c | 4 +- drivers/gpu/drm/radeon/radeon_atombios.c | 14 ++ drivers/gpu/drm/radeon/radeon_connectors.c | 4 + drivers/gpu/drm/radeon/radeon_cursor.c | 13 +- drivers/gpu/drm/radeon/radeon_object.c | 18 ++- drivers/gpu/drm/radeon/radeon_object.h | 2 + drivers/hid/hid-chicony.c | 7 + drivers/hid/hid-core.c | 1 + drivers/hid/hid-ids.h | 1 + drivers/hwmon/fam15h_power.c | 2 +- drivers/infiniband/ulp/iser/iscsi_iser.c | 18 +-- drivers/infiniband/ulp/iser/iscsi_iser.h | 1 + drivers/infiniband/ulp/iser/iser_initiator.c | 30 ++-- drivers/infiniband/ulp/srpt/ib_srpt.c | 19 ++- drivers/iommu/amd_iommu.c | 2 +- drivers/iommu/amd_iommu_init.c | 30 ++-- drivers/md/bitmap.c | 2 + drivers/md/dm-crypt.c | 38 ++--- drivers/md/dm-exception-store.c | 2 +- drivers/md/dm-thin.c | 124 +++++++++------ drivers/md/md.c | 40 ++--- drivers/md/persistent-data/dm-btree-remove.c | 174 ++++++++++++--------- drivers/md/raid1.c | 17 +- drivers/md/raid10.c | 17 +- drivers/media/dvb/dvb-usb/mxl111sf.c | 6 +- drivers/media/dvb/frontends/au8522_dig.c | 10 +- drivers/media/dvb/frontends/lgdt330x.c | 6 +- drivers/media/dvb/frontends/tda10071.c | 2 +- drivers/media/video/pvrusb2/pvrusb2-devattr.c | 10 ++ drivers/mfd/wm8994-core.c | 14 ++ drivers/mtd/ubi/scan.c | 8 +- drivers/mtd/ubi/wl.c | 10 +- drivers/net/ethernet/marvell/sky2.c | 11 ++ drivers/net/ethernet/mellanox/mlx4/main.c | 2 +- drivers/net/usb/usbnet.c | 10 +- drivers/net/wireless/ath/ath9k/main.c | 8 +- drivers/net/wireless/iwlwifi/iwl-core.c | 18 +-- drivers/net/wireless/p54/p54spi.c | 14 +- drivers/net/wireless/rt2x00/rt2800usb.c | 1 + drivers/net/wireless/rtlwifi/base.c | 1 + drivers/net/wireless/rtlwifi/core.c | 42 +++++ drivers/net/wireless/rtlwifi/core.h | 4 +- drivers/net/wireless/rtlwifi/pci.c | 46 +++--- drivers/net/wireless/rtlwifi/pci.h | 1 - drivers/net/wireless/rtlwifi/ps.c | 3 +- drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | 15 +- drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c | 12 +- drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 6 +- drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 24 +-- drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 33 ++-- drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 29 ++-- drivers/net/wireless/rtlwifi/rtl8192de/fw.c | 22 ++- drivers/net/wireless/rtlwifi/rtl8192de/hw.c | 3 - drivers/net/wireless/rtlwifi/rtl8192de/sw.c | 38 ++--- drivers/net/wireless/rtlwifi/rtl8192se/fw.c | 2 +- drivers/net/wireless/rtlwifi/rtl8192se/hw.c | 16 +- drivers/net/wireless/rtlwifi/rtl8192se/led.c | 5 +- drivers/net/wireless/rtlwifi/rtl8192se/sw.c | 65 ++++++-- drivers/net/wireless/rtlwifi/usb.c | 48 +++--- drivers/net/wireless/rtlwifi/wifi.h | 4 +- drivers/rtc/interface.c | 20 ++- drivers/rtc/rtc-mpc5121.c | 2 + drivers/scsi/scsi_transport_iscsi.c | 4 +- drivers/staging/android/lowmemorykiller.c | 14 +- drivers/staging/media/as102/as102_fw.h | 2 +- drivers/staging/media/as102/as10x_cmd.h | 80 +++++----- drivers/staging/media/as102/as10x_types.h | 2 +- drivers/staging/octeon/ethernet-mdio.c | 4 +- drivers/staging/rtl8712/Kconfig | 7 - drivers/staging/rtl8712/os_intfs.c | 2 - drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 8 +- drivers/staging/rtl8712/rtl871x_sta_mgt.c | 4 - drivers/staging/rtl8712/sta_info.h | 4 - drivers/staging/vme/devices/vme_pio2.h | 4 +- drivers/staging/vme/devices/vme_pio2_gpio.c | 4 +- drivers/staging/zcache/zcache-main.c | 4 +- drivers/target/iscsi/iscsi_target.c | 14 +- drivers/target/iscsi/iscsi_target_configfs.c | 6 +- drivers/target/loopback/tcm_loop.c | 6 + drivers/target/target_core_alua.c | 7 +- drivers/target/target_core_cdb.c | 170 ++++++-------------- drivers/target/target_core_device.c | 6 +- drivers/target/tcm_fc/tfc_cmd.c | 6 +- drivers/tty/moxa.c | 2 +- drivers/tty/serial/amba-pl011.c | 15 +- drivers/tty/serial/omap-serial.c | 6 +- drivers/tty/serial/sh-sci.c | 15 +- drivers/tty/vt/consolemap.c | 51 +++++- drivers/usb/class/cdc-wdm.c | 17 +- drivers/usb/dwc3/core.c | 2 +- drivers/usb/dwc3/gadget.c | 33 ++-- drivers/usb/gadget/amd5536udc.c | 1 + drivers/usb/gadget/at91_udc.c | 1 + drivers/usb/gadget/atmel_usba_udc.c | 1 + drivers/usb/gadget/ci13xxx_udc.c | 1 + drivers/usb/gadget/f_subset.c | 34 ++-- drivers/usb/gadget/fsl_qe_udc.c | 1 + drivers/usb/gadget/fsl_udc_core.c | 19 ++- drivers/usb/gadget/goku_udc.c | 1 + drivers/usb/gadget/hid.c | 6 +- drivers/usb/gadget/inode.c | 2 + drivers/usb/gadget/langwell_udc.c | 1 + drivers/usb/gadget/mv_udc_core.c | 1 + drivers/usb/gadget/omap_udc.c | 1 + drivers/usb/gadget/pch_udc.c | 1 + drivers/usb/gadget/pxa25x_udc.c | 2 + drivers/usb/gadget/s3c-hsudc.c | 2 + drivers/usb/gadget/s3c2410_udc.c | 2 + drivers/usb/host/ehci-fsl.c | 4 + drivers/usb/host/ehci-fsl.h | 1 + drivers/usb/host/fsl-mph-dr-of.c | 1 - drivers/usb/musb/musb_gadget.c | 18 +++ drivers/usb/renesas_usbhs/mod_gadget.c | 6 + drivers/usb/serial/cp210x.c | 44 +++++- drivers/usb/serial/ftdi_sio.c | 32 +++- drivers/usb/serial/ftdi_sio.h | 3 +- drivers/usb/serial/ftdi_sio_ids.h | 19 ++- drivers/usb/serial/generic.c | 4 +- drivers/usb/serial/mos7840.c | 83 +++++++--- drivers/usb/serial/option.c | 16 ++ drivers/usb/serial/qcserial.c | 105 ++++++++----- drivers/usb/storage/realtek_cr.c | 8 +- drivers/video/backlight/tosa_lcd.c | 2 +- drivers/video/fbmem.c | 18 ++- drivers/video/udlfb.c | 2 +- fs/cifs/cifsfs.c | 8 +- fs/cifs/cifsglob.h | 10 +- fs/cifs/cifssmb.c | 9 +- fs/cifs/connect.c | 14 +- fs/cifs/dir.c | 6 +- fs/cifs/file.c | 23 +-- fs/cifs/transport.c | 4 +- fs/dcache.c | 3 +- fs/ext4/ext4.h | 2 + fs/ext4/ext4_jbd2.h | 56 +++---- fs/ext4/extents.c | 2 + fs/ext4/fsync.c | 2 + fs/ext4/inode.c | 46 +++--- fs/ext4/page-io.c | 11 +- fs/hugetlbfs/inode.c | 25 ++- fs/jbd2/transaction.c | 2 + fs/lockd/svc.c | 2 +- fs/nfs/callback_xdr.c | 4 +- fs/nfs/delegation.c | 11 ++ fs/nfs/delegation.h | 1 + fs/nfs/nfs4_fs.h | 3 + fs/nfs/nfs4proc.c | 64 +++++--- fs/nfs/nfs4state.c | 33 +++- fs/proc/namespaces.c | 2 +- fs/proc/proc_sysctl.c | 17 +- fs/proc/task_mmu.c | 9 ++ fs/sysfs/inode.c | 11 +- fs/xfs/xfs_iget.c | 18 ++- fs/xfs/xfs_log_recover.c | 33 ++-- include/asm-generic/pgtable.h | 61 ++++++++ include/asm-generic/unistd.h | 2 +- include/linux/fb.h | 1 + include/linux/math64.h | 4 + include/linux/pm_domain.h | 3 + include/linux/rtc.h | 3 +- include/target/target_core_base.h | 2 +- kernel/futex.c | 19 ++- kernel/irq/chip.c | 3 +- kernel/irq/manage.c | 2 +- kernel/module.c | 3 +- kernel/power/hibernate.c | 7 +- kernel/time/ntp.c | 2 +- lib/kobject_uevent.c | 19 ++- mm/bootmem.c | 5 +- mm/memcontrol.c | 4 + mm/memory.c | 16 +- mm/mempolicy.c | 2 +- mm/mincore.c | 2 +- mm/pagewalk.c | 2 +- mm/slub.c | 3 +- mm/sparse.c | 30 ++-- mm/swapfile.c | 4 +- mm/vmscan.c | 42 +++-- net/core/dev.c | 3 +- net/core/rtnetlink.c | 2 + net/ipv6/ip6_output.c | 11 +- net/ipv6/route.c | 8 +- net/l2tp/l2tp_ppp.c | 2 +- net/rds/send.c | 1 - net/sunrpc/cache.c | 2 + net/sunrpc/sched.c | 15 +- net/xfrm/xfrm_replay.c | 6 +- security/integrity/ima/Kconfig | 2 +- sound/pci/hda/hda_eld.c | 4 +- sound/soc/fsl/p1022_ds.c | 24 ++- sound/soc/pxa/pxa-ssp.c | 61 +++++--- 227 files changed, 2009 insertions(+), 1209 deletions(-)
Re: [ 105/175] CIFS: Respect negotiated MaxMpxCount
In reply to Greg KHQuoted 2 lines · On Fri, 30 Mar 2012 12:50:10 -0700 Greg KH <[email protected]> wrote:
3.3-stable review patch. If anyone has any objections, please let me know.
I'm not sure it's a good idea to put this patch into any stable release just yet. I think it's a correct and necessary fix, but it has some potential to cause regressions too (or uncover other preexisting problems with this code). Might it be best to wait until we have some more experience with this before we push it into stable?
Quoted 197 lines
------------------
From: Pavel Shilovsky <[email protected]>
commit
10b9b98e41ba248a899f6175ce96ee91431b6194upstream.Some servers sets this value less than 50 that was hardcoded and we lost the connection if when we exceed this limit. Fix this by respecting this value - not sending more than the server allows.
Reviewed-by Jeff Layton <[email protected]>Signed-off-by Pavel Shilovsky <[email protected]>Signed-off-by Steve French <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- 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(-)fs/cifs/cifsfs.c +4
-4@@ -76,7 +76,7 @@ MODULE_PARM_DESC(cifs_min_small, "Smallunsigned 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: 50 Range: 2 to 256" ); +"Default: 32767 Range: 2 to 32767." );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 >256 ) { - cifs_max_pending =256 ; -cFYI (1 ,"cifs_max_pending set to max of 256" ); + }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 ); } rc =cifs_fscache_register ();fs/cifs/cifsglob.h +3
-7@@ -55,14 +55,9 @@/* * MAX_REQ is the maximum number of requests that WE will send -* 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. +* on one socket concurrently. */ -#define CIFS_MAX_REQ 50 +#define CIFS_MAX_REQ 32767#define RFC1001_NAME_LEN 15#define RFC1001_NAME_LEN_WITH_NULL (RFC1001_NAME_LEN + 1)@@ -263,6 +258,7 @@ 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 */ fs/cifs/cifssmb.c +7
-2@@ -458,7 +458,10 @@ CIFSSMBNegotiate(unsigned int xid, struc goto neg_err_exit; } server->sec_mode = (__u8 )le16_to_cpu (rsp->SecurityMode); - server->maxReq =le16_to_cpu (rsp->MaxMpxCount); + server->maxReq = min_t(unsigned int, +le16_to_cpu (rsp->MaxMpxCount), + cifs_max_pending); + server->oplocks = server->maxReq >1 ? enable_oplocks : false; 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 @@ -564,7 +567,9 @@ CIFSSMBNegotiate(unsigned int xid, struc/* one byte, so no need to convert this or EncryptionKeyLen from little endian */ - server->maxReq =le16_to_cpu (pSMBr->MaxMpxCount); + server->maxReq = min_t(unsigned int, le16_to_cpu(pSMBr->MaxMpxCount), + cifs_max_pending); + server->oplocks = server->maxReq >1 ? enable_oplocks : false;/* probably no need to store and check maxvcs */ server->maxBuf =le32_to_cpu (pSMBr->MaxBufferSize); server->max_rw =le32_to_cpu (pSMBr->MaxRawSize);fs/cifs/connect.c +4
-7@@ -642,14 +642,10 @@ static void clean_demultiplex_info(strucspin_unlock (&GlobalMid_Lock);wake_up_all (&server->response_q); -/* -* 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. -*/ +/* Check if we have blocked requests that need to free. */ spin_lock (&GlobalMid_Lock); -if (atomic_read (&server->inFlight) >= cifs_max_pending) -atomic_set (&server->inFlight, cifs_max_pending -1 ); +if (atomic_read (&server->inFlight) >= server->maxReq) +atomic_set (&server->inFlight, server->maxReq -1 );/* * We do not want to set the max_pending too low or we could end up * with the counter going negative. @@ -1910,6 +1906,7 @@ cifs_get_tcp_session(struct smb_vol *vol 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);fs/cifs/dir.c +4
-2@@ -171,7 +171,7 @@ cifs_create(struct inode *inode, struct } tcon =tlink_tcon (tlink); -if (enable_oplocks) +if (tcon->ses->server->oplocks) oplock =REQ_OPLOCK ;if (nd)@@ -492,7 +492,7 @@ cifs_lookup(struct inode *parent_dir_ino {int xid;int rc =0 ;/* to get around spurious gcc warning, set to zero here */ -__u32 oplock = enable_oplocks ?REQ_OPLOCK :0 ; +__u32 oplock;__u16 fileHandle =0 ;bool posix_open = false;struct cifs_sb_info *cifs_sb;@@ -518,6 +518,8 @@ cifs_lookup(struct inode *parent_dir_ino } 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. fs/cifs/file.c +2
-2@@ -380,7 +380,7 @@ int cifs_open(struct inode *inode, struccFYI (1 ,"inode = 0x%p file flags are 0x%x for %s" , inode, file->f_flags, full_path); -if (enable_oplocks) +if (tcon->ses->server->oplocks) oplock =REQ_OPLOCK ;else oplock =0 ;@@ -505,7 +505,7 @@ static int cifs_reopen_file(struct cifsFcFYI (1 ,"inode = 0x%p file flags 0x%x for %s" , inode, pCifsFile->f_flags, full_path); -if (enable_oplocks) +if (tcon->ses->server->oplocks) oplock =REQ_OPLOCK ;else oplock =0 ;fs/cifs/transport.c +2
-2@@ -265,12 +265,12 @@ static int wait_for_free_request(structspin_lock (&GlobalMid_Lock);while (1 ) { -if (atomic_read (&server->inFlight) >= cifs_max_pending) { +if (atomic_read (&server->inFlight) >= server->maxReq) {spin_unlock (&GlobalMid_Lock);cifs_num_waiters_inc (server);wait_event (server->request_q,atomic_read (&server->inFlight) - < cifs_max_pending); + < server->maxReq);cifs_num_waiters_dec (server);spin_lock (&GlobalMid_Lock); }else {
Signature · 1 line
Jeff Layton <[email protected]>
Re: [ 105/175] CIFS: Respect negotiated MaxMpxCount
Quoted 11 lines · Jeff Layton
Quoted 2 lines · On Fri, 30 Mar 2012 12:50:10 -0700 Greg KH <[email protected]> wrote:
3.3-stable review patch. �If anyone has any objections, please let me know.
I'm not sure it's a good idea to put this patch into any stable release just yet. I think it's a correct and necessary fix, but it has some potential to cause regressions too (or uncover other preexisting problems with this code). Might it be best to wait until we have some more experience with this before we push it into stable?
Delaying it a little is probably ok, but weigh that against the frequency/severity
of the problem that Pavel's fix addresses: ie sequential writes to some versions of Windows 7 and Windows Vista can fail partway through large file copy (which also causes those servers
to become unresponsive to subsequent connection requests
as well) so the fix does address a hot problem.
Signature · 3 lines
Thanks, Steve
Re: [ 105/175] CIFS: Respect negotiated MaxMpxCount
Quoted 13 lines · On Sun, 1 Apr 2012 02:26:58 -0500 Steve French <[email protected]> wrote:
Quoted 11 lines · Jeff Layton
Quoted 2 lines · On Fri, 30 Mar 2012 12:50:10 -0700 Greg KH <[email protected]> wrote:
3.3-stable review patch. If anyone has any objections, please let me know.
I'm not sure it's a good idea to put this patch into any stable release just yet. I think it's a correct and necessary fix, but it has some potential to cause regressions too (or uncover other preexisting problems with this code). Might it be best to wait until we have some more experience with this before we push it into stable?
Quoted 10 lines
Delaying it a little is probably ok, but weigh that against the frequency/severity
of the problem that Pavel's fix addresses: ie sequential writes to some versions of Windows 7 and Windows Vista can fail partway through large file copy (which also causes those servers
to become unresponsive to subsequent connection requests
as well) so the fix does address a hot problem.
I'm not disputing whether this patch is correct. It's clearly a bug that cifs.ko has never respected this value, and it's quite problematic with certain servers.
The problem is that we don't have any confirmation that:
a) this fixes any of the problems that we think it will
b) this doesn't introduce any regressions
The request slot allocation code is quite fiddly and fragile, and I think the potential for "b" is somewhat high. I'd feel more comfortable if we waited until we have more experience with this patch before merging it into stable.
Signature · 1 line
Jeff Layton <[email protected]>
Re: [ 101/175] mm: vmscan: forcibly scan highmem if there are too many buffer_heads pinning highmem
In reply to Greg KHQuoted 4 lines · Greg KH
3.3-stable review patch. If anyone has any objections, please let me know.
------------------
Quoted 8 lines
From: Mel Gorman <[email protected]>
commit
cc715d99e529d470dde2f33a6614f255adea71f3upstream.Stuart Foster reported on bugzilla that copying large amounts of data from NTFS caused an OOM kill on 32-bit X86 with 16G of memory. Andrew Morton correctly identified that the problem was NTFS was using 512 blocks meaning each page had 8
buffer_headsin low memory pinning it.
I notice that this was not applied to 3.0.26 or 3.2.14.
[...]
Quoted 1 line
[...]
but this bug was reported against 3.1.9, so the fix is presumably needed for 3.2 at least.
Presumably the upstream change doesn't apply cleanly and would need to be backported. Is anyone planning to do that?
Ben.
Signature · 2 lines
Ben Hutchings Reality is just a crutch for people who can't handle science fiction.
Re: [ 117/175] iommu/amd: Make sure IOMMU interrupts are re-enabled on resume
In reply to Greg KHQuoted 11 lines · Greg KH
3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joerg Roedel <[email protected]>
commit
9ddd592a191b32f2ee6c4b6ed2bd52665c3a49f5upstream.Unfortunatly the interrupts for the event log and the peripheral page-faults are only enabled at boot but not re-enabled at resume. Fix that.
[...]
It looks like this should be applicable to 3.0 and 3.2 as well, but only for the event log. I'm attaching my (untested) backports for consideration.
Ben.
Signature · 2 lines
Ben Hutchings Reality is just a crutch for people who can't handle science fiction.
From ed3845ba84e5dbe3593dddf06b6377960f95712d Mon Sep 17 00:00:00 2001
From: Joerg Roedel <[email protected]>
Date: Thu, 15 Mar 2012 16:29:47 +0100
Subject: [PATCH] iommu/amd: Make sure IOMMU interrupts are re-enabled on
resume
commit 9ddd592a191b32f2ee6c4b6ed2bd52665c3a49f5 upstream.
Unfortunatly the interrupts for the event log and the peripheral page-faults are only enabled at boot but not re-enabled at resume. Fix that.
[bwh: Backport to 3.0:
- Drop change to PPR log which was added in 3.3
- Source is under arch/x86/kernel]
--- arch/x86/kernel/amd_iommu_init.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-)
arch/x86/kernel/amd_iommu_init.c +17 -7
@@ -1031,8 +1031,9 @@ static int iommu_setup_msi(struct amd_iommu *iommu) {int r; -if (pci_enable_msi (iommu->dev)) -return 1 ; + r =pci_enable_msi (iommu->dev); +if (r) +return r; r = request_threaded_irq(iommu->dev->irq, amd_iommu_int_handler,
@@ -1042,24 +1043,33 @@ static int iommu_setup_msi(struct amd_iommu *iommu)if (r) {pci_disable_msi (iommu->dev); -return 1 ; +return r; } iommu->int_enabled = true; -iommu_feature_enable (iommu,CONTROL_EVT_INT_EN );return 0 ; }static int iommu_init_msi (struct amd_iommu *iommu) { +int ret; +if (iommu->int_enabled) -return 0 ; + goto enable_faults;if (pci_find_capability (iommu->dev,PCI_CAP_ID_MSI )) -return iommu_setup_msi (iommu); + ret =iommu_setup_msi (iommu); +else + ret = -ENODEV ; -return 1 ; +if (ret) +return ret; + +enable_faults: +iommu_feature_enable (iommu,CONTROL_EVT_INT_EN ); + +return 0 ; }/****************************************************************************
Signature · 1 line
1.7.9.5
From ce1ae4a46ead4899939002d48e23678601ec6969 Mon Sep 17 00:00:00 2001
From: Joerg Roedel <[email protected]>
Date: Thu, 15 Mar 2012 16:29:47 +0100
Subject: [PATCH] iommu/amd: Make sure IOMMU interrupts are re-enabled on
resume
commit 9ddd592a191b32f2ee6c4b6ed2bd52665c3a49f5 upstream.
Unfortunatly the interrupts for the event log and the peripheral page-faults are only enabled at boot but not re-enabled at resume. Fix that.
--- drivers/iommu/amd_iommu_init.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-)
drivers/iommu/amd_iommu_init.c +17 -7
@@ -1033,8 +1033,9 @@ static int iommu_setup_msi(struct amd_iommu *iommu) {int r; -if (pci_enable_msi (iommu->dev)) -return 1 ; + r =pci_enable_msi (iommu->dev); +if (r) +return r; r = request_threaded_irq(iommu->dev->irq, amd_iommu_int_handler,
@@ -1044,24 +1045,33 @@ static int iommu_setup_msi(struct amd_iommu *iommu)if (r) {pci_disable_msi (iommu->dev); -return 1 ; +return r; } iommu->int_enabled = true; -iommu_feature_enable (iommu,CONTROL_EVT_INT_EN );return 0 ; }static int iommu_init_msi (struct amd_iommu *iommu) { +int ret; +if (iommu->int_enabled) -return 0 ; + goto enable_faults;if (pci_find_capability (iommu->dev,PCI_CAP_ID_MSI )) -return iommu_setup_msi (iommu); + ret =iommu_setup_msi (iommu); +else + ret = -ENODEV ; -return 1 ; +if (ret) +return ret; + +enable_faults: +iommu_feature_enable (iommu,CONTROL_EVT_INT_EN ); + +return 0 ; }/****************************************************************************
Signature · 1 line
1.7.9.5
Re: [ 101/175] mm: vmscan: forcibly scan highmem if there are too many buffer_heads pinning highmem
In reply to Ben HutchingsSorry for the slow response. I was at LSF/MM and still at Collaboration Summit and not keeping up with mail.
Quoted 7 lines · Ben Hutchings
Quoted 6 lines · Greg KH
3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <[email protected]>
Quoted 9 lines
Quoted 6 lines
commit
cc715d99e529d470dde2f33a6614f255adea71f3upstream.Stuart Foster reported on bugzilla that copying large amounts of data from NTFS caused an OOM kill on 32-bit X86 with 16G of memory. Andrew Morton correctly identified that the problem was NTFS was using 512 blocks meaning each page had 8
buffer_headsin low memory pinning it.I notice that this was not applied to 3.0.26 or 3.2.14.
True.
Quoted 10 lines
[...]
Quoted 1 line
[...]
but this bug was reported against 3.1.9, so the fix is presumably needed for 3.2 at least.
Presumably the upstream change doesn't apply cleanly and would need to be backported. Is anyone planning to do that?
It probably does not apply cleanly and considering how the bug is triggered I was not treating it as a high priority. Nikola Ciprich (added to cc) had said that he might try backporting it and I would review the result. I have not heard anything since. I can take a look at backporting it next week if it is considered a common problem.
Signature · 2 lines
Mel Gorman SUSE Labs
Re: [ 101/175] mm: vmscan: forcibly scan highmem if there are too many buffer_heads pinning highmem
On Thu, 2012-04-05 at 13:31 -0700, Mel Gorman wrote:
[...]
Quoted 10 lines
Quoted 9 lines
Quoted 1 line
[...]
but this bug was reported against 3.1.9, so the fix is presumably needed for 3.2 at least.
Presumably the upstream change doesn't apply cleanly and would need to be backported. Is anyone planning to do that?
Quoted 5 lines
It probably does not apply cleanly and considering how the bug is triggered I was not treating it as a high priority. Nikola Ciprich (added to cc) had said that he might try backporting it and I would review the result. I have not heard anything since. I can take a look at backporting it next week if it is considered a common problem.
I really don't know; I'm happy to leave it to you and the other mm maintainers to decide if it's worthwhile.
Ben.
Signature · 2 lines
Ben Hutchings Reality is just a crutch for people who can't handle science fiction.
Re: [ 101/175] mm: vmscan: forcibly scan highmem if there are too many buffer_heads pinning highmem
In reply to Mel GormanHi, sorry it took me a bit longer.
here's my backport, compiles fine, kernel boots without any problems. please review.
n.
(backport of upstream commit cc715d99e529d470dde2f33a6614f255adea71f3)
mm: vmscan: forcibly scan highmem if there are too many buffer_heads pinning highmem
Stuart Foster reported on bugzilla that copying large amounts of data from NTFS caused an OOM kill on 32-bit X86 with 16G of memory. Andrew Morton correctly identified that the problem was NTFS was using 512 blocks meaning each page had 8 buffer_heads in low memory pinning it.
In the past, direct reclaim used to scan highmem even if the allocating process did not specify __GFP_HIGHMEM but not any more. kswapd no longer will reclaim from zones that are above the high watermark. The intention in both cases was to minimise unnecessary reclaim. The downside is on machines with large amounts of highmem that lowmem can be fully consumed by buffer_heads with nothing trying to free them.
The following patch is based on a suggestion by Andrew Morton to extend the buffer_heads_over_limit case to force kswapd and direct reclaim to scan the highmem zone regardless of the allocation request or watermarks.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=42578
---
mm/vmscan.c +29 -1
@@ -1581,6 +1581,14 @@putback_lru_page (page);continue ; } + +if (unlikely (buffer_heads_over_limit)) { +if (page_has_private (page) &&trylock_page (page)) { +if (page_has_private (page)) +try_to_release_page (page,0 ); +unlock_page (page); + } + }if (page_referenced (page,0 , sc->mem_cgroup, &vm_flags)) { nr_rotated +=hpage_nr_pages (page);
@@ -2053,6 +2061,14 @@struct zoneref *z;struct zone *zone; +/* +* If the number of buffer_heads in the machine exceeds the maximum +* allowed level, force direct reclaim to scan the highmem zone as +* highmem pages could be pinning lowmem pages storing buffer_heads +*/ +if (buffer_heads_over_limit) + sc->gfp_mask |= __GFP_HIGHMEM; +for_each_zone_zonelist_nodemask (zone, z, zonelist,gfp_zone (sc->gfp_mask), sc->nodemask) {if (!populated_zone (zone))
@@ -2514,7 +2530,8 @@ (zone->present_pages +KSWAPD_ZONE_BALANCE_GAP_RATIO -1 ) / KSWAPD_ZONE_BALANCE_GAP_RATIO); -if (!zone_watermark_ok_safe (zone, order, +if ((buffer_heads_over_limit &&is_highmem_idx (i)) || + !zone_watermark_ok_safe (zone, order,high_wmark_pages (zone) + balance_gap, end_zone,0 )) {shrink_zone (priority, zone, &sc);
@@ -2543,6 +2560,17 @@continue ; } +/* +* If the number of buffer_heads in the machine +* exceeds the maximum allowed level and this node +* has a highmem zone, force kswapd to reclaim from +* it to relieve lowmem pressure. +*/ +if (buffer_heads_over_limit &&is_highmem_idx (i)) { + end_zone = i; +break ; + } +if (!zone_watermark_ok_safe (zone, order,high_wmark_pages (zone), end_zone,0 )) { all_zones_ok =0 ;
Re: [ 101/175] mm: vmscan: forcibly scan highmem if there are too many buffer_heads pinning highmem
Quoted 3 lines · Nikola Ciprich
Hi, sorry it took me a bit longer.
here's my backport,
To 3.0.27 I presume; I've not tried it against 3.2.14, haven't checked if that would be much the same or not.
Quoted 2 lines
compiles fine, kernel boots without any problems.
please review.
Thank you for doing the work, but I'm afraid it looks wrong to me. I'd be more confident to leave it to Mel myself. Comments below.
mm/vmscan.c
Quoted 32 lines
n.
Signed-off-by Nikola Ciprich <[email protected](backport of upstream commit
cc715d99e529d470dde2f33a6614f255adea71f3)mm: vmscan: forcibly scan highmem if there are too many
buffer_headspinning highmemStuart Foster reported on bugzilla that copying large amounts of data from NTFS caused an OOM kill on 32-bit X86 with 16G of memory. Andrew Morton correctly identified that the problem was NTFS was using 512 blocks meaning each page had 8
buffer_headsin low memory pinning it.In the past, direct reclaim used to scan highmem even if the allocating process did not specify
__GFP_HIGHMEMbut not any more. kswapd no longer will reclaim from zones that are above the high watermark. The intention in both cases was to minimise unnecessary reclaim. The downside is on machines with large amounts of highmem that lowmem can be fully consumed bybuffer_headswith nothing trying to free them.The following patch is based on a suggestion by Andrew Morton to extend the
buffer_heads_over_limitcase to force kswapd and direct reclaim to scan the highmem zone regardless of the allocation request or watermarks.Addresses https://bugzilla.kernel.org/show_bug.cgi?id=42578
---
diff -Naur
linux-3.0/mm/vmscan.clinux-3.0-cc715d99e529d470dde2f33a6614f255adea71f3-backport/mm/vmscan.cmm/vmscan.c +0
-0@@ -1581,6 +1581,14 @@
diff -p is often more helpful, and especially so for this patch:
here we are in shrink_active_list().
Quoted 4 lines
mm/vmscan.c +1
-0putback_lru_page (page);continue ; } +
mm/vmscan.c line 1594
Quoted 10 lines
mm/vmscan.c +7
-0+if (unlikely (buffer_heads_over_limit)) { +if (page_has_private (page) &&trylock_page (page)) { +if (page_has_private (page)) +try_to_release_page (page,0 ); +unlock_page (page); + } + }if (page_referenced (page,0 , sc->mem_cgroup, &vm_flags)) { nr_rotated +=hpage_nr_pages (page);
I don't think this does functional harm, but it duplicates the work done by the pagevec_strip() you left in move_active_pages_to_lru(), so the resulting source would be puzzling.
We could remove the pagevec_strip(), but really, it was just a misunderstanding that led to my little buffer_heads_over_limit cleanup in one place getting merged in with Mel's significant buffer_heads_over_limit fix in another.
My cleanup doesn't deserve backporting to 3.0 or 3.2: I included it in the 3.3 backport to avoid raised eyebrows, but once we get back to kernels with pagevec_strip(), let's just leave this hunk out.
mm/vmscan.c
Quoted 1 line
mm/vmscan.c +0
-0@@ -2053,6 +2061,14 @@
Here we are in all_unreclaimable().
mm/vmscan.c line 2071
Quoted 11 lines
mm/vmscan.c +8
-0struct zoneref *z;struct zone *zone; +/* +* If the number of buffer_heads in the machine exceeds the maximum +* allowed level, force direct reclaim to scan the highmem zone as +* highmem pages could be pinning lowmem pages storing buffer_heads +*/ +if (buffer_heads_over_limit) + sc->gfp_mask |= __GFP_HIGHMEM; +
But in Mel's patch that belongs to shrink_zones():
I don't see a reason to move it in the backport.
mm/vmscan.c
Quoted 4 lines
mm/vmscan.c +0
-0for_each_zone_zonelist_nodemask (zone, z, zonelist,gfp_zone (sc->gfp_mask), sc->nodemask) {if (!populated_zone (zone))@@ -2514,7 +2530,8 @@
I think this hunk in balance_pgdat() is correct.
mm/vmscan.c
Quoted 10 lines
mm/vmscan.c +2
-1(zone->present_pages +KSWAPD_ZONE_BALANCE_GAP_RATIO -1 ) / KSWAPD_ZONE_BALANCE_GAP_RATIO); -if (!zone_watermark_ok_safe (zone, order, +if ((buffer_heads_over_limit &&is_highmem_idx (i)) || + !zone_watermark_ok_safe (zone, order,high_wmark_pages (zone) + balance_gap, end_zone,0 )) {shrink_zone (priority, zone, &sc);@@ -2543,6 +2560,17 @@
But this hunk in balance_pgdat() comes too late: it should set end_zone in between the inactive_anon_is_low shrink_active_list and the !zone_watermark_ok_safe() setting of end_zone higher up, before the previous hunk.
Quoted 7 lines
mm/vmscan.c +4
-0continue ; } +/* +* If the number of buffer_heads in the machine +* exceeds the maximum allowed level and this node +* has a highmem zone, force kswapd to reclaim from
mm/vmscan.c line 2576
Quoted 10 lines
mm/vmscan.c +7
-0+* it to relieve lowmem pressure. +*/ +if (buffer_heads_over_limit &&is_highmem_idx (i)) { + end_zone = i; +break ; + } +if (!zone_watermark_ok_safe (zone, order,high_wmark_pages (zone), end_zone,0 )) { all_zones_ok =0 ;
Hugh
Joerg Roedel
Acked-byRe: [ 117/175] iommu/amd: Make sure IOMMU interrupts are re-enabled on resume
In reply to Ben HutchingsRight, this fix is also required for 3.2 and 3.0.
Quoted 9 lines · Ben Hutchings
Quoted 8 lines · Greg KH
3.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joerg Roedel <[email protected]>
commit
9ddd592a191b32f2ee6c4b6ed2bd52665c3a49f5upstream.
Quoted 8 lines
Quoted 3 lines
Unfortunatly the interrupts for the event log and the peripheral page-faults are only enabled at boot but not re-enabled at resume. Fix that.
[...]
It looks like this should be applicable to 3.0 and 3.2 as well, but only for the event log. I'm attaching my (untested) backports for consideration.
The backport looks good.
Quoted 164 lines
Ben.
Signature · 23 lines
Ben Hutchings Reality is just a crutch for people who can't handle science fiction. From ed3845ba84e5dbe3593dddf06b6377960f95712d Mon Sep 17 00:00:00 2001 From: Joerg Roedel <[email protected]> Date: Thu, 15 Mar 2012 16:29:47 +0100 Subject: [PATCH] iommu/amd: Make sure IOMMU interrupts are re-enabled on resume commit 9ddd592a191b32f2ee6c4b6ed2bd52665c3a49f5 upstream. Unfortunatly the interrupts for the event log and the peripheral page-faults are only enabled at boot but not re-enabled at resume. Fix that. Signed-off-by: Joerg Roedel <[email protected]> [bwh: Backport to 3.0: - Drop change to PPR log which was added in 3.3 - Source is under arch/x86/kernel] Signed-off-by: Ben Hutchings <[email protected]> --- arch/x86/kernel/amd_iommu_init.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-)arch/x86/kernel/amd_iommu_init.c +17
-7@@ -1031,8 +1031,9 @@ static int iommu_setup_msi(struct amd_iommu *iommu) {int r; -if (pci_enable_msi (iommu->dev)) -return 1 ; + r =pci_enable_msi (iommu->dev); +if (r) +return r; r = request_threaded_irq(iommu->dev->irq, amd_iommu_int_handler,@@ -1042,24 +1043,33 @@ static int iommu_setup_msi(struct amd_iommu *iommu)if (r) {pci_disable_msi (iommu->dev); -return 1 ; +return r; } iommu->int_enabled = true; -iommu_feature_enable (iommu,CONTROL_EVT_INT_EN );return 0 ; }static int iommu_init_msi (struct amd_iommu *iommu) { +int ret; +if (iommu->int_enabled) -return 0 ; + goto enable_faults;if (pci_find_capability (iommu->dev,PCI_CAP_ID_MSI )) -return iommu_setup_msi (iommu); + ret =iommu_setup_msi (iommu); +else + ret = -ENODEV ; -return 1 ; +if (ret) +return ret; + +enable_faults: +iommu_feature_enable (iommu,CONTROL_EVT_INT_EN ); + +return 0 ; }/**************************************************************************** Signature · 21 lines
1.7.9.5 From ce1ae4a46ead4899939002d48e23678601ec6969 Mon Sep 17 00:00:00 2001 From: Joerg Roedel <[email protected]> Date: Thu, 15 Mar 2012 16:29:47 +0100 Subject: [PATCH] iommu/amd: Make sure IOMMU interrupts are re-enabled on resume commit 9ddd592a191b32f2ee6c4b6ed2bd52665c3a49f5 upstream. Unfortunatly the interrupts for the event log and the peripheral page-faults are only enabled at boot but not re-enabled at resume. Fix that. Signed-off-by: Joerg Roedel <[email protected]> [bwh: Backport to 3.2: drop change to PPR log which was added in 3.3] Signed-off-by: Ben Hutchings <[email protected]> --- drivers/iommu/amd_iommu_init.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-)drivers/iommu/amd_iommu_init.c +17
-7@@ -1033,8 +1033,9 @@ static int iommu_setup_msi(struct amd_iommu *iommu) {int r; -if (pci_enable_msi (iommu->dev)) -return 1 ; + r =pci_enable_msi (iommu->dev); +if (r) +return r; r = request_threaded_irq(iommu->dev->irq, amd_iommu_int_handler,@@ -1044,24 +1045,33 @@ static int iommu_setup_msi(struct amd_iommu *iommu)if (r) {pci_disable_msi (iommu->dev); -return 1 ; +return r; } iommu->int_enabled = true; -iommu_feature_enable (iommu,CONTROL_EVT_INT_EN );return 0 ; }static int iommu_init_msi (struct amd_iommu *iommu) { +int ret; +if (iommu->int_enabled) -return 0 ; + goto enable_faults;if (pci_find_capability (iommu->dev,PCI_CAP_ID_MSI )) -return iommu_setup_msi (iommu); + ret =iommu_setup_msi (iommu); +else + ret = -ENODEV ; -return 1 ; +if (ret) +return ret; + +enable_faults: +iommu_feature_enable (iommu,CONTROL_EVT_INT_EN ); + +return 0 ; }/**************************************************************************** Signature · 1 line
1.7.9.5
Signature · 5 lines
AMD Operating System Research Center Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach General Managers: Alberto Bozzo Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
Greg KH
maintainerRe: [ 117/175] iommu/amd: Make sure IOMMU interrupts are re-enabled on resume
Quoted 1 line · Joerg Roedel
Right, this fix is also required for 3.2 and 3.0.
Wait, what?
Can someone send me the needed fix, in a new thread as I seem to have lost this one :(
thanks,
greg k-h
Re: [ 117/175] iommu/amd: Make sure IOMMU interrupts are re-enabled on resume
Quoted 7 lines · Greg KH
Quoted 1 line · Joerg Roedel
Right, this fix is also required for 3.2 and 3.0.
Wait, what?
Can someone send me the needed fix, in a new thread as I seem to have lost this one :(
No problem. I send you the backported fix for 3.2 and 3.0.
Signature · 5 lines
AMD Operating System Research Center Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach General Managers: Alberto Bozzo Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
PATCH 1/1 dm thin: reinstate missing mempool_free in cell_release_singleton
In reply to Greg KHHi Greg,
3.3-stable pulled in upstream commit 6f94a4c45a6f744383f9f695dde019998db3df55 (dm thin: fix stacked bi_next usage)
But later in the 3.4 development window it was determined that that commit introduced a significant leak. The following upstream commit fixes it (but unfortunately didn't cc: stable).
-------------------
From: Mike Snitzer <[email protected]>
commit 03aaae7cdc71bc306888440b1f569d463e917b6d upstream.
Fix a significant memory leak inadvertently introduced during simplification of cell_release_singleton() in commit 6f94a4c45a6f744383f9f695dde019998db3df55 ("dm thin: fix stacked bi_next usage").
A cell's hlist_del() must be accompanied by a mempool_free(). Use __cell_release() to do this, like before.
--- drivers/md/dm-thin.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
drivers/md/dm-thin.c +6 -3
@@ -279,8 +279,10 @@ static void __cell_release(struct cell *cell, struct bio_list *inmates)hlist_del (&cell->list); -bio_list_add (inmates, cell->holder); -bio_list_merge (inmates, &cell->bios); +if (inmates) { +bio_list_add (inmates, cell->holder); +bio_list_merge (inmates, &cell->bios); + }mempool_free (cell, prison->cell_pool); }
@@ -303,9 +305,10 @@ static void cell_release(struct cell *cell, struct bio_list *bios)*/ static void __cell_release_singleton (struct cell *cell,struct bio *bio) { -hlist_del (&cell->list);BUG_ON (cell->holder != bio);BUG_ON (!bio_list_empty (&cell->bios)); + +__cell_release (cell,NULL ); }static void cell_release_singleton (struct cell *cell,struct bio *bio)
Signature · 1 line
1.7.4.4
Greg KH
maintainerRe: [PATCH] dm thin: reinstate missing mempool_free in cell_release_singleton
Quoted 8 lines · Mike Snitzer
Hi Greg,
3.3-stable pulled in upstream commit
6f94a4c45a6f744383f9f695dde019998db3df55(dm thin: fix stackedbi_nextusage)But later in the 3.4 development window it was determined that that commit introduced a significant leak. The following upstream commit fixes it (but unfortunately didn't cc: stable).
3.3 is end-of-life, so there's not much I can do with the 3.3-stable tree anymore, sorry. If there's any other tree I should apply this to that is active (i.e. 3.0 or 3.4), please let me know.
sorry,
greg k-h
Re: dm thin: reinstate missing mempool_free in cell_release_singleton
Quoted 6 lines · Greg KH
Quoted 5 lines · Mike Snitzer
Hi Greg,
3.3-stable pulled in upstream commit
6f94a4c45a6f744383f9f695dde019998db3df55(dm thin: fix stackedbi_nextusage)
Quoted 7 lines
Quoted 3 lines
But later in the 3.4 development window it was determined that that commit introduced a significant leak. The following upstream commit fixes it (but unfortunately didn't cc: stable).
3.3 is end-of-life, so there's not much I can do with the 3.3-stable tree anymore, sorry. If there's any other tree I should apply this to that is active (i.e. 3.0 or 3.4), please let me know.
OK, no other active stable tree is affected, thanks.
Re: [PATCH] dm thin: reinstate missing mempool_free in cell_release_singleton
In reply to Greg KHQuoted 7 lines · Greg KH
Quoted 6 lines · Mike Snitzer
Hi Greg,
3.3-stable pulled in upstream commit
6f94a4c45a6f744383f9f695dde019998db3df55(dm thin: fix stackedbi_nextusage)
Quoted 7 lines
Quoted 3 lines
But later in the 3.4 development window it was determined that that commit introduced a significant leak. The following upstream commit fixes it (but unfortunately didn't cc: stable).
3.3 is end-of-life, so there's not much I can do with the 3.3-stable tree anymore, sorry. If there's any other tree I should apply this to that is active (i.e. 3.0 or 3.4), please let me know.
Looks like you forgot 3.2 that is affected (since 3.2.14).
Greg KH
maintainerRe: [PATCH] dm thin: reinstate missing mempool_free in cell_release_singleton
Quoted 12 lines · Touko Korpela
Quoted 11 lines · Greg KH
Quoted 9 lines · Mike Snitzer
Hi Greg,
3.3-stable pulled in upstream commit
6f94a4c45a6f744383f9f695dde019998db3df55(dm thin: fix stackedbi_nextusage)But later in the 3.4 development window it was determined that that commit introduced a significant leak. The following upstream commit fixes it (but unfortunately didn't cc: stable).
Quoted 5 lines
Quoted 3 lines
3.3 is end-of-life, so there's not much I can do with the 3.3-stable tree anymore, sorry. If there's any other tree I should apply this to that is active (i.e. 3.0 or 3.4), please let me know.
Looks like you forgot 3.2 that is affected (since 3.2.14).
I don't maintain 3.2 :)
Re: [PATCH] dm thin: reinstate missing mempool_free in cell_release_singleton
In reply to Touko KorpelaQuoted 12 lines · Touko Korpela
Quoted 11 lines · Greg KH
Quoted 9 lines · Mike Snitzer
Hi Greg,
3.3-stable pulled in upstream commit
6f94a4c45a6f744383f9f695dde019998db3df55(dm thin: fix stackedbi_nextusage)But later in the 3.4 development window it was determined that that commit introduced a significant leak. The following upstream commit fixes it (but unfortunately didn't cc: stable).
Quoted 5 lines
Quoted 3 lines
3.3 is end-of-life, so there's not much I can do with the 3.3-stable tree anymore, sorry. If there's any other tree I should apply this to that is active (i.e. 3.0 or 3.4), please let me know.
Looks like you forgot 3.2 that is affected (since 3.2.14).
I've added this to the queue for 3.2, thanks.
Ben.
Signature · 3 lines
Ben Hutchings
Lowery's Law:
If it jams, force it. If it breaks, it needed replacing anyway.