* [PATCH] libcxgbi: do not print a message when memory allocation fails
@ 2011-12-14 15:46 Thadeu Lima de Souza Cascardo
2011-12-15 0:52 ` Karen Xie
2011-12-26 22:27 ` Mike Christie
0 siblings, 2 replies; 4+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2011-12-14 15:46 UTC (permalink / raw)
To: linux-scsi
Cc: netdev, kxie, michaelc, davem, JBottomley, linux-kernel,
Thadeu Lima de Souza Cascardo
In alloc_pdu, libcxgbi tries to allocate a skb with GFP_ATOMIC, which
may potentially fail. When it happens, the current code prints a warning
message.
When the system is under IO stress, this failure may happen lots of
times and it usually scares users.
Instead of printing the warning message, the code now increases the
tx_dropped statistics for the ethernet interface wich is doing the iscsi
task.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/scsi/cxgbi/libcxgbi.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index c10f74a..3422bc2 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -1862,8 +1862,9 @@ int cxgbi_conn_alloc_pdu(struct iscsi_task *task, u8 opcode)
tdata->skb = alloc_skb(cdev->skb_tx_rsvd + headroom, GFP_ATOMIC);
if (!tdata->skb) {
- pr_warn("alloc skb %u+%u, opcode 0x%x failed.\n",
- cdev->skb_tx_rsvd, headroom, opcode);
+ struct cxgbi_sock *csk = cconn->cep->csk;
+ struct net_device *ndev = cdev->ports[csk->port_id];
+ ndev->stats.tx_dropped++;
return -ENOMEM;
}
--
1.7.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* RE: [PATCH] libcxgbi: do not print a message when memory allocation fails
2011-12-14 15:46 [PATCH] libcxgbi: do not print a message when memory allocation fails Thadeu Lima de Souza Cascardo
@ 2011-12-15 0:52 ` Karen Xie
2011-12-26 18:41 ` Thadeu Lima de Souza Cascardo
2011-12-26 22:27 ` Mike Christie
1 sibling, 1 reply; 4+ messages in thread
From: Karen Xie @ 2011-12-15 0:52 UTC (permalink / raw)
To: Thadeu Lima de Souza Cascardo, linux-scsi
Cc: netdev, michaelc, davem, JBottomley, linux-kernel
The patch looks fine to me.
Thanks,
Karen
-----Original Message-----
From: Thadeu Lima de Souza Cascardo [mailto:cascardo@linux.vnet.ibm.com]
Sent: Wednesday, December 14, 2011 7:46 AM
To: linux-scsi@vger.kernel.org
Cc: netdev@vger.kernel.org; Karen Xie; michaelc@cs.wisc.edu;
davem@davemloft.net; JBottomley@parallels.com;
linux-kernel@vger.kernel.org; Thadeu Lima de Souza Cascardo
Subject: [PATCH] libcxgbi: do not print a message when memory allocation
fails
In alloc_pdu, libcxgbi tries to allocate a skb with GFP_ATOMIC, which
may potentially fail. When it happens, the current code prints a warning
message.
When the system is under IO stress, this failure may happen lots of
times and it usually scares users.
Instead of printing the warning message, the code now increases the
tx_dropped statistics for the ethernet interface wich is doing the iscsi
task.
Signed-off-by: Thadeu Lima de Souza Cascardo
<cascardo@linux.vnet.ibm.com>
---
drivers/scsi/cxgbi/libcxgbi.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/cxgbi/libcxgbi.c
b/drivers/scsi/cxgbi/libcxgbi.c
index c10f74a..3422bc2 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -1862,8 +1862,9 @@ int cxgbi_conn_alloc_pdu(struct iscsi_task *task,
u8 opcode)
tdata->skb = alloc_skb(cdev->skb_tx_rsvd + headroom,
GFP_ATOMIC);
if (!tdata->skb) {
- pr_warn("alloc skb %u+%u, opcode 0x%x failed.\n",
- cdev->skb_tx_rsvd, headroom, opcode);
+ struct cxgbi_sock *csk = cconn->cep->csk;
+ struct net_device *ndev = cdev->ports[csk->port_id];
+ ndev->stats.tx_dropped++;
return -ENOMEM;
}
--
1.7.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] libcxgbi: do not print a message when memory allocation fails
2011-12-15 0:52 ` Karen Xie
@ 2011-12-26 18:41 ` Thadeu Lima de Souza Cascardo
0 siblings, 0 replies; 4+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2011-12-26 18:41 UTC (permalink / raw)
To: Karen Xie; +Cc: linux-scsi, netdev, michaelc, davem, JBottomley, linux-kernel
On Wed, Dec 14, 2011 at 04:52:42PM -0800, Karen Xie wrote:
> The patch looks fine to me.
>
> Thanks,
> Karen
>
Hi, Karen.
Thanks for your quick response.
Care to send a proper Acked-by? It seems this patch has not yet catch up
in James' tree.
Regards.
Cascardo.
> -----Original Message-----
> From: Thadeu Lima de Souza Cascardo [mailto:cascardo@linux.vnet.ibm.com]
>
> Sent: Wednesday, December 14, 2011 7:46 AM
> To: linux-scsi@vger.kernel.org
> Cc: netdev@vger.kernel.org; Karen Xie; michaelc@cs.wisc.edu;
> davem@davemloft.net; JBottomley@parallels.com;
> linux-kernel@vger.kernel.org; Thadeu Lima de Souza Cascardo
> Subject: [PATCH] libcxgbi: do not print a message when memory allocation
> fails
>
> In alloc_pdu, libcxgbi tries to allocate a skb with GFP_ATOMIC, which
> may potentially fail. When it happens, the current code prints a warning
> message.
>
> When the system is under IO stress, this failure may happen lots of
> times and it usually scares users.
>
> Instead of printing the warning message, the code now increases the
> tx_dropped statistics for the ethernet interface wich is doing the iscsi
> task.
>
> Signed-off-by: Thadeu Lima de Souza Cascardo
> <cascardo@linux.vnet.ibm.com>
> ---
> drivers/scsi/cxgbi/libcxgbi.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/cxgbi/libcxgbi.c
> b/drivers/scsi/cxgbi/libcxgbi.c
> index c10f74a..3422bc2 100644
> --- a/drivers/scsi/cxgbi/libcxgbi.c
> +++ b/drivers/scsi/cxgbi/libcxgbi.c
> @@ -1862,8 +1862,9 @@ int cxgbi_conn_alloc_pdu(struct iscsi_task *task,
> u8 opcode)
>
> tdata->skb = alloc_skb(cdev->skb_tx_rsvd + headroom,
> GFP_ATOMIC);
> if (!tdata->skb) {
> - pr_warn("alloc skb %u+%u, opcode 0x%x failed.\n",
> - cdev->skb_tx_rsvd, headroom, opcode);
> + struct cxgbi_sock *csk = cconn->cep->csk;
> + struct net_device *ndev = cdev->ports[csk->port_id];
> + ndev->stats.tx_dropped++;
> return -ENOMEM;
> }
>
> --
> 1.7.4.4
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] libcxgbi: do not print a message when memory allocation fails
2011-12-14 15:46 [PATCH] libcxgbi: do not print a message when memory allocation fails Thadeu Lima de Souza Cascardo
2011-12-15 0:52 ` Karen Xie
@ 2011-12-26 22:27 ` Mike Christie
1 sibling, 0 replies; 4+ messages in thread
From: Mike Christie @ 2011-12-26 22:27 UTC (permalink / raw)
To: Thadeu Lima de Souza Cascardo
Cc: linux-scsi, netdev, kxie, davem, JBottomley, linux-kernel
On 12/14/2011 09:46 AM, Thadeu Lima de Souza Cascardo wrote:
> In alloc_pdu, libcxgbi tries to allocate a skb with GFP_ATOMIC, which
> may potentially fail. When it happens, the current code prints a warning
> message.
>
> When the system is under IO stress, this failure may happen lots of
> times and it usually scares users.
>
> Instead of printing the warning message, the code now increases the
> tx_dropped statistics for the ethernet interface wich is doing the iscsi
> task.
>
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
> ---
> drivers/scsi/cxgbi/libcxgbi.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
> index c10f74a..3422bc2 100644
> --- a/drivers/scsi/cxgbi/libcxgbi.c
> +++ b/drivers/scsi/cxgbi/libcxgbi.c
> @@ -1862,8 +1862,9 @@ int cxgbi_conn_alloc_pdu(struct iscsi_task *task, u8 opcode)
>
> tdata->skb = alloc_skb(cdev->skb_tx_rsvd + headroom, GFP_ATOMIC);
> if (!tdata->skb) {
> - pr_warn("alloc skb %u+%u, opcode 0x%x failed.\n",
> - cdev->skb_tx_rsvd, headroom, opcode);
> + struct cxgbi_sock *csk = cconn->cep->csk;
> + struct net_device *ndev = cdev->ports[csk->port_id];
> + ndev->stats.tx_dropped++;
> return -ENOMEM;
> }
>
Looks ok to me.
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-12-26 22:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-14 15:46 [PATCH] libcxgbi: do not print a message when memory allocation fails Thadeu Lima de Souza Cascardo
2011-12-15 0:52 ` Karen Xie
2011-12-26 18:41 ` Thadeu Lima de Souza Cascardo
2011-12-26 22:27 ` Mike Christie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).