[PATCH 00/24] net: Remove unnecessary OOM logging messages

STALE5409d

Revision v1 of 3 in this series.

48 messages, 12 authors, 2011-10-11 · open the first message on its own page

[PATCH 00/24] net: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:18:27

Remove all the site-specific OOM messages because they duplicate
the MM subsystem generic OOM message.

Saves ~.2% (~2.5kb) of code/text in an x86 defconfig

$ size net/built-in.o*defconfig
   text	   data	    bss	    dec	    hex	filename
1506772	  58652	  34928	1600352	 186b60	net/built-in.o.new.defconfig
1509144	  58652	  34928	1602724	 1874a4	net/built-in.o.old.defconfig

$ size net/built-in.o*allyesconfig
   text	   data	    bss	    dec	    hex	filename
7655361	 275361	2062352	 9993074 987b72	net/built-in.o.new.allyesconfig
7667400	 275649	2064024	10007073 98b221	net/built-in.o.old.allyesconfig

Joe Perches (24):
  802: Remove unnecessary OOM logging messages
  9p: Remove unnecessary OOM logging messages
  atm: Remove unnecessary OOM logging messages
  ax25: Remove unnecessary OOM logging messages
  batman-adv: Remove unnecessary OOM logging messages
  netfilter: Remove unnecessary OOM logging messages
  net: Remove unnecessary OOM logging messages
  ceph: Remove unnecessary OOM logging messages
  decnet: Remove unnecessary OOM logging messages
  econet: Remove unnecessary OOM logging messages
  iucv: Remove unnecessary OOM logging messages
  mac80211: Remove unnecessary OOM logging messages
  netrom: Remove unnecessary OOM logging messages
  rds: Remove unnecessary OOM logging messages
  rfkill: Remove unnecessary OOM logging messages
  rose: Remove unnecessary OOM logging messages
  sched: Remove unnecessary OOM logging messages
  sctp: Remove unnecessary OOM logging messages
  sunrpc: Remove unnecessary OOM logging messages
  tipc: Remove unnecessary OOM logging messages
  wanrouter: Remove unnecessary OOM logging messages
  wireless: Remove unnecessary OOM logging messages
  x25: Remove unnecessary OOM logging messages
  net: Remove unnecessary OOM logging messages

 net/802/tr.c                            |    1 -
 net/9p/client.c                         |    7 +----
 net/9p/trans_virtio.c                   |    6 +----
 net/atm/lec.c                           |    4 +--
 net/atm/mpc.c                           |   17 ++++----------
 net/atm/mpoa_caches.c                   |    8 +-----
 net/ax25/ax25_dev.c                     |    5 +--
 net/ax25/ax25_out.c                     |    8 +++---
 net/ax25/ax25_route.c                   |    5 +--
 net/batman-adv/hard-interface.c         |    5 +---
 net/batman-adv/main.c                   |    2 -
 net/batman-adv/originator.c             |   16 +++----------
 net/batman-adv/soft-interface.c         |    4 +--
 net/batman-adv/vis.c                    |    4 +--
 net/bridge/netfilter/ebt_ulog.c         |    7 ++---
 net/can/af_can.c                        |    6 +---
 net/ceph/messenger.c                    |    5 +---
 net/ceph/msgpool.c                      |    6 +----
 net/core/dev.c                          |   25 ++++++----------------
 net/core/flow.c                         |    4 +--
 net/core/pktgen.c                       |    5 +---
 net/decnet/dn_neigh.c                   |    6 -----
 net/econet/af_econet.c                  |    4 +--
 net/ipv4/netfilter/ipt_CLUSTERIP.c      |    1 -
 net/ipv4/netfilter/ipt_ULOG.c           |    4 +--
 net/ipv4/netfilter/nf_nat_snmp_basic.c  |   22 +-----------------
 net/ipv6/netfilter/nf_conntrack_reasm.c |    7 ++---
 net/iucv/iucv.c                         |    5 +--
 net/mac80211/agg-rx.c                   |   19 +---------------
 net/mac80211/agg-tx.c                   |   35 +++++++-----------------------
 net/mac80211/debugfs.c                  |    3 ++
 net/mac80211/ht.c                       |    6 +----
 net/mac80211/mesh.c                     |    5 +--
 net/mac80211/mlme.c                     |   17 ++++----------
 net/mac80211/spectmgmt.c                |    6 +----
 net/mac80211/tx.c                       |   17 ++++----------
 net/mac80211/util.c                     |   11 ++-------
 net/mac80211/work.c                     |    6 +---
 net/netfilter/ipset/ip_set_core.c       |    4 +--
 net/netfilter/ipvs/ip_vs_core.c         |    5 +--
 net/netfilter/ipvs/ip_vs_ctl.c          |   18 +++++----------
 net/netfilter/ipvs/ip_vs_dh.c           |    5 +--
 net/netfilter/ipvs/ip_vs_lblc.c         |    9 ++-----
 net/netfilter/ipvs/ip_vs_lblcr.c        |   13 +++--------
 net/netfilter/ipvs/ip_vs_proto.c        |    5 +--
 net/netfilter/ipvs/ip_vs_sh.c           |    5 +--
 net/netfilter/ipvs/ip_vs_wrr.c          |    5 +--
 net/netfilter/nf_conntrack_core.c       |    5 +---
 net/netfilter/nfnetlink_log.c           |    7 +----
 net/netfilter/xt_IDLETIMER.c            |    2 -
 net/netfilter/xt_hashlimit.c            |    5 +---
 net/netrom/af_netrom.c                  |    8 +-----
 net/rds/ib_rdma.c                       |    1 -
 net/rds/iw_rdma.c                       |    8 +------
 net/rds/iw_send.c                       |    8 +-----
 net/rfkill/rfkill-regulator.c           |    1 -
 net/rose/af_rose.c                      |    1 -
 net/sched/act_api.c                     |    6 +---
 net/sched/sch_atm.c                     |    1 -
 net/sctp/protocol.c                     |    3 --
 net/socket.c                            |    5 +---
 net/sunrpc/auth_gss/gss_krb5_crypto.c   |   10 +-------
 net/sunrpc/auth_gss/gss_krb5_mech.c     |    2 -
 net/sunrpc/backchannel_rqst.c           |    9 ++-----
 net/sunrpc/clnt.c                       |    3 --
 net/sunrpc/rpc_pipe.c                   |    3 +-
 net/sunrpc/rpcb_clnt.c                  |    2 -
 net/sunrpc/xprtrdma/svc_rdma.c          |    8 +-----
 net/sunrpc/xprtrdma/transport.c         |    5 +---
 net/sunrpc/xprtrdma/verbs.c             |   14 ------------
 net/sunrpc/xprtsock.c                   |    5 +---
 net/tipc/link.c                         |    4 +--
 net/wanrouter/wanmain.c                 |    8 +------
 net/wireless/lib80211_crypt_ccmp.c      |    2 -
 net/wireless/lib80211_crypt_tkip.c      |    4 ---
 net/wireless/lib80211_crypt_wep.c       |    4 ---
 net/wireless/util.c                     |    5 +--
 net/x25/x25_dev.c                       |   10 +++-----
 78 files changed, 137 insertions(+), 415 deletions(-)

-- 
1.7.6.405.gc1be0

[PATCH 01/24] 802: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:18:36

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/802/tr.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/net/802/tr.c b/net/802/tr.c
index 5e20cf8..94cb725 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -382,7 +382,6 @@ static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev)
 
 		if(!entry)
 		{
-			printk(KERN_DEBUG "tr.c: Couldn't malloc rif cache entry !\n");
 			spin_unlock_irqrestore(&rif_lock, flags);
 			return;
 		}
-- 
1.7.6.405.gc1be0

[PATCH 02/24] 9p: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:18:44

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/9p/client.c       |    7 ++-----
 net/9p/trans_virtio.c |    6 +-----
 2 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/net/9p/client.c b/net/9p/client.c
index 0505a03..85c2a10 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -222,7 +222,6 @@ static struct p9_req_t *p9_tag_alloc(struct p9_client *c, u16 tag)
 					sizeof(struct p9_req_t), GFP_ATOMIC);
 
 			if (!c->reqs[row]) {
-				printk(KERN_ERR "Couldn't grow tag array\n");
 				spin_unlock_irqrestore(&c->lock, flags);
 				return ERR_PTR(-ENOMEM);
 			}
@@ -240,10 +239,9 @@ static struct p9_req_t *p9_tag_alloc(struct p9_client *c, u16 tag)
 	req = &c->reqs[row][col];
 	if (!req->tc) {
 		req->wq = kmalloc(sizeof(wait_queue_head_t), GFP_NOFS);
-		if (!req->wq) {
-			printk(KERN_ERR "Couldn't grow tag array\n");
+		if (!req->wq)
 			return ERR_PTR(-ENOMEM);
-		}
+
 		init_waitqueue_head(req->wq);
 		if ((c->trans_mod->pref & P9_TRANS_PREF_PAYLOAD_MASK) ==
 				P9_TRANS_PREF_PAYLOAD_SEP) {
@@ -263,7 +261,6 @@ static struct p9_req_t *p9_tag_alloc(struct p9_client *c, u16 tag)
 			req->rc->capacity = c->msize;
 		}
 		if ((!req->tc) || (!req->rc)) {
-			printk(KERN_ERR "Couldn't grow tag array\n");
 			kfree(req->tc);
 			kfree(req->rc);
 			kfree(req->wq);
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 175b513..2ac547e 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -293,11 +293,8 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req)
 			rpinfo->rp_alloc = 0;
 		} else {
 			req->tc->private = kmalloc(rpinfo_size, GFP_NOFS);
-			if (!req->tc->private) {
-				P9_DPRINTK(P9_DEBUG_TRANS, "9p debug: "
-					"private kmalloc returned NULL");
+			if (!req->tc->private)
 				return -ENOMEM;
-			}
 			rpinfo = (struct trans_rpage_info *)req->tc->private;
 			rpinfo->rp_alloc = 1;
 		}
@@ -431,7 +428,6 @@ static int p9_virtio_probe(struct virtio_device *vdev)
 
 	chan = kmalloc(sizeof(struct virtio_chan), GFP_KERNEL);
 	if (!chan) {
-		printk(KERN_ERR "9p: Failed to allocate virtio 9P channel\n");
 		err = -ENOMEM;
 		goto fail;
 	}
-- 
1.7.6.405.gc1be0

[PATCH 03/24] atm: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:18:54

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/atm/lec.c         |    4 +---
 net/atm/mpc.c         |   17 +++++------------
 net/atm/mpoa_caches.c |    8 ++------
 3 files changed, 8 insertions(+), 21 deletions(-)
diff --git a/net/atm/lec.c b/net/atm/lec.c
index f1964ca..6dc635c 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -1674,10 +1674,8 @@ static struct lec_arp_table *make_entry(struct lec_priv *priv,
 	struct lec_arp_table *to_return;
 
 	to_return = kzalloc(sizeof(struct lec_arp_table), GFP_ATOMIC);
-	if (!to_return) {
-		pr_info("LEC: Arp entry kmalloc failed\n");
+	if (!to_return)
 		return NULL;
-	}
 	memcpy(to_return->mac_addr, mac_addr, ETH_ALEN);
 	INIT_HLIST_NODE(&to_return->next);
 	setup_timer(&to_return->timer, lec_arp_expire_arp,
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index aa97240..fc85df0 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -184,10 +184,8 @@ struct atm_mpoa_qos *atm_mpoa_add_qos(__be32 dst_ip, struct atm_qos *qos)
 	}
 
 	entry = kmalloc(sizeof(struct atm_mpoa_qos), GFP_KERNEL);
-	if (entry == NULL) {
-		pr_info("mpoa: out of memory\n");
+	if (entry == NULL)
 		return entry;
-	}
 
 	entry->ipaddr = dst_ip;
 	entry->qos = *qos;
@@ -473,10 +471,8 @@ static const uint8_t *copy_macs(struct mpoa_client *mpc,
 			kfree(mpc->mps_macs);
 		mpc->number_of_mps_macs = 0;
 		mpc->mps_macs = kmalloc(num_macs * ETH_ALEN, GFP_KERNEL);
-		if (mpc->mps_macs == NULL) {
-			pr_info("(%s) out of mem\n", mpc->dev->name);
+		if (mpc->mps_macs == NULL)
 			return NULL;
-		}
 	}
 	memcpy(mpc->mps_macs, router_mac, ETH_ALEN);
 	tlvs += 20; if (device_type == MPS_AND_MPC) tlvs += 20;
@@ -1260,10 +1256,8 @@ static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry)
 	}
 
 	skb = alloc_skb(sizeof(struct k_message), GFP_ATOMIC);
-	if (skb == NULL) {
-		pr_info("out of memory\n");
+	if (skb == NULL)
 		return;
-	}
 
 	skb_put(skb, sizeof(struct k_message));
 	memset(skb->data, 0, sizeof(struct k_message));
@@ -1379,10 +1373,9 @@ static void set_mps_mac_addr_rcvd(struct k_message *msg,
 		kfree(client->mps_macs);
 	client->number_of_mps_macs = 0;
 	client->mps_macs = kmemdup(msg->MPS_ctrl, ETH_ALEN, GFP_KERNEL);
-	if (client->mps_macs == NULL) {
-		pr_info("out of memory\n");
+	if (client->mps_macs == NULL)
 		return;
-	}
+
 	client->number_of_mps_macs = 1;
 }
 
diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
index d1b2d9a..cc5f46d 100644
--- a/net/atm/mpoa_caches.c
+++ b/net/atm/mpoa_caches.c
@@ -98,10 +98,8 @@ static in_cache_entry *in_cache_add_entry(__be32 dst_ip,
 {
 	in_cache_entry *entry = kzalloc(sizeof(in_cache_entry), GFP_KERNEL);
 
-	if (entry == NULL) {
-		pr_info("mpoa: mpoa_caches.c: new_in_cache_entry: out of memory\n");
+	if (entry == NULL)
 		return NULL;
-	}
 
 	dprintk("adding an ingress entry, ip = %pI4\n", &dst_ip);
 
@@ -460,10 +458,8 @@ static eg_cache_entry *eg_cache_add_entry(struct k_message *msg,
 {
 	eg_cache_entry *entry = kzalloc(sizeof(eg_cache_entry), GFP_KERNEL);
 
-	if (entry == NULL) {
-		pr_info("out of memory\n");
+	if (entry == NULL)
 		return NULL;
-	}
 
 	dprintk("adding an egress entry, ip = %pI4, this should be our IP\n",
 		&msg->content.eg_info.eg_dst_ip);
-- 
1.7.6.405.gc1be0

[PATCH 04/24] ax25: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:19:06

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/ax25/ax25_dev.c   |    5 ++---
 net/ax25/ax25_out.c   |    8 ++++----
 net/ax25/ax25_route.c |    5 ++---
 3 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/net/ax25/ax25_dev.c b/net/ax25/ax25_dev.c
index c1cb982..986908a 100644
--- a/net/ax25/ax25_dev.c
+++ b/net/ax25/ax25_dev.c
@@ -55,10 +55,9 @@ void ax25_dev_device_up(struct net_device *dev)
 {
 	ax25_dev *ax25_dev;
 
-	if ((ax25_dev = kzalloc(sizeof(*ax25_dev), GFP_ATOMIC)) == NULL) {
-		printk(KERN_ERR "AX.25: ax25_dev_device_up - out of memory\n");
+	ax25_dev = kzalloc(sizeof(*ax25_dev), GFP_ATOMIC);
+	if (ax25_dev == NULL)
 		return;
-	}
 
 	ax25_unregister_sysctl();
 
diff --git a/net/ax25/ax25_out.c b/net/ax25/ax25_out.c
index 37507d8..a27046d 100644
--- a/net/ax25/ax25_out.c
+++ b/net/ax25/ax25_out.c
@@ -146,9 +146,9 @@ void ax25_output(ax25_cb *ax25, int paclen, struct sk_buff *skb)
 
 		while (skb->len > 0) {
 			spin_lock_bh(&ax25_frag_lock);
-			if ((skbn = alloc_skb(paclen + 2 + frontlen, GFP_ATOMIC)) == NULL) {
+			skbn = alloc_skb(paclen + 2 + frontlen, GFP_ATOMIC);
+			if (skbn == NULL) {
 				spin_unlock_bh(&ax25_frag_lock);
-				printk(KERN_CRIT "AX.25: ax25_output - out of memory\n");
 				return;
 			}
 
@@ -342,8 +342,8 @@ void ax25_transmit_buffer(ax25_cb *ax25, struct sk_buff *skb, int type)
 	headroom = ax25_addr_size(ax25->digipeat);
 
 	if (skb_headroom(skb) < headroom) {
-		if ((skbn = skb_realloc_headroom(skb, headroom)) == NULL) {
-			printk(KERN_CRIT "AX.25: ax25_transmit_buffer - out of memory\n");
+		skbn = skb_realloc_headroom(skb, headroom);
+		if (skbn == NULL) {
 			kfree_skb(skb);
 			return;
 		}
diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c
index a169084..75e67c0 100644
--- a/net/ax25/ax25_route.c
+++ b/net/ax25/ax25_route.c
@@ -466,10 +466,9 @@ struct sk_buff *ax25_rt_build_path(struct sk_buff *skb, ax25_address *src,
 	len = digi->ndigi * AX25_ADDR_LEN;
 
 	if (skb_headroom(skb) < len) {
-		if ((skbn = skb_realloc_headroom(skb, len)) == NULL) {
-			printk(KERN_CRIT "AX.25: ax25_dg_build_path - out of memory\n");
+		skbn = skb_realloc_headroom(skb, len);
+		if (skbn == NULL)
 			return NULL;
-		}
 
 		if (skb->sk != NULL)
 			skb_set_owner_w(skbn, skb->sk);
-- 
1.7.6.405.gc1be0

Re: [PATCH 04/24] ax25: Remove unnecessary OOM logging messages

From: Joerg Reuter <hidden>
Date: 2011-08-29 22:47:36

On Mon, Aug 29, 2011 at 02:17:23PM -0700, Joe Perches wrote:
Removing unnecessary messages saves code and text.
Not really that much of an impact, but yes, I agree it just swamps
syslog with duplicate messages... It was more debug code than
anything else originally. Beats me why it is logged as KERN_ERR or
KERN_CRIT, being out of buffers is not really fatal or even
unusual.

Still alive with just not enough time for hamradio stuff nowadays,
	Joerg DL1BKE

-- 
Joerg Reuter                                    http://yaina.de/jreuter
And I make my way to where the warm scent of soil fills the evening air. 
Everything is waiting quietly out there....                 (Anne Clark)

[PATCH 05/24] batman-adv: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:19:17

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/batman-adv/hard-interface.c |    5 +----
 net/batman-adv/main.c           |    2 --
 net/batman-adv/originator.c     |   16 ++++------------
 net/batman-adv/soft-interface.c |    4 +---
 net/batman-adv/vis.c            |    4 +---
 5 files changed, 7 insertions(+), 24 deletions(-)
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index bf91e4d..6a5312e 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -455,11 +455,8 @@ static struct hard_iface *hardif_add_interface(struct net_device *net_dev)
 	dev_hold(net_dev);
 
 	hard_iface = kmalloc(sizeof(*hard_iface), GFP_ATOMIC);
-	if (!hard_iface) {
-		pr_err("Can't add interface (%s): out of memory\n",
-		       net_dev->name);
+	if (!hard_iface)
 		goto release_dev;
-	}
 
 	ret = sysfs_add_hardif(&hard_iface->hardif_obj, net_dev);
 	if (ret)
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 79b9ae5..fb87bdc 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -117,8 +117,6 @@ int mesh_init(struct net_device *soft_iface)
 	goto end;
 
 err:
-	pr_err("Unable to allocate memory for mesh information structures: "
-	       "out of mem ?\n");
 	mesh_free(soft_iface);
 	return -1;
 
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index d448018..6e558cd 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -493,10 +493,8 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 
 	data_ptr = kmalloc(max_if_num * sizeof(unsigned long) * NUM_WORDS,
 			   GFP_ATOMIC);
-	if (!data_ptr) {
-		pr_err("Can't resize orig: out of memory\n");
+	if (!data_ptr)
 		return -1;
-	}
 
 	memcpy(data_ptr, orig_node->bcast_own,
 	       (max_if_num - 1) * sizeof(unsigned long) * NUM_WORDS);
@@ -504,10 +502,8 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 	orig_node->bcast_own = data_ptr;
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
-	if (!data_ptr) {
-		pr_err("Can't resize orig: out of memory\n");
+	if (!data_ptr)
 		return -1;
-	}
 
 	memcpy(data_ptr, orig_node->bcast_own_sum,
 	       (max_if_num - 1) * sizeof(uint8_t));
@@ -562,10 +558,8 @@ static int orig_node_del_if(struct orig_node *orig_node,
 
 	chunk_size = sizeof(unsigned long) * NUM_WORDS;
 	data_ptr = kmalloc(max_if_num * chunk_size, GFP_ATOMIC);
-	if (!data_ptr) {
-		pr_err("Can't resize orig: out of memory\n");
+	if (!data_ptr)
 		return -1;
-	}
 
 	/* copy first part */
 	memcpy(data_ptr, orig_node->bcast_own, del_if_num * chunk_size);
@@ -583,10 +577,8 @@ free_bcast_own:
 		goto free_own_sum;
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
-	if (!data_ptr) {
-		pr_err("Can't resize orig: out of memory\n");
+	if (!data_ptr)
 		return -1;
-	}
 
 	memcpy(data_ptr, orig_node->bcast_own_sum,
 	       del_if_num * sizeof(uint8_t));
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 402fd96..9b5e69e 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -800,10 +800,8 @@ struct net_device *softif_create(const char *name)
 
 	soft_iface = alloc_netdev(sizeof(*bat_priv), name, interface_setup);
 
-	if (!soft_iface) {
-		pr_err("Unable to allocate the batman interface: %s\n", name);
+	if (!soft_iface)
 		goto out;
-	}
 
 	ret = register_netdevice(soft_iface);
 	if (ret < 0) {
diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c
index fb9b19f..f81a6b6 100644
--- a/net/batman-adv/vis.c
+++ b/net/batman-adv/vis.c
@@ -887,10 +887,8 @@ int vis_init(struct bat_priv *bat_priv)
 	}
 
 	bat_priv->my_vis_info = kmalloc(MAX_VIS_PACKET_SIZE, GFP_ATOMIC);
-	if (!bat_priv->my_vis_info) {
-		pr_err("Can't initialize vis packet\n");
+	if (!bat_priv->my_vis_info)
 		goto err;
-	}
 
 	bat_priv->my_vis_info->skb_packet = dev_alloc_skb(sizeof(*packet) +
 							  MAX_VIS_PACKET_SIZE +
-- 
1.7.6.405.gc1be0

Re: [B.A.T.M.A.N.] [PATCH 05/24] batman-adv: Remove unnecessary OOM logging messages

From: Marek Lindner <hidden>
Date: 2011-08-30 10:59:00

On Monday, August 29, 2011 23:17:24 Joe Perches wrote:
Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.
Applied in our tree.

Thanks,
Marek

[PATCH 06/24] netfilter: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:19:35

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/bridge/netfilter/ebt_ulog.c         |    7 +++----
 net/ipv4/netfilter/ipt_CLUSTERIP.c      |    1 -
 net/ipv4/netfilter/ipt_ULOG.c           |    4 +---
 net/ipv4/netfilter/nf_nat_snmp_basic.c  |   22 ++--------------------
 net/ipv6/netfilter/nf_conntrack_reasm.c |    7 +++----
 net/netfilter/ipset/ip_set_core.c       |    4 +---
 net/netfilter/ipvs/ip_vs_core.c         |    5 ++---
 net/netfilter/ipvs/ip_vs_ctl.c          |   18 ++++++------------
 net/netfilter/ipvs/ip_vs_dh.c           |    5 ++---
 net/netfilter/ipvs/ip_vs_lblc.c         |    9 +++------
 net/netfilter/ipvs/ip_vs_lblcr.c        |   13 ++++---------
 net/netfilter/ipvs/ip_vs_proto.c        |    5 ++---
 net/netfilter/ipvs/ip_vs_sh.c           |    5 ++---
 net/netfilter/ipvs/ip_vs_wrr.c          |    5 ++---
 net/netfilter/nf_conntrack_core.c       |    5 +----
 net/netfilter/nfnetlink_log.c           |    7 ++-----
 net/netfilter/xt_IDLETIMER.c            |    2 --
 net/netfilter/xt_hashlimit.c            |    5 +----
 18 files changed, 37 insertions(+), 92 deletions(-)
diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c
index bf2a333..5449294 100644
--- a/net/bridge/netfilter/ebt_ulog.c
+++ b/net/bridge/netfilter/ebt_ulog.c
@@ -102,16 +102,15 @@ static struct sk_buff *ulog_alloc_skb(unsigned int size)
 	unsigned int n;
 
 	n = max(size, nlbufsiz);
-	skb = alloc_skb(n, GFP_ATOMIC);
+	skb = alloc_skb(n, GFP_ATOMIC | __GFP_NOWARN);
 	if (!skb) {
-		pr_debug("cannot alloc whole buffer of size %ub!\n", n);
 		if (n > size) {
 			/* try to allocate only as much as we need for
 			 * current packet */
 			skb = alloc_skb(size, GFP_ATOMIC);
 			if (!skb)
-				pr_debug("cannot even allocate "
-					 "buffer of size %ub\n", size);
+				pr_debug("cannot even allocate buffer of size %ub\n",
+					 size);
 		}
 	}
 
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index db8d22d..a639967 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -395,7 +395,6 @@ static int clusterip_tg_check(const struct xt_tgchk_param *par)
 			config = clusterip_config_init(cipinfo,
 							e->ip.dst.s_addr, dev);
 			if (!config) {
-				pr_info("cannot allocate config\n");
 				dev_put(dev);
 				return -ENOMEM;
 			}
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c
index 446e0f4..b550815 100644
--- a/net/ipv4/netfilter/ipt_ULOG.c
+++ b/net/ipv4/netfilter/ipt_ULOG.c
@@ -135,10 +135,8 @@ static struct sk_buff *ulog_alloc_skb(unsigned int size)
 	 * due to slab allocator restrictions */
 
 	n = max(size, nlbufsiz);
-	skb = alloc_skb(n, GFP_ATOMIC);
+	skb = alloc_skb(n, GFP_ATOMIC | __GFP_NOWARN);
 	if (!skb) {
-		pr_debug("cannot alloc whole buffer %ub!\n", n);
-
 		if (n > size) {
 			/* try to allocate only as much as we need for
 			 * current packet */
diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c
index d1cb412..2133c30 100644
--- a/net/ipv4/netfilter/nf_nat_snmp_basic.c
+++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c
@@ -400,11 +400,8 @@ static unsigned char asn1_octets_decode(struct asn1_ctx *ctx,
 	*len = 0;
 
 	*octets = kmalloc(eoc - ctx->pointer, GFP_ATOMIC);
-	if (*octets == NULL) {
-		if (net_ratelimit())
-			pr_notice("OOM in bsalg (%d)\n", __LINE__);
+	if (*octets == NULL)
 		return 0;
-	}
 
 	ptr = *octets;
 	while (ctx->pointer < eoc) {
@@ -451,11 +448,8 @@ static unsigned char asn1_oid_decode(struct asn1_ctx *ctx,
 		return 0;
 
 	*oid = kmalloc(size * sizeof(unsigned long), GFP_ATOMIC);
-	if (*oid == NULL) {
-		if (net_ratelimit())
-			pr_notice("OOM in bsalg (%d)\n", __LINE__);
+	if (*oid == NULL)
 		return 0;
-	}
 
 	optr = *oid;
 
@@ -728,8 +722,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
 		*obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
 		if (*obj == NULL) {
 			kfree(id);
-			if (net_ratelimit())
-				pr_notice("OOM in bsalg (%d)\n", __LINE__);
 			return 0;
 		}
 		(*obj)->syntax.l[0] = l;
@@ -744,8 +736,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
 		if (*obj == NULL) {
 			kfree(p);
 			kfree(id);
-			if (net_ratelimit())
-				pr_notice("OOM in bsalg (%d)\n", __LINE__);
 			return 0;
 		}
 		memcpy((*obj)->syntax.c, p, len);
@@ -759,8 +749,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
 		*obj = kmalloc(sizeof(struct snmp_object), GFP_ATOMIC);
 		if (*obj == NULL) {
 			kfree(id);
-			if (net_ratelimit())
-				pr_notice("OOM in bsalg (%d)\n", __LINE__);
 			return 0;
 		}
 		if (!asn1_null_decode(ctx, end)) {
@@ -780,8 +768,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
 		if (*obj == NULL) {
 			kfree(lp);
 			kfree(id);
-			if (net_ratelimit())
-				pr_notice("OOM in bsalg (%d)\n", __LINE__);
 			return 0;
 		}
 		memcpy((*obj)->syntax.ul, lp, len);
@@ -801,8 +787,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
 		if (*obj == NULL) {
 			kfree(p);
 			kfree(id);
-			if (net_ratelimit())
-				pr_notice("OOM in bsalg (%d)\n", __LINE__);
 			return 0;
 		}
 		memcpy((*obj)->syntax.uc, p, len);
@@ -819,8 +803,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
 		*obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
 		if (*obj == NULL) {
 			kfree(id);
-			if (net_ratelimit())
-				pr_notice("OOM in bsalg (%d)\n", __LINE__);
 			return 0;
 		}
 		(*obj)->syntax.ul[0] = ul;
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 0857272..f2f2523 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -182,7 +182,6 @@ fq_find(__be32 id, u32 user, struct in6_addr *src, struct in6_addr *dst)
 	return container_of(q, struct nf_ct_frag6_queue, q);
 
 oom:
-	pr_debug("Can't alloc new queue\n");
 	return NULL;
 }
 
@@ -370,10 +369,10 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
 		struct sk_buff *clone;
 		int i, plen = 0;
 
-		if ((clone = alloc_skb(0, GFP_ATOMIC)) == NULL) {
-			pr_debug("Can't alloc skb\n");
+		clone = alloc_skb(0, GFP_ATOMIC);
+		if (clone == NULL)
 			goto out_oom;
-		}
+
 		clone->next = head->next;
 		head->next = clone;
 		skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list;
diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
index d7e86ef..86137b5 100644
--- a/net/netfilter/ipset/ip_set_core.c
+++ b/net/netfilter/ipset/ip_set_core.c
@@ -1699,10 +1699,8 @@ ip_set_init(void)
 
 	ip_set_list = kzalloc(sizeof(struct ip_set *) * ip_set_max,
 			      GFP_KERNEL);
-	if (!ip_set_list) {
-		pr_err("ip_set: Unable to create ip_set_list\n");
+	if (!ip_set_list)
 		return -ENOMEM;
-	}
 
 	ret = nfnetlink_subsys_register(&ip_set_netlink_subsys);
 	if (ret != 0) {
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 4f77bb1..67d7ff7 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1878,10 +1878,9 @@ static int __net_init __ip_vs_init(struct net *net)
 	struct netns_ipvs *ipvs;
 
 	ipvs = net_generic(net, ip_vs_net_id);
-	if (ipvs == NULL) {
-		pr_err("%s(): no memory.\n", __func__);
+	if (ipvs == NULL)
 		return -ENOMEM;
-	}
+
 	/* Hold the beast until a service is registerd */
 	ipvs->enable = 0;
 	ipvs->net = net;
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 2b771dc..1d1926c 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -856,15 +856,12 @@ ip_vs_new_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest,
 	}
 
 	dest = kzalloc(sizeof(struct ip_vs_dest), GFP_KERNEL);
-	if (dest == NULL) {
-		pr_err("%s(): no memory.\n", __func__);
+	if (dest == NULL)
 		return -ENOMEM;
-	}
+
 	dest->stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats);
-	if (!dest->stats.cpustats) {
-		pr_err("%s() alloc_percpu failed\n", __func__);
+	if (!dest->stats.cpustats)
 		goto err_alloc;
-	}
 
 	dest->af = svc->af;
 	dest->protocol = svc->protocol;
@@ -1168,10 +1165,8 @@ ip_vs_add_service(struct net *net, struct ip_vs_service_user_kern *u,
 		goto out_err;
 	}
 	svc->stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats);
-	if (!svc->stats.cpustats) {
-		pr_err("%s() alloc_percpu failed\n", __func__);
+	if (!svc->stats.cpustats)
 		goto out_err;
-	}
 
 	/* I'm the first user of the service */
 	atomic_set(&svc->usecnt, 0);
@@ -3691,10 +3686,9 @@ int __net_init ip_vs_control_net_init(struct net *net)
 
 	/* procfs stats */
 	ipvs->tot_stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats);
-	if (!ipvs->tot_stats.cpustats) {
-		pr_err("%s(): alloc_percpu.\n", __func__);
+	if (!ipvs->tot_stats.cpustats)
 		return -ENOMEM;
-	}
+
 	spin_lock_init(&ipvs->tot_stats.lock);
 
 	proc_net_fops_create(net, "ip_vs", 0, &ip_vs_info_fops);
diff --git a/net/netfilter/ipvs/ip_vs_dh.c b/net/netfilter/ipvs/ip_vs_dh.c
index 95fd0d1..1c269e5 100644
--- a/net/netfilter/ipvs/ip_vs_dh.c
+++ b/net/netfilter/ipvs/ip_vs_dh.c
@@ -150,10 +150,9 @@ static int ip_vs_dh_init_svc(struct ip_vs_service *svc)
 	/* allocate the DH table for this service */
 	tbl = kmalloc(sizeof(struct ip_vs_dh_bucket)*IP_VS_DH_TAB_SIZE,
 		      GFP_ATOMIC);
-	if (tbl == NULL) {
-		pr_err("%s(): no memory\n", __func__);
+	if (tbl == NULL)
 		return -ENOMEM;
-	}
+
 	svc->sched_data = tbl;
 	IP_VS_DBG(6, "DH hash table (memory=%Zdbytes) allocated for "
 		  "current service\n",
diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c
index 87e40ea..0f16283 100644
--- a/net/netfilter/ipvs/ip_vs_lblc.c
+++ b/net/netfilter/ipvs/ip_vs_lblc.c
@@ -202,10 +202,8 @@ ip_vs_lblc_new(struct ip_vs_lblc_table *tbl, const union nf_inet_addr *daddr,
 	en = ip_vs_lblc_get(dest->af, tbl, daddr);
 	if (!en) {
 		en = kmalloc(sizeof(*en), GFP_ATOMIC);
-		if (!en) {
-			pr_err("%s(): no memory\n", __func__);
+		if (!en)
 			return NULL;
-		}
 
 		en->af = dest->af;
 		ip_vs_addr_copy(dest->af, &en->addr, daddr);
@@ -345,10 +343,9 @@ static int ip_vs_lblc_init_svc(struct ip_vs_service *svc)
 	 *    Allocate the ip_vs_lblc_table for this service
 	 */
 	tbl = kmalloc(sizeof(*tbl), GFP_ATOMIC);
-	if (tbl == NULL) {
-		pr_err("%s(): no memory\n", __func__);
+	if (tbl == NULL)
 		return -ENOMEM;
-	}
+
 	svc->sched_data = tbl;
 	IP_VS_DBG(6, "LBLC hash table (memory=%Zdbytes) allocated for "
 		  "current service\n", sizeof(*tbl));
diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c
index 90f618a..eec797f 100644
--- a/net/netfilter/ipvs/ip_vs_lblcr.c
+++ b/net/netfilter/ipvs/ip_vs_lblcr.c
@@ -112,10 +112,8 @@ ip_vs_dest_set_insert(struct ip_vs_dest_set *set, struct ip_vs_dest *dest)
 	}
 
 	e = kmalloc(sizeof(*e), GFP_ATOMIC);
-	if (e == NULL) {
-		pr_err("%s(): no memory\n", __func__);
+	if (e == NULL)
 		return NULL;
-	}
 
 	atomic_inc(&dest->refcnt);
 	e->dest = dest;
@@ -373,10 +371,8 @@ ip_vs_lblcr_new(struct ip_vs_lblcr_table *tbl, const union nf_inet_addr *daddr,
 	en = ip_vs_lblcr_get(dest->af, tbl, daddr);
 	if (!en) {
 		en = kmalloc(sizeof(*en), GFP_ATOMIC);
-		if (!en) {
-			pr_err("%s(): no memory\n", __func__);
+		if (!en)
 			return NULL;
-		}
 
 		en->af = dest->af;
 		ip_vs_addr_copy(dest->af, &en->addr, daddr);
@@ -516,10 +512,9 @@ static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc)
 	 *    Allocate the ip_vs_lblcr_table for this service
 	 */
 	tbl = kmalloc(sizeof(*tbl), GFP_ATOMIC);
-	if (tbl == NULL) {
-		pr_err("%s(): no memory\n", __func__);
+	if (tbl == NULL)
 		return -ENOMEM;
-	}
+
 	svc->sched_data = tbl;
 	IP_VS_DBG(6, "LBLCR hash table (memory=%Zdbytes) allocated for "
 		  "current service\n", sizeof(*tbl));
diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c
index 52d073c..8531293 100644
--- a/net/netfilter/ipvs/ip_vs_proto.c
+++ b/net/netfilter/ipvs/ip_vs_proto.c
@@ -74,10 +74,9 @@ register_ip_vs_proto_netns(struct net *net, struct ip_vs_protocol *pp)
 	struct ip_vs_proto_data *pd =
 			kzalloc(sizeof(struct ip_vs_proto_data), GFP_ATOMIC);
 
-	if (!pd) {
-		pr_err("%s(): no memory.\n", __func__);
+	if (!pd)
 		return -ENOMEM;
-	}
+
 	pd->pp = pp;	/* For speed issues */
 	pd->next = ipvs->proto_data_table[hash];
 	ipvs->proto_data_table[hash] = pd;
diff --git a/net/netfilter/ipvs/ip_vs_sh.c b/net/netfilter/ipvs/ip_vs_sh.c
index b5e2556..33815f4 100644
--- a/net/netfilter/ipvs/ip_vs_sh.c
+++ b/net/netfilter/ipvs/ip_vs_sh.c
@@ -147,10 +147,9 @@ static int ip_vs_sh_init_svc(struct ip_vs_service *svc)
 	/* allocate the SH table for this service */
 	tbl = kmalloc(sizeof(struct ip_vs_sh_bucket)*IP_VS_SH_TAB_SIZE,
 		      GFP_ATOMIC);
-	if (tbl == NULL) {
-		pr_err("%s(): no memory\n", __func__);
+	if (tbl == NULL)
 		return -ENOMEM;
-	}
+
 	svc->sched_data = tbl;
 	IP_VS_DBG(6, "SH hash table (memory=%Zdbytes) allocated for "
 		  "current service\n",
diff --git a/net/netfilter/ipvs/ip_vs_wrr.c b/net/netfilter/ipvs/ip_vs_wrr.c
index 1ef41f5..fd0d4e0 100644
--- a/net/netfilter/ipvs/ip_vs_wrr.c
+++ b/net/netfilter/ipvs/ip_vs_wrr.c
@@ -85,10 +85,9 @@ static int ip_vs_wrr_init_svc(struct ip_vs_service *svc)
 	 *    Allocate the mark variable for WRR scheduling
 	 */
 	mark = kmalloc(sizeof(struct ip_vs_wrr_mark), GFP_ATOMIC);
-	if (mark == NULL) {
-		pr_err("%s(): no memory\n", __func__);
+	if (mark == NULL)
 		return -ENOMEM;
-	}
+
 	mark->cl = &svc->destinations;
 	mark->cw = 0;
 	mark->mw = ip_vs_wrr_max_weight(svc);
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 5acfaf5..7202b06 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -661,7 +661,6 @@ __nf_conntrack_alloc(struct net *net, u16 zone,
 	 */
 	ct = kmem_cache_alloc(net->ct.nf_conntrack_cachep, gfp);
 	if (ct == NULL) {
-		pr_debug("nf_conntrack_alloc: Can't alloc conntrack.\n");
 		atomic_dec(&net->ct.count);
 		return ERR_PTR(-ENOMEM);
 	}
@@ -749,10 +748,8 @@ init_conntrack(struct net *net, struct nf_conn *tmpl,
 
 	ct = __nf_conntrack_alloc(net, zone, tuple, &repl_tuple, GFP_ATOMIC,
 				  hash);
-	if (IS_ERR(ct)) {
-		pr_debug("Can't allocate conntrack.\n");
+	if (IS_ERR(ct))
 		return (struct nf_conntrack_tuple_hash *)ct;
-	}
 
 	if (!l4proto->new(ct, skb, dataoff)) {
 		nf_conntrack_free(ct);
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 2d8158a..66b2c54 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -307,17 +307,14 @@ nfulnl_alloc_skb(unsigned int inst_size, unsigned int pkt_size)
 	n = max(inst_size, pkt_size);
 	skb = alloc_skb(n, GFP_ATOMIC);
 	if (!skb) {
-		pr_notice("nfnetlink_log: can't alloc whole buffer (%u bytes)\n",
-			inst_size);
-
 		if (n > pkt_size) {
 			/* try to allocate only as much as we need for current
 			 * packet */
 
 			skb = alloc_skb(pkt_size, GFP_ATOMIC);
 			if (!skb)
-				pr_err("nfnetlink_log: can't even alloc %u "
-				       "bytes\n", pkt_size);
+				pr_err("nfnetlink_log: can't even alloc %u bytes\n",
+				       pkt_size);
 		}
 	}
 
diff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c
index 3bdd443..f407ebc1 100644
--- a/net/netfilter/xt_IDLETIMER.c
+++ b/net/netfilter/xt_IDLETIMER.c
@@ -122,14 +122,12 @@ static int idletimer_tg_create(struct idletimer_tg_info *info)
 
 	info->timer = kmalloc(sizeof(*info->timer), GFP_KERNEL);
 	if (!info->timer) {
-		pr_debug("couldn't alloc timer\n");
 		ret = -ENOMEM;
 		goto out;
 	}
 
 	info->timer->attr.attr.name = kstrdup(info->label, GFP_KERNEL);
 	if (!info->timer->attr.attr.name) {
-		pr_debug("couldn't alloc attribute name\n");
 		ret = -ENOMEM;
 		goto out_free_timer;
 	}
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index 9228ee0..dfd52ba 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -176,10 +176,7 @@ dsthash_alloc_init(struct xt_hashlimit_htable *ht,
 		ent = NULL;
 	} else
 		ent = kmem_cache_alloc(hashlimit_cachep, GFP_ATOMIC);
-	if (!ent) {
-		if (net_ratelimit())
-			pr_err("cannot allocate dsthash_ent\n");
-	} else {
+	if (ent) {
 		memcpy(&ent->dst, dst, sizeof(ent->dst));
 		spin_lock_init(&ent->lock);
 
-- 
1.7.6.405.gc1be0

Re: [PATCH 06/24] netfilter: Remove unnecessary OOM logging messages

From: Patrick McHardy <hidden>
Date: 2011-08-30 12:46:38

On 29.08.2011 23:17, Joe Perches wrote:
Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.
Looks good to me. Do you want me to apply this patch or are you
intending to have the entire series go through Dave?

Re: [PATCH 06/24] netfilter: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-30 16:13:42

On Tue, 2011-08-30 at 14:46 +0200, Patrick McHardy wrote:
On 29.08.2011 23:17, Joe Perches wrote:
quoted
Removing unnecessary messages saves code and text.
Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.
Looks good to me. Do you want me to apply this patch or are you
intending to have the entire series go through Dave?
It doesn't matter to me one way or another.

If you pick this one up, when I redo these
to separate vmalloc from the the other alloc
cases, I'll won't send netfilter again.

cheers, Joe

Re: [PATCH 06/24] netfilter: Remove unnecessary OOM logging messages

From: David Miller <davem@davemloft.net>
Date: 2011-08-30 18:01:25

From: Patrick McHardy <redacted>
Date: Tue, 30 Aug 2011 14:46:34 +0200
On 29.08.2011 23:17, Joe Perches wrote:
quoted
Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.
Looks good to me. Do you want me to apply this patch or are you
intending to have the entire series go through Dave?
I'm happy with subsystem folks taking things in if they want, the
B.A.T.M.A.N. guys did this earlier today for example.

Re: [PATCH 06/24] netfilter: Remove unnecessary OOM logging messages

From: Patrick McHardy <hidden>
Date: 2011-08-31 10:13:08

On 30.08.2011 19:55, David Miller wrote:
From: Patrick McHardy <redacted>
Date: Tue, 30 Aug 2011 14:46:34 +0200
quoted
On 29.08.2011 23:17, Joe Perches wrote:
quoted
Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.
Looks good to me. Do you want me to apply this patch or are you
intending to have the entire series go through Dave?
I'm happy with subsystem folks taking things in if they want, the
B.A.T.M.A.N. guys did this earlier today for example.
OK, thanks.

Applied after fixing up some minor rejects in nf_nat_snmp_basic.c,
thanks Joe.

Re: [PATCH 06/24] netfilter: Remove unnecessary OOM logging messages

From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: 2011-10-11 00:15:11

On Wed, Aug 31, 2011 at 12:13:02PM +0200, Patrick McHardy wrote:
On 30.08.2011 19:55, David Miller wrote:
quoted
From: Patrick McHardy <redacted>
Date: Tue, 30 Aug 2011 14:46:34 +0200
quoted
On 29.08.2011 23:17, Joe Perches wrote:
quoted
Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.
Looks good to me. Do you want me to apply this patch or are you
intending to have the entire series go through Dave?
I'm happy with subsystem folks taking things in if they want, the
B.A.T.M.A.N. guys did this earlier today for example.
OK, thanks.

Applied after fixing up some minor rejects in nf_nat_snmp_basic.c,
thanks Joe.
I have rescued this patch and put into this tree:

http://1984.lsi.us.es/git/?p=net-next/.git;a=shortlog;h=refs/heads/nf-next

At that time (kernel.org problems), we had no public tree and Patrick
temporarily stored in his internal tree.

[PATCH 07/24] can: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:19:45

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/can/af_can.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/can/af_can.c b/net/can/af_can.c
index b9efa94..11300be 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -770,11 +770,9 @@ static int can_notifier(struct notifier_block *nb, unsigned long msg,
 
 		/* create new dev_rcv_lists for this device */
 		d = kzalloc(sizeof(*d), GFP_KERNEL);
-		if (!d) {
-			printk(KERN_ERR
-			       "can: allocation of receive list failed\n");
+		if (!d)
 			return NOTIFY_DONE;
-		}
+
 		BUG_ON(dev->ml_priv);
 		dev->ml_priv = d;
 
-- 
1.7.6.405.gc1be0

Re: [PATCH 07/24] can: Remove unnecessary OOM logging messages

From: Oliver Hartkopp <socketcan@hartkopp.net>
Date: 2011-08-31 17:11:24

On 29.08.2011 23:17, Joe Perches wrote:
Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>

Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>

Tnx Joe.
quoted hunk
---
 net/can/af_can.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/can/af_can.c b/net/can/af_can.c
index b9efa94..11300be 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -770,11 +770,9 @@ static int can_notifier(struct notifier_block *nb, unsigned long msg,
 
 		/* create new dev_rcv_lists for this device */
 		d = kzalloc(sizeof(*d), GFP_KERNEL);
-		if (!d) {
-			printk(KERN_ERR
-			       "can: allocation of receive list failed\n");
+		if (!d)
 			return NOTIFY_DONE;
-		}
+
 		BUG_ON(dev->ml_priv);
 		dev->ml_priv = d;
 

[PATCH 08/24] ceph: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:19:52

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/ceph/messenger.c |    5 +----
 net/ceph/msgpool.c   |    6 +-----
 2 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index c340e2e..2cd6683 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2331,11 +2331,8 @@ struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags)
 		} else {
 			m->front.iov_base = kmalloc(front_len, flags);
 		}
-		if (m->front.iov_base == NULL) {
-			pr_err("msg_new can't allocate %d bytes\n",
-			     front_len);
+		if (m->front.iov_base == NULL)
 			goto out2;
-		}
 	} else {
 		m->front.iov_base = NULL;
 	}
diff --git a/net/ceph/msgpool.c b/net/ceph/msgpool.c
index d5f2d97..4ac37d4 100644
--- a/net/ceph/msgpool.c
+++ b/net/ceph/msgpool.c
@@ -10,12 +10,8 @@
 static void *alloc_fn(gfp_t gfp_mask, void *arg)
 {
 	struct ceph_msgpool *pool = arg;
-	void *p;
 
-	p = ceph_msg_new(0, pool->front_len, gfp_mask);
-	if (!p)
-		pr_err("msgpool %s alloc failed\n", pool->name);
-	return p;
+	return ceph_msg_new(0, pool->front_len, gfp_mask);
 }
 
 static void free_fn(void *element, void *arg)
-- 
1.7.6.405.gc1be0

[PATCH 09/24] decnet: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:20:04

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/decnet/dn_neigh.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c
index 7f0eb08..0889870 100644
--- a/net/decnet/dn_neigh.c
+++ b/net/decnet/dn_neigh.c
@@ -230,8 +230,6 @@ static int dn_long_output(struct neighbour *neigh, struct sk_buff *skb)
 	if (skb_headroom(skb) < headroom) {
 		struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom);
 		if (skb2 == NULL) {
-			if (net_ratelimit())
-				printk(KERN_CRIT "dn_long_output: no memory\n");
 			kfree_skb(skb);
 			return -ENOBUFS;
 		}
@@ -275,8 +273,6 @@ static int dn_short_output(struct neighbour *neigh, struct sk_buff *skb)
 	if (skb_headroom(skb) < headroom) {
 		struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom);
 		if (skb2 == NULL) {
-			if (net_ratelimit())
-				printk(KERN_CRIT "dn_short_output: no memory\n");
 			kfree_skb(skb);
 			return -ENOBUFS;
 		}
@@ -316,8 +312,6 @@ static int dn_phase3_output(struct neighbour *neigh, struct sk_buff *skb)
 	if (skb_headroom(skb) < headroom) {
 		struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom);
 		if (skb2 == NULL) {
-			if (net_ratelimit())
-				printk(KERN_CRIT "dn_phase3_output: no memory\n");
 			kfree_skb(skb);
 			return -ENOBUFS;
 		}
-- 
1.7.6.405.gc1be0

[PATCH 10/24] econet: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:20:11

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/econet/af_econet.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c
index 1c1f26c..6ab525d 100644
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -865,11 +865,9 @@ static void aun_incoming(struct sk_buff *skb, struct aunhdr *ah, size_t len)
 
 	newskb = alloc_skb((len - sizeof(struct aunhdr) + 15) & ~15,
 			   GFP_ATOMIC);
-	if (newskb == NULL) {
-		pr_debug("AUN: memory squeeze, dropping packet\n");
+	if (newskb == NULL)
 		/* Send nack and hope sender tries again */
 		goto bad;
-	}
 
 	memcpy(skb_put(newskb, len - sizeof(struct aunhdr)), (void *)(ah + 1),
 	       len - sizeof(struct aunhdr));
-- 
1.7.6.405.gc1be0

[PATCH 11/24] iucv: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:20:22

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/iucv/iucv.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c
index 403be43..5cf493d 100644
--- a/net/iucv/iucv.c
+++ b/net/iucv/iucv.c
@@ -1815,10 +1815,9 @@ static void iucv_external_interrupt(unsigned int ext_int_code,
 	}
 	BUG_ON(p->iptype  < 0x01 || p->iptype > 0x09);
 	work = kmalloc(sizeof(struct iucv_irq_list), GFP_ATOMIC);
-	if (!work) {
-		pr_warning("iucv_external_interrupt: out of memory\n");
+	if (!work)
 		return;
-	}
+
 	memcpy(&work->data, p, sizeof(work->data));
 	spin_lock(&iucv_queue_lock);
 	if (p->iptype == 0x01) {
-- 
1.7.6.405.gc1be0

[PATCH 12/24] mac80211: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:20:36

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/mac80211/agg-rx.c    |   19 ++-----------------
 net/mac80211/agg-tx.c    |   35 ++++++++---------------------------
 net/mac80211/debugfs.c   |    3 +++
 net/mac80211/ht.c        |    6 +-----
 net/mac80211/mesh.c      |    5 ++---
 net/mac80211/mlme.c      |   17 +++++------------
 net/mac80211/spectmgmt.c |    6 +-----
 net/mac80211/tx.c        |   17 +++++------------
 net/mac80211/util.c      |   11 +++--------
 net/mac80211/work.c      |    6 ++----
 10 files changed, 32 insertions(+), 93 deletions(-)
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
index 9b5bd8c..7c366df 100644
--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -167,12 +167,8 @@ static void ieee80211_send_addba_resp(struct ieee80211_sub_if_data *sdata, u8 *d
 	u16 capab;
 
 	skb = dev_alloc_skb(sizeof(*mgmt) + local->hw.extra_tx_headroom);
-
-	if (!skb) {
-		printk(KERN_DEBUG "%s: failed to allocate buffer "
-		       "for addba resp frame\n", sdata->name);
+	if (!skb)
 		return;
-	}
 
 	skb_reserve(skb, local->hw.extra_tx_headroom);
 	mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24);
@@ -279,14 +275,8 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
 
 	/* prepare A-MPDU MLME for Rx aggregation */
 	tid_agg_rx = kmalloc(sizeof(struct tid_ampdu_rx), GFP_KERNEL);
-	if (!tid_agg_rx) {
-#ifdef CONFIG_MAC80211_HT_DEBUG
-		if (net_ratelimit())
-			printk(KERN_ERR "allocate rx mlme to tid %d failed\n",
-					tid);
-#endif
+	if (!tid_agg_rx)
 		goto end;
-	}
 
 	spin_lock_init(&tid_agg_rx->reorder_lock);
 
@@ -306,11 +296,6 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
 	tid_agg_rx->reorder_time =
 		kcalloc(buf_size, sizeof(unsigned long), GFP_KERNEL);
 	if (!tid_agg_rx->reorder_buf || !tid_agg_rx->reorder_time) {
-#ifdef CONFIG_MAC80211_HT_DEBUG
-		if (net_ratelimit())
-			printk(KERN_ERR "can not allocate reordering buffer "
-			       "to tid %d\n", tid);
-#endif
 		kfree(tid_agg_rx->reorder_buf);
 		kfree(tid_agg_rx->reorder_time);
 		kfree(tid_agg_rx);
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index b7075f3..7f568d6 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -68,11 +68,9 @@ static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata,
 
 	skb = dev_alloc_skb(sizeof(*mgmt) + local->hw.extra_tx_headroom);
 
-	if (!skb) {
-		printk(KERN_ERR "%s: failed to allocate buffer "
-				"for addba request frame\n", sdata->name);
+	if (!skb)
 		return;
-	}
+
 	skb_reserve(skb, local->hw.extra_tx_headroom);
 	mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24);
 	memset(mgmt, 0, 24);
@@ -114,11 +112,9 @@ void ieee80211_send_bar(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, u1
 	u16 bar_control = 0;
 
 	skb = dev_alloc_skb(sizeof(*bar) + local->hw.extra_tx_headroom);
-	if (!skb) {
-		printk(KERN_ERR "%s: failed to allocate buffer for "
-			"bar frame\n", sdata->name);
+	if (!skb)
 		return;
-	}
+
 	skb_reserve(skb, local->hw.extra_tx_headroom);
 	bar = (struct ieee80211_bar *)skb_put(skb, sizeof(*bar));
 	memset(bar, 0, sizeof(*bar));
@@ -413,11 +409,6 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
 	/* prepare A-MPDU MLME for Tx aggregation */
 	tid_tx = kzalloc(sizeof(struct tid_ampdu_tx), GFP_ATOMIC);
 	if (!tid_tx) {
-#ifdef CONFIG_MAC80211_HT_DEBUG
-		if (net_ratelimit())
-			printk(KERN_ERR "allocate tx mlme to tid %d failed\n",
-					tid);
-#endif
 		ret = -ENOMEM;
 		goto err_unlock_sta;
 	}
@@ -574,14 +565,9 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif,
 	struct ieee80211_ra_tid *ra_tid;
 	struct sk_buff *skb = dev_alloc_skb(0);
 
-	if (unlikely(!skb)) {
-#ifdef CONFIG_MAC80211_HT_DEBUG
-		if (net_ratelimit())
-			printk(KERN_WARNING "%s: Not enough memory, "
-			       "dropping start BA session", sdata->name);
-#endif
+	if (unlikely(!skb))
 		return;
-	}
+
 	ra_tid = (struct ieee80211_ra_tid *) &skb->cb;
 	memcpy(&ra_tid->ra, ra, ETH_ALEN);
 	ra_tid->tid = tid;
@@ -727,14 +713,9 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif,
 	struct ieee80211_ra_tid *ra_tid;
 	struct sk_buff *skb = dev_alloc_skb(0);
 
-	if (unlikely(!skb)) {
-#ifdef CONFIG_MAC80211_HT_DEBUG
-		if (net_ratelimit())
-			printk(KERN_WARNING "%s: Not enough memory, "
-			       "dropping stop BA session", sdata->name);
-#endif
+	if (unlikely(!skb))
 		return;
-	}
+
 	ra_tid = (struct ieee80211_ra_tid *) &skb->cb;
 	memcpy(&ra_tid->ra, ra, ETH_ALEN);
 	ra_tid->tid = tid;
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index 186e02f..583c9ed 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -305,6 +305,9 @@ static ssize_t hwflags_read(struct file *file, char __user *user_buf,
 	char *buf = kzalloc(mxln, GFP_KERNEL);
 	int sf = 0; /* how many written so far */
 
+	if (!buf)
+		return 0;
+
 	sf += snprintf(buf, mxln - sf, "0x%x\n", local->hw.flags);
 	if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL)
 		sf += snprintf(buf + sf, mxln - sf, "HAS_RATE_CONTROL\n");
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index 7cfc286..2b9b52c 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -186,12 +186,8 @@ void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
 	u16 params;
 
 	skb = dev_alloc_skb(sizeof(*mgmt) + local->hw.extra_tx_headroom);
-
-	if (!skb) {
-		printk(KERN_ERR "%s: failed to allocate buffer "
-					"for delba frame\n", sdata->name);
+	if (!skb)
 		return;
-	}
 
 	skb_reserve(skb, local->hw.extra_tx_headroom);
 	mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24);
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 29e9980..d262f38 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -193,10 +193,9 @@ int mesh_rmc_check(u8 *sa, struct ieee80211s_hdr *mesh_hdr,
 	}
 
 	p = kmem_cache_alloc(rm_cache, GFP_ATOMIC);
-	if (!p) {
-		printk(KERN_DEBUG "o11s: could not allocate RMC entry\n");
+	if (!p)
 		return 0;
-	}
+
 	p->seqnum = seqnum;
 	p->exp_time = jiffies + RMC_TIMEOUT;
 	memcpy(p->sa, sa, ETH_ALEN);
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index d6470c7..f193a91 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -271,11 +271,9 @@ static void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata,
 	struct ieee80211_mgmt *mgmt;
 
 	skb = dev_alloc_skb(local->hw.extra_tx_headroom + sizeof(*mgmt));
-	if (!skb) {
-		printk(KERN_DEBUG "%s: failed to allocate buffer for "
-		       "deauth/disassoc frame\n", sdata->name);
+	if (!skb)
 		return;
-	}
+
 	skb_reserve(skb, local->hw.extra_tx_headroom);
 
 	mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24);
@@ -354,11 +352,9 @@ static void ieee80211_send_4addr_nullfunc(struct ieee80211_local *local,
 		return;
 
 	skb = dev_alloc_skb(local->hw.extra_tx_headroom + 30);
-	if (!skb) {
-		printk(KERN_DEBUG "%s: failed to allocate buffer for 4addr "
-		       "nullfunc frame\n", sdata->name);
+	if (!skb)
 		return;
-	}
+
 	skb_reserve(skb, local->hw.extra_tx_headroom);
 
 	nullfunc = (struct ieee80211_hdr *) skb_put(skb, 30);
@@ -1483,11 +1479,8 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
 	ifmgd->aid = aid;
 
 	sta = sta_info_alloc(sdata, cbss->bssid, GFP_KERNEL);
-	if (!sta) {
-		printk(KERN_DEBUG "%s: failed to alloc STA entry for"
-		       " the AP\n", sdata->name);
+	if (!sta)
 		return false;
-	}
 
 	set_sta_flags(sta, WLAN_STA_AUTH | WLAN_STA_ASSOC |
 			   WLAN_STA_ASSOC_AP);
diff --git a/net/mac80211/spectmgmt.c b/net/mac80211/spectmgmt.c
index 7733f66..578eea3 100644
--- a/net/mac80211/spectmgmt.c
+++ b/net/mac80211/spectmgmt.c
@@ -32,12 +32,8 @@ static void ieee80211_send_refuse_measurement_request(struct ieee80211_sub_if_da
 
 	skb = dev_alloc_skb(sizeof(*msr_report) + local->hw.extra_tx_headroom +
 				sizeof(struct ieee80211_msrment_ie));
-
-	if (!skb) {
-		printk(KERN_ERR "%s: failed to allocate buffer for "
-				"measurement report frame\n", sdata->name);
+	if (!skb)
 		return;
-	}
 
 	skb_reserve(skb, local->hw.extra_tx_headroom);
 	msr_report = (struct ieee80211_mgmt *)skb_put(skb, 24);
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 69fd494..55bc1f6 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2355,11 +2355,9 @@ struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw,
 	local = sdata->local;
 
 	skb = dev_alloc_skb(local->hw.extra_tx_headroom + sizeof(*pspoll));
-	if (!skb) {
-		printk(KERN_DEBUG "%s: failed to allocate buffer for "
-		       "pspoll template\n", sdata->name);
+	if (!skb)
 		return NULL;
-	}
+
 	skb_reserve(skb, local->hw.extra_tx_headroom);
 
 	pspoll = (struct ieee80211_pspoll *) skb_put(skb, sizeof(*pspoll));
@@ -2395,11 +2393,9 @@ struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
 	local = sdata->local;
 
 	skb = dev_alloc_skb(local->hw.extra_tx_headroom + sizeof(*nullfunc));
-	if (!skb) {
-		printk(KERN_DEBUG "%s: failed to allocate buffer for nullfunc "
-		       "template\n", sdata->name);
+	if (!skb)
 		return NULL;
-	}
+
 	skb_reserve(skb, local->hw.extra_tx_headroom);
 
 	nullfunc = (struct ieee80211_hdr_3addr *) skb_put(skb,
@@ -2434,11 +2430,8 @@ struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw *hw,
 
 	skb = dev_alloc_skb(local->hw.extra_tx_headroom + sizeof(*hdr) +
 			    ie_ssid_len + ie_len);
-	if (!skb) {
-		printk(KERN_DEBUG "%s: failed to allocate buffer for probe "
-		       "request template\n", sdata->name);
+	if (!skb)
 		return NULL;
-	}
 
 	skb_reserve(skb, local->hw.extra_tx_headroom);
 
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index ce916ff..1c10802 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -707,11 +707,9 @@ void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
 
 	skb = dev_alloc_skb(local->hw.extra_tx_headroom +
 			    sizeof(*mgmt) + 6 + extra_len);
-	if (!skb) {
-		printk(KERN_DEBUG "%s: failed to allocate buffer for auth "
-		       "frame\n", sdata->name);
+	if (!skb)
 		return;
-	}
+
 	skb_reserve(skb, local->hw.extra_tx_headroom);
 
 	mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24 + 6);
@@ -864,11 +862,8 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
 
 	/* FIXME: come up with a proper value */
 	buf = kmalloc(200 + ie_len, GFP_KERNEL);
-	if (!buf) {
-		printk(KERN_DEBUG "%s: failed to allocate temporary IE "
-		       "buffer\n", sdata->name);
+	if (!buf)
 		return NULL;
-	}
 
 	/*
 	 * Do not send DS Channel parameter for directed probe requests
diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index 380b9a7..bac3439 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -229,11 +229,9 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata,
 			wk->ie_len + /* extra IEs */
 			9, /* WMM */
 			GFP_KERNEL);
-	if (!skb) {
-		printk(KERN_DEBUG "%s: failed to allocate buffer for assoc "
-		       "frame\n", sdata->name);
+	if (!skb)
 		return;
-	}
+
 	skb_reserve(skb, local->hw.extra_tx_headroom);
 
 	capab = WLAN_CAPABILITY_ESS;
-- 
1.7.6.405.gc1be0

[PATCH 13/24] netrom: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:20:45

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/netrom/af_netrom.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 732152f..72801b28 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -1405,10 +1405,8 @@ static int __init nr_proto_init(void)
 	}
 
 	dev_nr = kzalloc(nr_ndevs * sizeof(struct net_device *), GFP_KERNEL);
-	if (dev_nr == NULL) {
-		printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device array\n");
+	if (dev_nr == NULL)
 		return -1;
-	}
 
 	for (i = 0; i < nr_ndevs; i++) {
 		char name[IFNAMSIZ];
@@ -1416,10 +1414,8 @@ static int __init nr_proto_init(void)
 
 		sprintf(name, "nr%d", i);
 		dev = alloc_netdev(0, name, nr_setup);
-		if (!dev) {
-			printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device structure\n");
+		if (!dev)
 			goto fail;
-		}
 
 		dev->base_addr = i;
 		if (register_netdev(dev)) {
-- 
1.7.6.405.gc1be0

[PATCH 14/24] rds: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:20:55

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/rds/ib_rdma.c |    1 -
 net/rds/iw_rdma.c |    8 +-------
 net/rds/iw_send.c |    8 ++------
 3 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c
index 819c35a..3b76b74 100644
--- a/net/rds/ib_rdma.c
+++ b/net/rds/ib_rdma.c
@@ -355,7 +355,6 @@ static struct rds_ib_mr *rds_ib_alloc_fmr(struct rds_ib_device *rds_ibdev)
 	if (IS_ERR(ibmr->fmr)) {
 		err = PTR_ERR(ibmr->fmr);
 		ibmr->fmr = NULL;
-		printk(KERN_WARNING "RDS/IB: ib_alloc_fmr failed (err=%d)\n", err);
 		goto out_no_cigar;
 	}
 
diff --git a/net/rds/iw_rdma.c b/net/rds/iw_rdma.c
index 8b77edb..7b18283 100644
--- a/net/rds/iw_rdma.c
+++ b/net/rds/iw_rdma.c
@@ -339,10 +339,8 @@ struct rds_iw_mr_pool *rds_iw_create_mr_pool(struct rds_iw_device *rds_iwdev)
 	struct rds_iw_mr_pool *pool;
 
 	pool = kzalloc(sizeof(*pool), GFP_KERNEL);
-	if (!pool) {
-		printk(KERN_WARNING "RDS/IW: rds_iw_create_mr_pool alloc error\n");
+	if (!pool)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	pool->device = rds_iwdev;
 	INIT_LIST_HEAD(&pool->dirty_list);
@@ -676,8 +674,6 @@ static int rds_iw_init_fastreg(struct rds_iw_mr_pool *pool,
 	mr = ib_alloc_fast_reg_mr(rds_iwdev->pd, pool->max_message_size);
 	if (IS_ERR(mr)) {
 		err = PTR_ERR(mr);
-
-		printk(KERN_WARNING "RDS/IW: ib_alloc_fast_reg_mr failed (err=%d)\n", err);
 		return err;
 	}
 
@@ -687,8 +683,6 @@ static int rds_iw_init_fastreg(struct rds_iw_mr_pool *pool,
 	page_list = ib_alloc_fast_reg_page_list(rds_iwdev->dev, pool->max_message_size);
 	if (IS_ERR(page_list)) {
 		err = PTR_ERR(page_list);
-
-		printk(KERN_WARNING "RDS/IW: ib_alloc_fast_reg_page_list failed (err=%d)\n", err);
 		ib_dereg_mr(mr);
 		return err;
 	}
diff --git a/net/rds/iw_send.c b/net/rds/iw_send.c
index e40c3c5..debf586 100644
--- a/net/rds/iw_send.c
+++ b/net/rds/iw_send.c
@@ -154,17 +154,13 @@ void rds_iw_send_init_ring(struct rds_iw_connection *ic)
 		sge->lkey = 0;
 
 		send->s_mr = ib_alloc_fast_reg_mr(ic->i_pd, fastreg_message_size);
-		if (IS_ERR(send->s_mr)) {
-			printk(KERN_WARNING "RDS/IW: ib_alloc_fast_reg_mr failed\n");
+		if (IS_ERR(send->s_mr))
 			break;
-		}
 
 		send->s_page_list = ib_alloc_fast_reg_page_list(
 			ic->i_cm_id->device, fastreg_message_size);
-		if (IS_ERR(send->s_page_list)) {
-			printk(KERN_WARNING "RDS/IW: ib_alloc_fast_reg_page_list failed\n");
+		if (IS_ERR(send->s_page_list))
 			break;
-		}
 	}
 }
 
-- 
1.7.6.405.gc1be0

[PATCH 15/24] rfkill: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:21:04

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/rfkill/rfkill-regulator.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/net/rfkill/rfkill-regulator.c b/net/rfkill/rfkill-regulator.c
index 18dc512..3ca7277 100644
--- a/net/rfkill/rfkill-regulator.c
+++ b/net/rfkill/rfkill-regulator.c
@@ -90,7 +90,6 @@ static int __devinit rfkill_regulator_probe(struct platform_device *pdev)
 				pdata->type,
 				&rfkill_regulator_ops, rfkill_data);
 	if (rf_kill == NULL) {
-		dev_err(&pdev->dev, "Cannot alloc rfkill device\n");
 		ret = -ENOMEM;
 		goto err_rfkill_alloc;
 	}
-- 
1.7.6.405.gc1be0

[PATCH 16/24] rose: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:21:12

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/rose/af_rose.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index f9ea925..63ab96b 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -1537,7 +1537,6 @@ static int __init rose_proto_init(void)
 
 	dev_rose = kzalloc(rose_ndevs * sizeof(struct net_device *), GFP_KERNEL);
 	if (dev_rose == NULL) {
-		printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate device structure\n");
 		rc = -ENOMEM;
 		goto out_proto_unregister;
 	}
-- 
1.7.6.405.gc1be0

[PATCH 17/24] sched: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:21:23

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/sched/act_api.c |    6 ++----
 net/sched/sch_atm.c |    1 -
 2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index f2fb67e..fb98a30 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -749,10 +749,9 @@ static struct tc_action *create_a(int i)
 	struct tc_action *act;
 
 	act = kzalloc(sizeof(*act), GFP_KERNEL);
-	if (act == NULL) {
-		pr_debug("create_a: failed to alloc!\n");
+	if (act == NULL)
 		return NULL;
-	}
+
 	act->order = i;
 	return act;
 }
@@ -778,7 +777,6 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
 
 	skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
 	if (!skb) {
-		pr_debug("tca_action_flush: failed skb alloc\n");
 		kfree(a);
 		return err;
 	}
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c
index e25e490..cba66c4 100644
--- a/net/sched/sch_atm.c
+++ b/net/sched/sch_atm.c
@@ -270,7 +270,6 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent,
 	}
 	pr_debug("atm_tc_change: new id %x\n", classid);
 	flow = kzalloc(sizeof(struct atm_flow_data) + hdr_len, GFP_KERNEL);
-	pr_debug("atm_tc_change: flow %p\n", flow);
 	if (!flow) {
 		error = -ENOBUFS;
 		goto err_out;
-- 
1.7.6.405.gc1be0

Re: [PATCH 17/24] sched: Remove unnecessary OOM logging messages

From: jamal <hidden>
Date: 2011-08-30 22:27:52

On Mon, 2011-08-29 at 14:17 -0700, Joe Perches wrote:
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Jamal Hadi Salim <redacted>

cheers,
jamal

[PATCH 18/24] sctp: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:21:33

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/sctp/protocol.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 91784f4..0801444 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1326,7 +1326,6 @@ SCTP_STATIC __init int sctp_init(void)
 			__get_free_pages(GFP_ATOMIC|__GFP_NOWARN, order);
 	} while (!sctp_assoc_hashtable && --order > 0);
 	if (!sctp_assoc_hashtable) {
-		pr_err("Failed association hash alloc\n");
 		status = -ENOMEM;
 		goto err_ahash_alloc;
 	}
@@ -1340,7 +1339,6 @@ SCTP_STATIC __init int sctp_init(void)
 	sctp_ep_hashtable = (struct sctp_hashbucket *)
 		kmalloc(64 * sizeof(struct sctp_hashbucket), GFP_KERNEL);
 	if (!sctp_ep_hashtable) {
-		pr_err("Failed endpoint_hash alloc\n");
 		status = -ENOMEM;
 		goto err_ehash_alloc;
 	}
@@ -1359,7 +1357,6 @@ SCTP_STATIC __init int sctp_init(void)
 			__get_free_pages(GFP_ATOMIC|__GFP_NOWARN, order);
 	} while (!sctp_port_hashtable && --order > 0);
 	if (!sctp_port_hashtable) {
-		pr_err("Failed bind hash alloc\n");
 		status = -ENOMEM;
 		goto err_bhash_alloc;
 	}
-- 
1.7.6.405.gc1be0

Re: [PATCH 18/24] sctp: Remove unnecessary OOM logging messages

From: Vladislav Yasevich <hidden>
Date: 2011-08-29 21:39:35

On 08/29/2011 05:17 PM, Joe Perches wrote:
Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Vlad Yasevich <redacted>

-vlad
quoted hunk
---
 net/sctp/protocol.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 91784f4..0801444 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1326,7 +1326,6 @@ SCTP_STATIC __init int sctp_init(void)
 			__get_free_pages(GFP_ATOMIC|__GFP_NOWARN, order);
 	} while (!sctp_assoc_hashtable && --order > 0);
 	if (!sctp_assoc_hashtable) {
-		pr_err("Failed association hash alloc\n");
 		status = -ENOMEM;
 		goto err_ahash_alloc;
 	}
@@ -1340,7 +1339,6 @@ SCTP_STATIC __init int sctp_init(void)
 	sctp_ep_hashtable = (struct sctp_hashbucket *)
 		kmalloc(64 * sizeof(struct sctp_hashbucket), GFP_KERNEL);
 	if (!sctp_ep_hashtable) {
-		pr_err("Failed endpoint_hash alloc\n");
 		status = -ENOMEM;
 		goto err_ehash_alloc;
 	}
@@ -1359,7 +1357,6 @@ SCTP_STATIC __init int sctp_init(void)
 			__get_free_pages(GFP_ATOMIC|__GFP_NOWARN, order);
 	} while (!sctp_port_hashtable && --order > 0);
 	if (!sctp_port_hashtable) {
-		pr_err("Failed bind hash alloc\n");
 		status = -ENOMEM;
 		goto err_bhash_alloc;
 	}

Re: [PATCH 18/24] sctp: Remove unnecessary OOM logging messages

From: Eric Dumazet <hidden>
Date: 2011-08-29 21:43:35

Le lundi 29 août 2011 à 14:17 -0700, Joe Perches a écrit :
quoted hunk
Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/sctp/protocol.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 91784f4..0801444 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1326,7 +1326,6 @@ SCTP_STATIC __init int sctp_init(void)
 			__get_free_pages(GFP_ATOMIC|__GFP_NOWARN, order);
 	} while (!sctp_assoc_hashtable && --order > 0);
 	if (!sctp_assoc_hashtable) {
-		pr_err("Failed association hash alloc\n");
 		status = -ENOMEM;
 		goto err_ahash_alloc;
 	}
@@ -1340,7 +1339,6 @@ SCTP_STATIC __init int sctp_init(void)
 	sctp_ep_hashtable = (struct sctp_hashbucket *)
 		kmalloc(64 * sizeof(struct sctp_hashbucket), GFP_KERNEL);
 	if (!sctp_ep_hashtable) {
-		pr_err("Failed endpoint_hash alloc\n");
 		status = -ENOMEM;
 		goto err_ehash_alloc;
 	}
@@ -1359,7 +1357,6 @@ SCTP_STATIC __init int sctp_init(void)
 			__get_free_pages(GFP_ATOMIC|__GFP_NOWARN, order);
 	} while (!sctp_port_hashtable && --order > 0);
 	if (!sctp_port_hashtable) {
-		pr_err("Failed bind hash alloc\n");
 		status = -ENOMEM;
 		goto err_bhash_alloc;
 	}

It would be nice if you could avoid all these patches, that you dont
even read.

As I already told you in the past, __GFP_NOWARN dont print generic OOM
messages.

Its not because I told Wang Shaoyan not adding a useless "pr_err("Out of
memory\n");" in last gianfar patch, that you have to remove all
messages, with one hundred or more patches.

If I remember well, you even disagreed at that time.

Furthermore, a failed vmalloc() is not guaranteed to emit an OOM
message, is it ?

Re: [PATCH 18/24] sctp: Remove unnecessary OOM logging messages

From: Eric Dumazet <hidden>
Date: 2011-08-29 21:51:30

Le lundi 29 août 2011 à 23:43 +0200, Eric Dumazet a écrit :
Furthermore, a failed vmalloc() is not guaranteed to emit an OOM
message, is it ?
It currently displays a message without context :

vmap allocation for size XXXXXX failed: use vmalloc=<size> to increase
size.

So we dont know which part of the kernel asked this allocation.

Please dont remove existing error messages after failed vmalloc() calls.

Re: [PATCH 18/24] sctp: Remove unnecessary OOM logging messages

From: David Miller <davem@davemloft.net>
Date: 2011-08-29 22:15:40

From: Eric Dumazet <redacted>
Date: Mon, 29 Aug 2011 23:51:21 +0200
Le lundi 29 août 2011 à 23:43 +0200, Eric Dumazet a écrit :
quoted
Furthermore, a failed vmalloc() is not guaranteed to emit an OOM
message, is it ?
It currently displays a message without context :

vmap allocation for size XXXXXX failed: use vmalloc=<size> to increase
size.

So we dont know which part of the kernel asked this allocation.

Please dont remove existing error messages after failed vmalloc() calls.
Indeed.

Joe, these vmalloc() and also the __GFP_NOWARN cases will need to be
attended to and this series resubmitted as such.

Thanks.

Re: [PATCH 18/24] sctp: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-09-01 00:25:14

On Mon, 2011-08-29 at 18:15 -0400, David Miller wrote:
From: Eric Dumazet <redacted>
Date: Mon, 29 Aug 2011 23:51:21 +0200
quoted
Le lundi 29 août 2011 à 23:43 +0200, Eric Dumazet a écrit :
quoted
Furthermore, a failed vmalloc() is not guaranteed to emit an OOM
message, is it ?
It currently displays a message without context :
vmap allocation for size XXXXXX failed: use vmalloc=<size> to increase
size.
So we dont know which part of the kernel asked this allocation.
Please dont remove existing error messages after failed vmalloc() calls.
Indeed.
Joe, these vmalloc() and also the __GFP_NOWARN cases will need to be
attended to and this series resubmitted as such.
No worries.

Andrew Morton picked up a patch I posted that
changes vmalloc to be similar to kmalloc when
the pointer returned is NULL (OOM).  It now
uses dump_stack for those cases.

https://patchwork.kernel.org/patch/1114682/

I'll keep all the current vmalloc failure messages
for now and resubmit in a day or two this series
with acks.  Not batman or netfilter though as they
were picked up by their maintainers.

A month or two after the vmalloc patch hits
mainline and/or wider testing, and it's deemed
acceptable, removing vmalloc site specific OOM
messages should be appropriate.

Anyone object?

I plan on submitting drivers/net OOM removals
next week.

Re: [PATCH 18/24] sctp: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-30 01:21:25

On Mon, 2011-08-29 at 23:43 +0200, Eric Dumazet wrote:
Le lundi 29 août 2011 à 14:17 -0700, Joe Perches a écrit :
quoted
Removing unnecessary messages saves code and text.
Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.
Signed-off-by: Joe Perches <joe@perches.com>
---
 net/sctp/protocol.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
[]
quoted
@@ -1326,7 +1326,6 @@ SCTP_STATIC __init int sctp_init(void)
 			__get_free_pages(GFP_ATOMIC|__GFP_NOWARN, order);
 	} while (!sctp_assoc_hashtable && --order > 0);
 	if (!sctp_assoc_hashtable) {
-		pr_err("Failed association hash alloc\n");
 		status = -ENOMEM;
 		goto err_ahash_alloc;
 	}
[]
quoted
@@ -1359,7 +1357,6 @@ SCTP_STATIC __init int sctp_init(void)
 			__get_free_pages(GFP_ATOMIC|__GFP_NOWARN, order);
 	} while (!sctp_port_hashtable && --order > 0);
 	if (!sctp_port_hashtable) {
-		pr_err("Failed bind hash alloc\n");
 		status = -ENOMEM;
 		goto err_bhash_alloc;
 	}
It would be nice if you could avoid all these patches, that you dont
even read.
Didn't read is not the same thing as didn't notice.
As I already told you in the past, __GFP_NOWARN dont print generic OOM
messages.
I didn't notice those had GFP_NOWARN.
Its not because I told Wang Shaoyan not adding a useless "pr_err("Out of
memory\n");" in last gianfar patch, that you have to remove all
messages, with one hundred or more patches.
If I remember well, you even disagreed at that time.
No, what I said was that it'd be better to get agreement
to delete them before deleting them.

https://lkml.org/lkml/2011/8/9/379

So I submitted an RFC and cc'd you.
You did not reply.

https://lkml.org/lkml/2011/8/25/580
Furthermore, a failed vmalloc() is not guaranteed to emit an OOM
message, is it ?
Doesn't seem to be, perhaps it should be
when __GFP_NOWARN is not set...

[PATCH 19/24] sunrpc: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:21:47

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/sunrpc/auth_gss/gss_krb5_crypto.c |   10 ++--------
 net/sunrpc/auth_gss/gss_krb5_mech.c   |    2 --
 net/sunrpc/backchannel_rqst.c         |    9 +++------
 net/sunrpc/clnt.c                     |    3 ---
 net/sunrpc/rpc_pipe.c                 |    3 +--
 net/sunrpc/rpcb_clnt.c                |    2 --
 net/sunrpc/xprtrdma/svc_rdma.c        |    8 ++------
 net/sunrpc/xprtrdma/transport.c       |    5 +----
 net/sunrpc/xprtrdma/verbs.c           |   14 --------------
 net/sunrpc/xprtsock.c                 |    5 +----
 10 files changed, 10 insertions(+), 51 deletions(-)
diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c
index 9576f35..911987e 100644
--- a/net/sunrpc/auth_gss/gss_krb5_crypto.c
+++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c
@@ -865,11 +865,8 @@ krb5_rc4_setup_seq_key(struct krb5_ctx *kctx, struct crypto_blkcipher *cipher,
 	dprintk("%s: entered\n", __func__);
 
 	hmac = crypto_alloc_hash(kctx->gk5e->cksum_name, 0, CRYPTO_ALG_ASYNC);
-	if (IS_ERR(hmac)) {
-		dprintk("%s: error %ld, allocating hash '%s'\n",
-			__func__, PTR_ERR(hmac), kctx->gk5e->cksum_name);
+	if (IS_ERR(hmac))
 		return PTR_ERR(hmac);
-	}
 
 	desc.tfm = hmac;
 	desc.flags = 0;
@@ -932,11 +929,8 @@ krb5_rc4_setup_enc_key(struct krb5_ctx *kctx, struct crypto_blkcipher *cipher,
 	dprintk("%s: entered, seqnum %u\n", __func__, seqnum);
 
 	hmac = crypto_alloc_hash(kctx->gk5e->cksum_name, 0, CRYPTO_ALG_ASYNC);
-	if (IS_ERR(hmac)) {
-		dprintk("%s: error %ld, allocating hash '%s'\n",
-			__func__, PTR_ERR(hmac), kctx->gk5e->cksum_name);
+	if (IS_ERR(hmac))
 		return PTR_ERR(hmac);
-	}
 
 	desc.tfm = hmac;
 	desc.flags = 0;
diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c
index 8c67890..61de04c 100644
--- a/net/sunrpc/auth_gss/gss_krb5_mech.c
+++ b/net/sunrpc/auth_gss/gss_krb5_mech.c
@@ -440,8 +440,6 @@ context_derive_keys_rc4(struct krb5_ctx *ctx)
 	 */
 	hmac = crypto_alloc_hash(ctx->gk5e->cksum_name, 0, CRYPTO_ALG_ASYNC);
 	if (IS_ERR(hmac)) {
-		dprintk("%s: error %ld allocating hash '%s'\n",
-			__func__, PTR_ERR(hmac), ctx->gk5e->cksum_name);
 		err = PTR_ERR(hmac);
 		goto out_err;
 	}
diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c
index 91eaa26..1074d8e 100644
--- a/net/sunrpc/backchannel_rqst.c
+++ b/net/sunrpc/backchannel_rqst.c
@@ -106,10 +106,8 @@ int xprt_setup_backchannel(struct rpc_xprt *xprt, unsigned int min_reqs)
 	for (i = 0; i < min_reqs; i++) {
 		/* Pre-allocate one backchannel rpc_rqst */
 		req = kzalloc(sizeof(struct rpc_rqst), GFP_KERNEL);
-		if (req == NULL) {
-			printk(KERN_ERR "Failed to create bc rpc_rqst\n");
+		if (req == NULL)
 			goto out_free;
-		}
 
 		/* Add the allocated buffer to the tmp list */
 		dprintk("RPC:       adding req= %p\n", req);
@@ -121,10 +119,9 @@ int xprt_setup_backchannel(struct rpc_xprt *xprt, unsigned int min_reqs)
 
 		/* Preallocate one XDR receive buffer */
 		page_rcv = alloc_page(GFP_KERNEL);
-		if (page_rcv == NULL) {
-			printk(KERN_ERR "Failed to create bc receive xbuf\n");
+		if (page_rcv == NULL)
 			goto out_free;
-		}
+
 		xbufp = &req->rq_rcv_buf;
 		xbufp->head[0].iov_base = page_address(page_rcv);
 		xbufp->head[0].iov_len = PAGE_SIZE;
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index c5347d2..e10709a 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1058,8 +1058,6 @@ call_allocate(struct rpc_task *task)
 	if (req->rq_buffer != NULL)
 		return;
 
-	dprintk("RPC: %5u rpc_buffer allocation failed\n", task->tk_pid);
-
 	if (RPC_IS_ASYNC(task) || !fatal_signal_pending(current)) {
 		task->tk_action = call_allocate;
 		rpc_delay(task, HZ>>4);
@@ -1163,7 +1161,6 @@ call_bind_status(struct rpc_task *task)
 
 	switch (task->tk_status) {
 	case -ENOMEM:
-		dprintk("RPC: %5u rpcbind out of memory\n", task->tk_pid);
 		rpc_delay(task, HZ >> 2);
 		goto retry_timeout;
 	case -EACCES:
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index b181e34..0395311 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -485,9 +485,8 @@ static int __rpc_create_common(struct inode *dir, struct dentry *dentry,
 		rpc_inode_setowner(inode, private);
 	d_add(dentry, inode);
 	return 0;
+
 out_err:
-	printk(KERN_WARNING "%s: %s failed to allocate inode for dentry %s\n",
-			__FILE__, __func__, dentry->d_name.name);
 	dput(dentry);
 	return -ENOMEM;
 }
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
index e45d2fb..4d8be9a 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -671,8 +671,6 @@ void rpcb_getport_async(struct rpc_task *task)
 	map = kzalloc(sizeof(struct rpcbind_args), GFP_ATOMIC);
 	if (!map) {
 		status = -ENOMEM;
-		dprintk("RPC: %5u %s: no memory available\n",
-			task->tk_pid, __func__);
 		goto bailout_release_client;
 	}
 	map->r_prog = clnt->cl_prog;
diff --git a/net/sunrpc/xprtrdma/svc_rdma.c b/net/sunrpc/xprtrdma/svc_rdma.c
index 09af4fa..18fe984 100644
--- a/net/sunrpc/xprtrdma/svc_rdma.c
+++ b/net/sunrpc/xprtrdma/svc_rdma.c
@@ -267,10 +267,8 @@ int svc_rdma_init(void)
 						0,
 						SLAB_HWCACHE_ALIGN,
 						NULL);
-	if (!svc_rdma_map_cachep) {
-		printk(KERN_INFO "Could not allocate map cache.\n");
+	if (!svc_rdma_map_cachep)
 		goto err0;
-	}
 
 	/* Create the temporary context cache */
 	svc_rdma_ctxt_cachep =
@@ -279,10 +277,8 @@ int svc_rdma_init(void)
 				  0,
 				  SLAB_HWCACHE_ALIGN,
 				  NULL);
-	if (!svc_rdma_ctxt_cachep) {
-		printk(KERN_INFO "Could not allocate WR ctxt cache.\n");
+	if (!svc_rdma_ctxt_cachep)
 		goto err1;
-	}
 
 	/* Register RDMA with the SVC transport switch */
 	svc_reg_xprt_class(&svc_rdma_class);
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index b446e10..772a481 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -285,11 +285,8 @@ xprt_setup_rdma(struct xprt_create *args)
 	xprt = xprt_alloc(args->net, sizeof(struct rpcrdma_xprt),
 			xprt_rdma_slot_table_entries,
 			xprt_rdma_slot_table_entries);
-	if (xprt == NULL) {
-		dprintk("RPC:       %s: couldn't allocate rpcrdma_xprt\n",
-			__func__);
+	if (xprt == NULL)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	/* 60 second timeout, no retries */
 	xprt->timeout = &xprt_rdma_default_timeout;
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index 28236ba..937b51d 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -471,8 +471,6 @@ rpcrdma_ia_open(struct rpcrdma_xprt *xprt, struct sockaddr *addr, int memreg)
 	ia->ri_pd = ib_alloc_pd(ia->ri_id->device);
 	if (IS_ERR(ia->ri_pd)) {
 		rc = PTR_ERR(ia->ri_pd);
-		dprintk("RPC:       %s: ib_alloc_pd() failed %i\n",
-			__func__, rc);
 		goto out2;
 	}
 
@@ -1009,8 +1007,6 @@ rpcrdma_buffer_create(struct rpcrdma_buffer *buf, struct rpcrdma_ep *ep,
 	/* allocate 1, 4 and 5 in one shot */
 	p = kzalloc(len, GFP_KERNEL);
 	if (p == NULL) {
-		dprintk("RPC:       %s: req_t/rep_t/pad kzalloc(%zd) failed\n",
-			__func__, len);
 		rc = -ENOMEM;
 		goto out;
 	}
@@ -1046,8 +1042,6 @@ rpcrdma_buffer_create(struct rpcrdma_buffer *buf, struct rpcrdma_ep *ep,
 							 RPCRDMA_MAX_SEGS);
 			if (IS_ERR(r->r.frmr.fr_mr)) {
 				rc = PTR_ERR(r->r.frmr.fr_mr);
-				dprintk("RPC:       %s: ib_alloc_fast_reg_mr"
-					" failed %i\n", __func__, rc);
 				goto out;
 			}
 			r->r.frmr.fr_pgl =
@@ -1074,8 +1068,6 @@ rpcrdma_buffer_create(struct rpcrdma_buffer *buf, struct rpcrdma_ep *ep,
 				&fa);
 			if (IS_ERR(r->r.fmr)) {
 				rc = PTR_ERR(r->r.fmr);
-				dprintk("RPC:       %s: ib_alloc_fmr"
-					" failed %i\n", __func__, rc);
 				goto out;
 			}
 			list_add(&r->mw_list, &buf->rb_mws);
@@ -1089,8 +1081,6 @@ rpcrdma_buffer_create(struct rpcrdma_buffer *buf, struct rpcrdma_ep *ep,
 			r->r.mw = ib_alloc_mw(ia->ri_pd);
 			if (IS_ERR(r->r.mw)) {
 				rc = PTR_ERR(r->r.mw);
-				dprintk("RPC:       %s: ib_alloc_mw"
-					" failed %i\n", __func__, rc);
 				goto out;
 			}
 			list_add(&r->mw_list, &buf->rb_mws);
@@ -1116,8 +1106,6 @@ rpcrdma_buffer_create(struct rpcrdma_buffer *buf, struct rpcrdma_ep *ep,
 			len = 4096;
 		req = kmalloc(len, GFP_KERNEL);
 		if (req == NULL) {
-			dprintk("RPC:       %s: request buffer %d alloc"
-				" failed\n", __func__, i);
 			rc = -ENOMEM;
 			goto out;
 		}
@@ -1137,8 +1125,6 @@ rpcrdma_buffer_create(struct rpcrdma_buffer *buf, struct rpcrdma_ep *ep,
 		len = cdata->inline_rsize + sizeof(struct rpcrdma_rep);
 		rep = kmalloc(len, GFP_KERNEL);
 		if (rep == NULL) {
-			dprintk("RPC:       %s: reply buffer %d alloc failed\n",
-				__func__, i);
 			rc = -ENOMEM;
 			goto out;
 		}
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index d7f97ef..911494a 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2515,11 +2515,8 @@ static struct rpc_xprt *xs_setup_xprt(struct xprt_create *args,
 
 	xprt = xprt_alloc(args->net, sizeof(*new), slot_table_size,
 			max_slot_table_size);
-	if (xprt == NULL) {
-		dprintk("RPC:       xs_setup_xprt: couldn't allocate "
-				"rpc_xprt\n");
+	if (xprt == NULL)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	new = container_of(xprt, struct sock_xprt, xprt);
 	memcpy(&xprt->addr, args->dstaddr, args->addrlen);
-- 
1.7.6.405.gc1be0

RE: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging messages

From: Myklebust, Trond <hidden>
Date: 2011-08-29 21:36:18

-----Original Message-----
From: Joe Perches [mailto:joe@perches.com]
Sent: Monday, August 29, 2011 5:18 PM
To: Myklebust, Trond; J. Bruce Fields; Neil Brown
Cc: David S. Miller; linux-nfs@vger.kernel.org;
netdev@vger.kernel.org;
linux-kernel@vger.kernel.org
Subject: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging messages

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/sunrpc/auth_gss/gss_krb5_crypto.c |   10 ++--------
 net/sunrpc/auth_gss/gss_krb5_mech.c   |    2 --
 net/sunrpc/backchannel_rqst.c         |    9 +++------
 net/sunrpc/clnt.c                     |    3 ---
 net/sunrpc/rpc_pipe.c                 |    3 +--
 net/sunrpc/rpcb_clnt.c                |    2 --
 net/sunrpc/xprtrdma/svc_rdma.c        |    8 ++------
 net/sunrpc/xprtrdma/transport.c       |    5 +----
 net/sunrpc/xprtrdma/verbs.c           |   14 --------------
 net/sunrpc/xprtsock.c                 |    5 +----
 10 files changed, 10 insertions(+), 51 deletions(-)
Big NACK...

By whose standard are those "not useful"?

Trond

Re: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging messages

From: David Miller <davem@davemloft.net>
Date: 2011-08-29 21:40:05

From: "Myklebust, Trond" <redacted>
Date: Mon, 29 Aug 2011 14:36:17 -0700
Big NACK...

By whose standard are those "not useful"?
By mine, that's for sure.  It's duplicating something that the allocation
layers are already going to print.

Re: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging messages

From: Boaz Harrosh <hidden>
Date: 2011-08-29 22:02:20

On 08/29/2011 02:37 PM, David Miller wrote:
From: "Myklebust, Trond" <redacted>
Date: Mon, 29 Aug 2011 14:36:17 -0700
quoted
Big NACK...

By whose standard are those "not useful"?
By mine, that's for sure.  It's duplicating something that the allocation
layers are already going to print.
I have a question about that. Are the dprints going to show the stack backtrace?
Otherwise how can I see which exact allocation failed and was not properly handled?

If yes above? then I'm not sure I like it either, because am I'll be getting a full
stack backtrace for every failed allocation?

But I might like it if I try. How do I turn on allocation failures prints?
Can I filter out to print only GFP_KERNEL failures and or other GFP combinations?

Thanks 
Boaz
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging messages

From: David Miller <davem@davemloft.net>
Date: 2011-08-29 22:06:07

From: Boaz Harrosh <redacted>
Date: Mon, 29 Aug 2011 14:54:59 -0700
I have a question about that. Are the dprints going to show the stack backtrace?
Yes, OOMs give full stack backtraces.
If yes above? then I'm not sure I like it either, because am I'll be getting a full
stack backtrace for every failed allocation?
They've been doing this for years, so obviously they haven't bothered you
enough to care up to this point.

All of this pushback is pure uneducated noise, please stop blocking progress
with poorly informed objections.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

RE: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging messages

From: Myklebust, Trond <hidden>
Date: 2011-08-29 23:25:11

-----Original Message-----
From: David Miller [mailto:davem@davemloft.net]
Sent: Monday, August 29, 2011 6:04 PM
To: bharrosh@panasas.com
Cc: Myklebust, Trond; joe@perches.com; bfields@fieldses.org;
neilb@suse.de; linux-nfs@vger.kernel.org; netdev@vger.kernel.org;
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging
messages

From: Boaz Harrosh <redacted>
Date: Mon, 29 Aug 2011 14:54:59 -0700
quoted
I have a question about that. Are the dprints going to show the
stack
backtrace?

Yes, OOMs give full stack backtraces.
quoted
If yes above? then I'm not sure I like it either, because am I'll be
getting a full
quoted
stack backtrace for every failed allocation?
They've been doing this for years, so obviously they haven't bothered
you
enough to care up to this point.

All of this pushback is pure uneducated noise, please stop blocking
progress
with poorly informed objections.
I can see that slub.c has the slab_out_of_memory() function that
(although ratelimited) warns you if the allocation failed. However I
can't find any equivalent for slab.c or slob.c.

Trond

Re: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging messages

From: Boaz Harrosh <hidden>
Date: 2011-08-29 23:35:03

On 08/29/2011 04:25 PM, Myklebust, Trond wrote:
quoted
-----Original Message-----
From: David Miller [mailto:davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org]
<>
quoted
They've been doing this for years, so obviously they haven't bothered
you enough to care up to this point.

All of this pushback is pure uneducated noise, please stop blocking
progress with poorly informed objections.
I can see that slub.c has the slab_out_of_memory() function that
(although ratelimited) warns you if the allocation failed. However I
can't find any equivalent for slab.c or slob.c.
OK That would explain why I never saw it in my debugging. For some reason
I'm always using slab. 

Which one is the best for development and memory problems debugging?
Trond
Thanks
Boaz
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging messages

From: David Miller <davem@davemloft.net>
Date: 2011-08-30 02:36:08

From: "Myklebust, Trond" <redacted>
Date: Mon, 29 Aug 2011 16:25:08 -0700
I can see that slub.c has the slab_out_of_memory() function that
(although ratelimited) warns you if the allocation failed. However I
can't find any equivalent for slab.c or slob.c.
See the page allocator.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

RE: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging messages

From: Myklebust, Trond <hidden>
Date: 2011-08-29 22:08:41

PiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBCb2F6IEhhcnJvc2ggW21haWx0bzpiaGFycm9zaEBwYW5hc2FzLmNvbV0NCj4gU2VudDogTW9uZGF5LCBBdWd1c3QgMjksIDIwMTEgNTo1NSBQTQ0KPiBUbzogRGF2aWQgTWlsbGVyDQo+IENjOiBNeWtsZWJ1c3QsIFRyb25kOyBqb2VAcGVyY2hlcy5jb207IGJmaWVsZHNAZmllbGRzZXMub3JnOw0KPiBuZWlsYkBzdXNlLmRlOyBsaW51eC1uZnNAdmdlci5rZXJuZWwub3JnOyBuZXRkZXZAdmdlci5rZXJuZWwub3JnOw0KPiBsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnDQo+IFN1YmplY3Q6IFJlOiBbUEFUQ0ggMTkvMjRdIHN1bnJwYzogUmVtb3ZlIHVubmVjZXNzYXJ5IE9PTSBsb2dnaW5nDQo+IG1lc3NhZ2VzDQo+IA0KPiBPbiAwOC8yOS8yMDExIDAyOjM3IFBNLCBEYXZpZCBNaWxsZXIgd3JvdGU6DQo+ID4gRnJvbTogIk15a2xlYnVzdCwgVHJvbmQiIDxUcm9uZC5NeWtsZWJ1c3RAbmV0YXBwLmNvbT4NCj4gPiBEYXRlOiBNb24sIDI5IEF1ZyAyMDExIDE0OjM2OjE3IC0wNzAwDQo+ID4NCj4gPj4gQmlnIE5BQ0suLi4NCj4gPj4NCj4gPj4gQnkgd2hvc2Ugc3RhbmRhcmQgYXJlIHRob3NlICJub3QgdXNlZnVsIj8NCj4gPg0KPiA+IEJ5IG1pbmUsIHRoYXQncyBmb3Igc3VyZS4gIEl0J3MgZHVwbGljYXRpbmcgc29tZXRoaW5nIHRoYXQgdGhlDQo+IGFsbG9jYXRpb24NCj4gPiBsYXllcnMgYXJlIGFscmVhZHkgZ29pbmcgdG8gcHJpbnQuDQo+IA0KPiBJIGhhdmUgYSBxdWVzdGlvbiBhYm91dCB0aGF0LiBBcmUgdGhlIGRwcmludHMgZ29pbmcgdG8gc2hvdyB0aGUgc3RhY2sNCj4gYmFja3RyYWNlPw0KPiBPdGhlcndpc2UgaG93IGNhbiBJIHNlZSB3aGljaCBleGFjdCBhbGxvY2F0aW9uIGZhaWxlZCBhbmQgd2FzIG5vdA0KPiBwcm9wZXJseSBoYW5kbGVkPw0KPiANCj4gSWYgeWVzIGFib3ZlPyB0aGVuIEknbSBub3Qgc3VyZSBJIGxpa2UgaXQgZWl0aGVyLCBiZWNhdXNlIGFtIEknbGwgYmUNCj4gZ2V0dGluZyBhIGZ1bGwNCj4gc3RhY2sgYmFja3RyYWNlIGZvciBldmVyeSBmYWlsZWQgYWxsb2NhdGlvbj8NCj4gDQo+IEJ1dCBJIG1pZ2h0IGxpa2UgaXQgaWYgSSB0cnkuIEhvdyBkbyBJIHR1cm4gb24gYWxsb2NhdGlvbiBmYWlsdXJlcw0KPiBwcmludHM/DQo+IENhbiBJIGZpbHRlciBvdXQgdG8gcHJpbnQgb25seSBHRlBfS0VSTkVMIGZhaWx1cmVzIGFuZCBvciBvdGhlciBHRlANCj4gY29tYmluYXRpb25zPw0KDQpSaWdodC4gSWYgZXZlcnkgR0ZQX0FUT01JQyBvciBHRlBfTk9XQUlUIGlzIGdvaW5nIHRvIHByaW50IG91dCBzdGFjayB0cmFjZXMsIHRoZW4gd2UncmUgaGVhZGluZyBmb3IgYWJzb2x1dGUgaW5zYW5pdHkuIElmIG5vdCwgdGhlbiB0aGUgZXhpc3RpbmcgZHByaW50aygpcyBtYWtlIGEgbG90IG1vcmUgc2Vuc2UsICdjb3MgdGhleSBhcmUgdHVybmVkIG9uIG9ubHkgd2hlbiB0aGUgYWRtaW5pc3RyYXRvciBub3RpY2VzIGEgcHJvYmxlbSwgYW5kIGlzIHRyeWluZyB0byBkZWJ1ZyBpdC4NCg0KVHJvbmQNCg0K--To unsubscribe from this list: send the line "unsubscribe linux-nfs" inthe body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.orgMore majordomo info at  http://vger.kernel.org/majordomo-info.html

[PATCH 20/24] tipc: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:21:56

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/tipc/link.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/net/tipc/link.c b/net/tipc/link.c
index f89570c..5c96289 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -325,10 +325,8 @@ struct link *tipc_link_create(struct tipc_node *n_ptr,
 	}
 
 	l_ptr = kzalloc(sizeof(*l_ptr), GFP_ATOMIC);
-	if (!l_ptr) {
-		warn("Link creation failed, no memory\n");
+	if (!l_ptr)
 		return NULL;
-	}
 
 	l_ptr->addr = peer;
 	if_name = strchr(b_ptr->name, ':') + 1;
-- 
1.7.6.405.gc1be0

[PATCH 21/24] wanrouter: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:22:06

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/wanrouter/wanmain.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index 788a12c..01d0be4 100644
--- a/net/wanrouter/wanmain.c
+++ b/net/wanrouter/wanmain.c
@@ -437,11 +437,8 @@ static int wanrouter_device_setup(struct wan_device *wandev,
 	}
 
 	conf = kmalloc(sizeof(wandev_conf_t), GFP_KERNEL);
-	if (conf == NULL){
-		printk(KERN_INFO "%s: ERROR, Failed to allocate kernel memory !\n",
-				wandev->name);
+	if (conf == NULL)
 		return -ENOBUFS;
-	}
 
 	if (copy_from_user(conf, u_conf, sizeof(wandev_conf_t))) {
 		printk(KERN_INFO "%s: Failed to copy user config data to kernel space!\n",
@@ -468,9 +465,6 @@ static int wanrouter_device_setup(struct wan_device *wandev,
 
 		data = vmalloc(conf->data_size);
 		if (!data) {
-			printk(KERN_INFO
-				"%s: ERROR, Failed allocate kernel memory !\n",
-				wandev->name);
 			kfree(conf);
 			return -ENOBUFS;
 		}
-- 
1.7.6.405.gc1be0

[PATCH 22/24] wireless: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:22:16

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/wireless/lib80211_crypt_ccmp.c |    2 --
 net/wireless/lib80211_crypt_tkip.c |    4 ----
 net/wireless/lib80211_crypt_wep.c  |    4 ----
 net/wireless/util.c                |    5 ++---
 4 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/net/wireless/lib80211_crypt_ccmp.c b/net/wireless/lib80211_crypt_ccmp.c
index dacb3b4..755738d 100644
--- a/net/wireless/lib80211_crypt_ccmp.c
+++ b/net/wireless/lib80211_crypt_ccmp.c
@@ -77,8 +77,6 @@ static void *lib80211_ccmp_init(int key_idx)
 
 	priv->tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
 	if (IS_ERR(priv->tfm)) {
-		printk(KERN_DEBUG "lib80211_crypt_ccmp: could not allocate "
-		       "crypto API aes\n");
 		priv->tfm = NULL;
 		goto fail;
 	}
diff --git a/net/wireless/lib80211_crypt_tkip.c b/net/wireless/lib80211_crypt_tkip.c
index 7ea4f2b..3873484 100644
--- a/net/wireless/lib80211_crypt_tkip.c
+++ b/net/wireless/lib80211_crypt_tkip.c
@@ -101,7 +101,6 @@ static void *lib80211_tkip_init(int key_idx)
 	priv->tx_tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0,
 						CRYPTO_ALG_ASYNC);
 	if (IS_ERR(priv->tx_tfm_arc4)) {
-		printk(KERN_DEBUG pr_fmt("could not allocate crypto API arc4\n"));
 		priv->tx_tfm_arc4 = NULL;
 		goto fail;
 	}
@@ -109,7 +108,6 @@ static void *lib80211_tkip_init(int key_idx)
 	priv->tx_tfm_michael = crypto_alloc_hash("michael_mic", 0,
 						 CRYPTO_ALG_ASYNC);
 	if (IS_ERR(priv->tx_tfm_michael)) {
-		printk(KERN_DEBUG pr_fmt("could not allocate crypto API michael_mic\n"));
 		priv->tx_tfm_michael = NULL;
 		goto fail;
 	}
@@ -117,7 +115,6 @@ static void *lib80211_tkip_init(int key_idx)
 	priv->rx_tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0,
 						CRYPTO_ALG_ASYNC);
 	if (IS_ERR(priv->rx_tfm_arc4)) {
-		printk(KERN_DEBUG pr_fmt("could not allocate crypto API arc4\n"));
 		priv->rx_tfm_arc4 = NULL;
 		goto fail;
 	}
@@ -125,7 +122,6 @@ static void *lib80211_tkip_init(int key_idx)
 	priv->rx_tfm_michael = crypto_alloc_hash("michael_mic", 0,
 						 CRYPTO_ALG_ASYNC);
 	if (IS_ERR(priv->rx_tfm_michael)) {
-		printk(KERN_DEBUG pr_fmt("could not allocate crypto API michael_mic\n"));
 		priv->rx_tfm_michael = NULL;
 		goto fail;
 	}
diff --git a/net/wireless/lib80211_crypt_wep.c b/net/wireless/lib80211_crypt_wep.c
index 2f265e0..c130401 100644
--- a/net/wireless/lib80211_crypt_wep.c
+++ b/net/wireless/lib80211_crypt_wep.c
@@ -50,16 +50,12 @@ static void *lib80211_wep_init(int keyidx)
 
 	priv->tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
 	if (IS_ERR(priv->tx_tfm)) {
-		printk(KERN_DEBUG "lib80211_crypt_wep: could not allocate "
-		       "crypto API arc4\n");
 		priv->tx_tfm = NULL;
 		goto fail;
 	}
 
 	priv->rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
 	if (IS_ERR(priv->rx_tfm)) {
-		printk(KERN_DEBUG "lib80211_crypt_wep: could not allocate "
-		       "crypto API arc4\n");
 		priv->rx_tfm = NULL;
 		goto fail;
 	}
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 844ddb0..4252765 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -513,10 +513,9 @@ int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr,
 		if (head_need)
 			skb_orphan(skb);
 
-		if (pskb_expand_head(skb, head_need, 0, GFP_ATOMIC)) {
-			pr_err("failed to reallocate Tx buffer\n");
+		if (pskb_expand_head(skb, head_need, 0, GFP_ATOMIC))
 			return -ENOMEM;
-		}
+
 		skb->truesize += head_need;
 	}
 
-- 
1.7.6.405.gc1be0

[PATCH 23/24] x25: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:22:25

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/x25/x25_dev.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/net/x25/x25_dev.c b/net/x25/x25_dev.c
index e547ca1..b77852f 100644
--- a/net/x25/x25_dev.c
+++ b/net/x25/x25_dev.c
@@ -147,10 +147,10 @@ void x25_establish_link(struct x25_neigh *nb)
 
 	switch (nb->dev->type) {
 	case ARPHRD_X25:
-		if ((skb = alloc_skb(1, GFP_ATOMIC)) == NULL) {
-			printk(KERN_ERR "x25_dev: out of memory\n");
+		skb = alloc_skb(1, GFP_ATOMIC);
+		if (skb == NULL)
 			return;
-		}
+
 		ptr  = skb_put(skb, 1);
 		*ptr = X25_IFACE_CONNECT;
 		break;
@@ -182,10 +182,8 @@ void x25_terminate_link(struct x25_neigh *nb)
 		return;
 
 	skb = alloc_skb(1, GFP_ATOMIC);
-	if (!skb) {
-		printk(KERN_ERR "x25_dev: out of memory\n");
+	if (!skb)
 		return;
-	}
 
 	ptr  = skb_put(skb, 1);
 	*ptr = X25_IFACE_DISCONNECT;
-- 
1.7.6.405.gc1be0

[PATCH 24/24] net: Remove unnecessary OOM logging messages

From: Joe Perches <joe@perches.com>
Date: 2011-08-29 21:22:35

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/core/dev.c    |   25 +++++++------------------
 net/core/flow.c   |    4 +---
 net/core/pktgen.c |    5 +----
 net/socket.c      |    5 +----
 4 files changed, 10 insertions(+), 29 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index b2e262e..67018d8 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5424,10 +5424,9 @@ static int netif_alloc_rx_queues(struct net_device *dev)
 	BUG_ON(count < 1);
 
 	rx = kcalloc(count, sizeof(struct netdev_rx_queue), GFP_KERNEL);
-	if (!rx) {
-		pr_err("netdev: Unable to allocate %u rx queues.\n", count);
+	if (!rx)
 		return -ENOMEM;
-	}
+
 	dev->_rx = rx;
 
 	for (i = 0; i < count; i++)
@@ -5455,11 +5454,9 @@ static int netif_alloc_netdev_queues(struct net_device *dev)
 	BUG_ON(count < 1);
 
 	tx = kcalloc(count, sizeof(struct netdev_queue), GFP_KERNEL);
-	if (!tx) {
-		pr_err("netdev: Unable to allocate %u tx queues.\n",
-		       count);
+	if (!tx)
 		return -ENOMEM;
-	}
+
 	dev->_tx = tx;
 
 	netdev_for_each_tx_queue(dev, netdev_init_one_queue, NULL);
@@ -5878,18 +5875,12 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
 
 	BUG_ON(strlen(name) >= sizeof(dev->name));
 
-	if (txqs < 1) {
-		pr_err("alloc_netdev: Unable to allocate device "
-		       "with zero queues.\n");
+	if (txqs < 1)
 		return NULL;
-	}
 
 #ifdef CONFIG_RPS
-	if (rxqs < 1) {
-		pr_err("alloc_netdev: Unable to allocate device "
-		       "with zero RX queues.\n");
+	if (rxqs < 1)
 		return NULL;
-	}
 #endif
 
 	alloc_size = sizeof(struct net_device);
@@ -5902,10 +5893,8 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
 	alloc_size += NETDEV_ALIGN - 1;
 
 	p = kzalloc(alloc_size, GFP_KERNEL);
-	if (!p) {
-		printk(KERN_ERR "alloc_netdev: Unable to allocate device.\n");
+	if (!p)
 		return NULL;
-	}
 
 	dev = PTR_ALIGN(p, NETDEV_ALIGN);
 	dev->padded = (char *)dev - (char *)p;
diff --git a/net/core/flow.c b/net/core/flow.c
index bf32c33..7e33612 100644
--- a/net/core/flow.c
+++ b/net/core/flow.c
@@ -359,10 +359,8 @@ static int __cpuinit flow_cache_cpu_prepare(struct flow_cache *fc, int cpu)
 
 	if (!fcp->hash_table) {
 		fcp->hash_table = kzalloc_node(sz, GFP_KERNEL, cpu_to_node(cpu));
-		if (!fcp->hash_table) {
-			pr_err("NET: failed to allocate flow cache sz %zu\n", sz);
+		if (!fcp->hash_table)
 			return -ENOMEM;
-		}
 		fcp->hash_rnd_recalc = 1;
 		fcp->hash_count = 0;
 		tasklet_init(&fcp->flush_tasklet, flow_cache_flush_tasklet, 0);
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 796044a..3769f16 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3323,7 +3323,6 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
 
 		pkt_dev->skb = fill_packet(odev, pkt_dev);
 		if (pkt_dev->skb == NULL) {
-			pr_err("ERROR: couldn't allocate skb in fill_packet\n");
 			schedule();
 			pkt_dev->clone_count--;	/* back out increment, OOM */
 			return;
@@ -3610,10 +3609,8 @@ static int __init pktgen_create_thread(int cpu)
 
 	t = kzalloc_node(sizeof(struct pktgen_thread), GFP_KERNEL,
 			 cpu_to_node(cpu));
-	if (!t) {
-		pr_err("ERROR: out of memory, can't create new thread\n");
+	if (!t)
 		return -ENOMEM;
-	}
 
 	spin_lock_init(&t->if_lock);
 	t->cpu = cpu;
diff --git a/net/socket.c b/net/socket.c
index 2517e11..51fa300 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1213,12 +1213,9 @@ int __sock_create(struct net *net, int family, int type, int protocol,
 	 *	default.
 	 */
 	sock = sock_alloc();
-	if (!sock) {
-		if (net_ratelimit())
-			printk(KERN_WARNING "socket: no more sockets\n");
+	if (!sock)
 		return -ENFILE;	/* Not exactly a match, but its the
 				   closest posix thing */
-	}
 
 	sock->type = type;
 
-- 
1.7.6.405.gc1be0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help