net: Remove unnecessary OOM logging messages
Subsystems (23)
cover net: Remove unnecessary OOM logging messages
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(-)
Signature · 1 line
1.7.6.405.gc1be0
PATCH 1/24 802: 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.
--- net/802/tr.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
net/802/tr.c +0 -1
@@ -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 ; }
Signature · 1 line
1.7.6.405.gc1be0
PATCH 2/24 9p: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- net/9p/client.c | 7 ++----- net/9p/trans_virtio.c | 6 +----- 2 files changed, 3 insertions(+), 10 deletions(-)
net/9p/client.c +2 -5
@@ -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);
net/9p/trans_virtio.c +1 -5
@@ -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; }
Signature · 1 line
1.7.6.405.gc1be0
PATCH 3/24 atm: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- net/atm/lec.c | 4 +--- net/atm/mpc.c | 17 +++++------------ net/atm/mpoa_caches.c | 8 ++------ 3 files changed, 8 insertions(+), 21 deletions(-)
net/atm/lec.c +1 -3
@@ -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,
net/atm/mpc.c +5 -12
@@ -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 ; }
net/atm/mpoa_caches.c +2 -6
@@ -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);
Signature · 1 line
1.7.6.405.gc1be0
PATCH 4/24 ax25: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- 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(-)
net/ax25/ax25_dev.c +2 -3
@@ -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 ();
net/ax25/ax25_out.c +4 -4
@@ -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 ; }
net/ax25/ax25_route.c +2 -3
@@ -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);
Signature · 1 line
1.7.6.405.gc1be0
Re: [PATCH 04/24] ax25: Remove unnecessary OOM logging messages
Quoted 1 line · Joe Perches
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
Signature · 3 lines
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 5/24 batman-adv: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- 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(-)
net/batman-adv/hard-interface.c +1 -4
@@ -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)
net/batman-adv/main.c +0 -2
@@ -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 ;
net/batman-adv/originator.c +4 -12
@@ -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 ));
net/batman-adv/soft-interface.c +1 -3
@@ -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 ) {
net/batman-adv/vis.c +1 -3
@@ -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 +
Signature · 1 line
1.7.6.405.gc1be0
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH 05/24] batman-adv: Remove unnecessary OOM logging messages
Quoted 5 lines · 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 6/24 netfilter: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- 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(-)
net/bridge/netfilter/ebt_ulog.c +3 -4
@@ -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); } }
net/ipv4/netfilter/ipt_CLUSTERIP.c +0 -1
@@ -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 ; }
net/ipv4/netfilter/ipt_ULOG.c +1 -3
@@ -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 */
net/ipv4/netfilter/nf_nat_snmp_basic.c +2 -20
@@ -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;
net/ipv6/netfilter/nf_conntrack_reasm.c +3 -4
@@ -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;
net/netfilter/ipset/ip_set_core.c +1 -3
@@ -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 ) {
net/netfilter/ipvs/ip_vs_core.c +2 -3
@@ -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;
net/netfilter/ipvs/ip_vs_ctl.c +6 -12
@@ -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);
net/netfilter/ipvs/ip_vs_dh.c +2 -3
@@ -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",
net/netfilter/ipvs/ip_vs_lblc.c +3 -6
@@ -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));
net/netfilter/ipvs/ip_vs_lblcr.c +4 -9
@@ -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));
net/netfilter/ipvs/ip_vs_proto.c +2 -3
@@ -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;
net/netfilter/ipvs/ip_vs_sh.c +2 -3
@@ -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",
net/netfilter/ipvs/ip_vs_wrr.c +2 -3
@@ -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);
net/netfilter/nf_conntrack_core.c +1 -4
@@ -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);
net/netfilter/nfnetlink_log.c +2 -5
@@ -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); } }
net/netfilter/xt_IDLETIMER.c +0 -2
@@ -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; }
net/netfilter/xt_hashlimit.c +1 -4
@@ -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);
Signature · 1 line
1.7.6.405.gc1be0
Re: [PATCH 06/24] netfilter: Remove unnecessary OOM logging messages
Quoted 5 lines · Joe Perches
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
Quoted 7 lines · Patrick McHardy
Quoted 4 lines · Joe Perches
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
David Miller
maintainerRe: [PATCH 06/24] netfilter: Remove unnecessary OOM logging messages
In reply to Patrick McHardyFrom: Patrick McHardy <[email protected]>
Date: Tue, 30 Aug 2011 14:46:34 +0200
Quoted 9 lines · Joe Perches
Quoted 5 lines
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
Quoted 10 lines · David Miller
From: Patrick McHardy <[email protected]>
Date: Tue, 30 Aug 2011 14:46:34 +0200Quoted 7 lines · Joe Perches
Quoted 5 lines
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.
Quoted 5 lines
Quoted 2 lines
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.
Pablo Neira Ayuso
maintainerRe: [PATCH 06/24] netfilter: Remove unnecessary OOM logging messages
Quoted 14 lines · Patrick McHardy
Quoted 13 lines · David Miller
From: Patrick McHardy <[email protected]>
Date: Tue, 30 Aug 2011 14:46:34 +0200Quoted 9 lines · Joe Perches
Quoted 5 lines
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?
Quoted 7 lines
Quoted 2 lines
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 7/24 can: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- net/can/af_can.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
net/can/af_can.c +2 -4
@@ -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;
Signature · 1 line
1.7.6.405.gc1be0
Re: [PATCH 07/24] can: Remove unnecessary OOM logging messages
Quoted 7 lines · Joe Perches
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 <[email protected]>
Tnx Joe.
Quoted 22 lines
--- net/can/af_can.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)net/can/af_can.c +2
-4@@ -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 8/24 ceph: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- net/ceph/messenger.c | 5 +---- net/ceph/msgpool.c | 6 +----- 2 files changed, 2 insertions(+), 9 deletions(-)
net/ceph/messenger.c +1 -4
@@ -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 ; }
net/ceph/msgpool.c +1 -5
@@ -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)
Signature · 1 line
1.7.6.405.gc1be0
PATCH 9/24 decnet: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- net/decnet/dn_neigh.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)
net/decnet/dn_neigh.c +0 -6
@@ -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 ; }
Signature · 1 line
1.7.6.405.gc1be0
PATCH 10/24 econet: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- net/econet/af_econet.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
net/econet/af_econet.c +1 -3
@@ -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 ));
Signature · 1 line
1.7.6.405.gc1be0
PATCH 11/24 iucv: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- net/iucv/iucv.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
net/iucv/iucv.c +2 -3
@@ -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 ) {
Signature · 1 line
1.7.6.405.gc1be0
PATCH 12/24 mac80211: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- 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(-)
net/mac80211/agg-rx.c +2 -17
@@ -167,12 +167,8 @@ static void ieee80211_send_addba_resp(struct ieee80211_sub_if_data *sdata, u8 *du16 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);
net/mac80211/agg-tx.c +8 -27
@@ -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, u1u16 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;
net/mac80211/debugfs.c +3 -0
@@ -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" );
net/mac80211/ht.c +1 -5
@@ -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 );
net/mac80211/mesh.c +2 -3
@@ -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 );
net/mac80211/mlme.c +5 -12
@@ -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 );
net/mac80211/spectmgmt.c +1 -5
@@ -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 );
net/mac80211/tx.c +5 -12
@@ -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);
net/mac80211/util.c +3 -8
@@ -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
net/mac80211/work.c +2 -4
@@ -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 ;
Signature · 1 line
1.7.6.405.gc1be0
PATCH 13/24 netrom: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- net/netrom/af_netrom.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-)
net/netrom/af_netrom.c +2 -6
@@ -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)) {
Signature · 1 line
1.7.6.405.gc1be0
PATCH 14/24 rds: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- 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(-)
net/rds/ib_rdma.c +0 -1
@@ -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; }
net/rds/iw_rdma.c +1 -7
@@ -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; }
net/rds/iw_send.c +2 -6
@@ -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 ; - } } }
Signature · 1 line
1.7.6.405.gc1be0
PATCH 15/24 rfkill: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- net/rfkill/rfkill-regulator.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
net/rfkill/rfkill-regulator.c +0 -1
@@ -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; }
Signature · 1 line
1.7.6.405.gc1be0
PATCH 16/24 rose: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- net/rose/af_rose.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
net/rose/af_rose.c +0 -1
@@ -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; }
Signature · 1 line
1.7.6.405.gc1be0
PATCH 17/24 sched: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- net/sched/act_api.c | 6 ++---- net/sched/sch_atm.c | 1 - 2 files changed, 2 insertions(+), 5 deletions(-)
net/sched/act_api.c +2 -4
@@ -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; }
net/sched/sch_atm.c +0 -1
@@ -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;
Signature · 1 line
1.7.6.405.gc1be0
Re: [PATCH 17/24] sched: Remove unnecessary OOM logging messages
Quoted 1 line · Joe Perches
Signed-off-by Joe Perches <[email protected]>
cheers,
jamal
PATCH 18/24 sctp: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- net/sctp/protocol.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
net/sctp/protocol.c +0 -3
@@ -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; }
Signature · 1 line
1.7.6.405.gc1be0
Re: [PATCH 18/24] sctp: Remove unnecessary OOM logging messages
Quoted 7 lines · Joe Perches
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 <[email protected]>
-vlad
Quoted 32 lines
--- net/sctp/protocol.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)net/sctp/protocol.c +0
-3@@ -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
In reply to Joe PerchesQuoted 32 lines · Joe Perches
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 <[email protected]>--- net/sctp/protocol.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)net/sctp/protocol.c +0
-2@@ -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; }
net/sctp/protocol.c SCTP_STATIC __init int sctp_init(void) · line 1362
Quoted 7 lines
net/sctp/protocol.c +0
-1@@ -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
Quoted 2 lines · Eric Dumazet
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.
David Miller
maintainerRe: [PATCH 18/24] sctp: Remove unnecessary OOM logging messages
From: Eric Dumazet <[email protected]>
Date: Mon, 29 Aug 2011 23:51:21 +0200
Quoted 5 lines · Eric Dumazet
Quoted 3 lines
Furthermore, a failed
vmalloc()is not guaranteed to emit an OOM message, is it ?
Quoted 8 lines
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
Quoted 5 lines · David Miller
From: Eric Dumazet <[email protected]>
Date: Mon, 29 Aug 2011 23:51:21 +0200Quoted 3 lines · Eric Dumazet
Quoted 2 lines
Furthermore, a failed
vmalloc()is not guaranteed to emit an OOM message, is it ?
Quoted 8 lines
Quoted 5 lines
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 failedvmalloc()calls.Indeed.
Joe, thesevmalloc()and also the__GFP_NOWARNcases 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
In reply to Eric DumazetQuoted 10 lines · Eric Dumazet
net/sctp/protocol.c
Quoted 9 lines · Joe Perches
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 <[email protected]>--- net/sctp/protocol.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)net/sctp/protocol.c +0
-0
[]
Quoted 8 lines
net/sctp/protocol.c SCTP_STATIC __init int sctp_init(void) · line 1331
Quoted 8 lines
net/sctp/protocol.c +0
-1@@ -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 10 lines
net/sctp/protocol.c SCTP_STATIC __init int sctp_init(void) · line 1362
Quoted 8 lines
net/sctp/protocol.c +0
-1@@ -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.
Quoted 2 lines
As I already told you in the past,
__GFP_NOWARNdont print generic OOM messages.
I didn't notice those had GFP_NOWARN.
Quoted 5 lines
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
Quoted 2 lines
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
In reply to Joe PerchesRemoving 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.
--- 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(-)
net/sunrpc/auth_gss/gss_krb5_crypto.c +2 -8
@@ -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 ;
net/sunrpc/auth_gss/gss_krb5_mech.c +0 -2
@@ -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; }
net/sunrpc/backchannel_rqst.c +3 -6
@@ -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 ;
net/sunrpc/clnt.c +0 -3
@@ -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 :
net/sunrpc/rpc_pipe.c +1 -2
@@ -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 ; }
net/sunrpc/rpcb_clnt.c +0 -2
@@ -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;
net/sunrpc/xprtrdma/svc_rdma.c +2 -6
@@ -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);
net/sunrpc/xprtrdma/transport.c +1 -4
@@ -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;
net/sunrpc/xprtrdma/verbs.c +0 -14
@@ -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; }
net/sunrpc/xprtsock.c +1 -4
@@ -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);
Signature · 1 line
1.7.6.405.gc1be0
RE: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging messages
Quoted 5 lines
-----Original Message-----
From: Joe Perches [mailto:[email protected]]
Sent: Monday, August 29, 2011 5:18 PM
To: Myklebust, Trond; J. Bruce Fields; Neil Brown
Cc: David S. Miller; [email protected];
Quoted 10 lines
[email protected]
Subject: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging messagesRemoving 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 <[email protected]>
Quoted 13 lines
--- 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
David Miller
maintainerRe: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging messages
From: "Myklebust, Trond" <[email protected]>
Date: Mon, 29 Aug 2011 14:36:17 -0700
Quoted 3 lines
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
Quoted 9 lines · David Miller
From: "Myklebust, Trond" <[email protected]>
Date: Mon, 29 Aug 2011 14:36:17 -0700Quoted 3 lines
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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
David Miller
maintainerRe: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging messages
From: Boaz Harrosh <[email protected]>
Date: Mon, 29 Aug 2011 14:54:59 -0700
Quoted 1 line
I have a question about that. Are the dprints going to show the stack backtrace?
Yes, OOMs give full stack backtraces.
Quoted 2 lines
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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging messages
Quoted 10 lines
-----Original Message-----
From: David Miller [mailto:[email protected]]
Sent: Monday, August 29, 2011 6:04 PM
To: [email protected]
Cc: Myklebust, Trond; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging messages
Quoted 4 lines
From: Boaz Harrosh <[email protected]>
Date: Mon, 29 Aug 2011 14:54:59 -0700Quoted 1 line
I have a question about that. Are the dprints going to show the
stack
Quoted 8 lines
backtrace?
Yes, OOMs give full stack backtraces.
Quoted 1 line
If yes above? then I'm not sure I like it either, because am I'll be
getting a full
Quoted 1 line
stack backtrace for every failed allocation?
Quoted 7 lines
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
Quoted 2 lines · Trond
Quoted 2 lines
-----Original Message-----
From: David Miller [mailto:davem-fT/PcQaiUtIeIZ0/[email protected]]
<>
Quoted 10 lines
Quoted 5 lines
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.chas theslab_out_of_memory()function that (although ratelimited) warns you if the allocation failed. However I can't find any equivalent forslab.corslob.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?
Quoted 1 line
Trond
Thanks
Boaz
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
David Miller
maintainerRe: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging messages
In reply to Myklebust, TrondFrom: "Myklebust, Trond" <[email protected]>
Date: Mon, 29 Aug 2011 16:25:08 -0700
Quoted 3 lines
I can see that
slub.chas theslab_out_of_memory()function that (although ratelimited) warns you if the allocation failed. However I can't find any equivalent forslab.corslob.c.
See the page allocator.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 19/24] sunrpc: Remove unnecessary OOM logging messages
In reply to Boaz HarroshPiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBCb2F6IEhhcnJvc2ggW21haWx0 bzpiaGFycm9zaEBwYW5hc2FzLmNvbV0NCj4gU2VudDogTW9uZGF5LCBBdWd1c3QgMjksIDIwMTEg NTo1NSBQTQ0KPiBUbzogRGF2aWQgTWlsbGVyDQo+IENjOiBNeWtsZWJ1c3QsIFRyb25kOyBqb2VA cGVyY2hlcy5jb207IGJmaWVsZHNAZmllbGRzZXMub3JnOw0KPiBuZWlsYkBzdXNlLmRlOyBsaW51 eC1uZnNAdmdlci5rZXJuZWwub3JnOyBuZXRkZXZAdmdlci5rZXJuZWwub3JnOw0KPiBsaW51eC1r ZXJuZWxAdmdlci5rZXJuZWwub3JnDQo+IFN1YmplY3Q6IFJlOiBbUEFUQ0ggMTkvMjRdIHN1bnJw YzogUmVtb3ZlIHVubmVjZXNzYXJ5IE9PTSBsb2dnaW5nDQo+IG1lc3NhZ2VzDQo+IA0KPiBPbiAw OC8yOS8yMDExIDAyOjM3IFBNLCBEYXZpZCBNaWxsZXIgd3JvdGU6DQo+ID4gRnJvbTogIk15a2xl YnVzdCwgVHJvbmQiIDxUcm9uZC5NeWtsZWJ1c3RAbmV0YXBwLmNvbT4NCj4gPiBEYXRlOiBNb24s IDI5IEF1ZyAyMDExIDE0OjM2OjE3IC0wNzAwDQo+ID4NCj4gPj4gQmlnIE5BQ0suLi4NCj4gPj4N Cj4gPj4gQnkgd2hvc2Ugc3RhbmRhcmQgYXJlIHRob3NlICJub3QgdXNlZnVsIj8NCj4gPg0KPiA+ IEJ5IG1pbmUsIHRoYXQncyBmb3Igc3VyZS4gIEl0J3MgZHVwbGljYXRpbmcgc29tZXRoaW5nIHRo YXQgdGhlDQo+IGFsbG9jYXRpb24NCj4gPiBsYXllcnMgYXJlIGFscmVhZHkgZ29pbmcgdG8gcHJp bnQuDQo+IA0KPiBJIGhhdmUgYSBxdWVzdGlvbiBhYm91dCB0aGF0LiBBcmUgdGhlIGRwcmludHMg Z29pbmcgdG8gc2hvdyB0aGUgc3RhY2sNCj4gYmFja3RyYWNlPw0KPiBPdGhlcndpc2UgaG93IGNh biBJIHNlZSB3aGljaCBleGFjdCBhbGxvY2F0aW9uIGZhaWxlZCBhbmQgd2FzIG5vdA0KPiBwcm9w ZXJseSBoYW5kbGVkPw0KPiANCj4gSWYgeWVzIGFib3ZlPyB0aGVuIEknbSBub3Qgc3VyZSBJIGxp a2UgaXQgZWl0aGVyLCBiZWNhdXNlIGFtIEknbGwgYmUNCj4gZ2V0dGluZyBhIGZ1bGwNCj4gc3Rh Y2sgYmFja3RyYWNlIGZvciBldmVyeSBmYWlsZWQgYWxsb2NhdGlvbj8NCj4gDQo+IEJ1dCBJIG1p Z2h0IGxpa2UgaXQgaWYgSSB0cnkuIEhvdyBkbyBJIHR1cm4gb24gYWxsb2NhdGlvbiBmYWlsdXJl cw0KPiBwcmludHM/DQo+IENhbiBJIGZpbHRlciBvdXQgdG8gcHJpbnQgb25seSBHRlBfS0VSTkVM IGZhaWx1cmVzIGFuZCBvciBvdGhlciBHRlANCj4gY29tYmluYXRpb25zPw0KDQpSaWdodC4gSWYg ZXZlcnkgR0ZQX0FUT01JQyBvciBHRlBfTk9XQUlUIGlzIGdvaW5nIHRvIHByaW50IG91dCBzdGFj ayB0cmFjZXMsIHRoZW4gd2UncmUgaGVhZGluZyBmb3IgYWJzb2x1dGUgaW5zYW5pdHkuIElmIG5v dCwgdGhlbiB0aGUgZXhpc3RpbmcgZHByaW50aygpcyBtYWtlIGEgbG90IG1vcmUgc2Vuc2UsICdj b3MgdGhleSBhcmUgdHVybmVkIG9uIG9ubHkgd2hlbiB0aGUgYWRtaW5pc3RyYXRvciBub3RpY2Vz IGEgcHJvYmxlbSwgYW5kIGlzIHRyeWluZyB0byBkZWJ1ZyBpdC4NCg0KVHJvbmQNCg0KTu+/ve+/ ve+/ve+/ve+/vXLvv73vv71577+977+977+9Yu+/vVjvv73vv73Hp3bvv71e77+9Kd66ey5u77+9 K++/ve+/ve+/ve+/vXvvv73vv73vv70i77+977+9Xm7vv71y77+977+977+9eu+/vRrvv73vv71o 77+977+977+977+9Ju+/ve+/vR7vv71H77+977+977+9aO+/vQMo77+96ZqO77+93aJqIu+/ve+/ vRrvv70bbe+/ve+/ve+/ve+/ve+/vXrvv73elu+/ve+/ve+/vWbvv73vv73vv71o77+977+977+9 fu+/vW3vv70=
PATCH 20/24 tipc: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- net/tipc/link.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
net/tipc/link.c +1 -3
@@ -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 ;
Signature · 1 line
1.7.6.405.gc1be0
PATCH 21/24 wanrouter: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- net/wanrouter/wanmain.c | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-)
net/wanrouter/wanmain.c +1 -7
@@ -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 ; }
Signature · 1 line
1.7.6.405.gc1be0
PATCH 22/24 wireless: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- 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(-)
net/wireless/lib80211_crypt_ccmp.c +0 -2
@@ -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; }
net/wireless/lib80211_crypt_tkip.c +0 -4
@@ -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; }
net/wireless/lib80211_crypt_wep.c +0 -4
@@ -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; }
net/wireless/util.c +2 -3
@@ -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; }
Signature · 1 line
1.7.6.405.gc1be0
PATCH 23/24 x25: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- net/x25/x25_dev.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-)
net/x25/x25_dev.c +4 -6
@@ -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 ;
Signature · 1 line
1.7.6.405.gc1be0
PATCH 24/24 net: Remove unnecessary OOM logging messages
In reply to Joe PerchesRemoving 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.
--- 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(-)
net/core/dev.c +7 -18
@@ -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;
net/core/flow.c +1 -3
@@ -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 );
net/core/pktgen.c +1 -4
@@ -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;
net/socket.c +1 -4
@@ -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;
Signature · 1 line
1.7.6.405.gc1be0