RE: [nhorman@xxxxxxxxxxxxx: [PATCH] libcxgbi: supress warning when we request to much space from kmalloc]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




-----Original Message-----
From: Neil Horman [mailto:nhorman@xxxxxxxxxxxxx] 
Sent: Friday, April 26, 2013 4:02 AM
To: Karen Xie
Subject: [nhorman@xxxxxxxxxxxxx: [PATCH] libcxgbi: supress warning when
we request to much space from kmalloc]

The patch looks fine to me.

Thanks,
Karen
----- Forwarded message from Neil Horman <nhorman@xxxxxxxxxxxxx> -----

Date: Tue, 23 Apr 2013 11:20:47 -0400
From: Neil Horman <nhorman@xxxxxxxxxxxxx>
To: linux-scsi@xxxxxxxxxxxxxxx
Cc: Neil Horman <nhorman@xxxxxxxxxxxxx>, "James E.J. Bottomley"
<JBottomley@xxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx
Subject: [PATCH] libcxgbi: supress warning when we request to much space
from kmalloc
X-Mailer: git-send-email 1.8.1.4

cxgbi_alloc_big_mem allocates large chunks of memory, and can
occasionally request amounts from kmalloc that exceed the allocators
capacity.  This typically leads to a stack trace from the zoned buddy
allocator in the message log.  But if kmalloc fails, cxgbi_alloc_big_mem
backs off and uses vmalloc instead.  Given that, and the fact that the
two calls sites have their own error messages if both kmalloc and
vmalloc fail, I think the stack trace printing isn't really needed.

Modify the call to kmalloc to pass __GFP_NOWARN in as well, so that
internal kmalloc warnings are suppressed.

Signed-off-by: Neil Horman <nhorman@xxxxxxxxxxxxx>
Reported-by: Honggang LI <honli@xxxxxxxxxx>
CC: "James E.J. Bottomley" <JBottomley@xxxxxxxxxxxxx>
CC: linux-kernel@xxxxxxxxxxxxxxx
---
 drivers/scsi/cxgbi/libcxgbi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/cxgbi/libcxgbi.h
b/drivers/scsi/cxgbi/libcxgbi.h index 80fa99b..3daf996 100644
--- a/drivers/scsi/cxgbi/libcxgbi.h
+++ b/drivers/scsi/cxgbi/libcxgbi.h
@@ -658,7 +658,7 @@ static inline u32 cxgbi_tag_nonrsvd_bits(struct
cxgbi_tag_format *tformat,  static inline void
*cxgbi_alloc_big_mem(unsigned int size,
 					gfp_t gfp)
 {
-	void *p = kmalloc(size, gfp);
+	void *p = kmalloc(size, gfp | __GFP_NOWARN);
 	if (!p)
 		p = vmalloc(size);
 	if (p)
--
1.8.1.4



----- End forwarded message -----
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux