LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] virtio: use __GFP_NOWARN for try_fill_recv in virtnet_poll
@ 2011-02-15  9:35 Michal Hocko
  2011-02-15 10:11 ` Rusty Russell
  2011-02-15 12:39 ` Michal Hocko
  0 siblings, 2 replies; 6+ messages in thread
From: Michal Hocko @ 2011-02-15  9:35 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Michael S. Tsirkin, virtualization, netdev, linux-kernel

Hi,
we have started seeing a lot of allocator messages complaining about
failed allocations from virtnet_poll in soft IRQ. Could you consider the
following patch, please?

The patch is based on 2.6.38-rc4.
--- 
>From aabc19f22915dafeac0f1f6aa7cb7e49a8021ba1 Mon Sep 17 00:00:00 2001
From: Michal Hocko <mhocko@suse.cz>
Date: Tue, 15 Feb 2011 10:20:59 +0100
Subject: [PATCH] virtio: use __GFP_NOWARN for try_fill_recv in virtnet_poll

virtnet_poll is called from soft IRQ and it tries to allocate GFP_ATOMIC
memory (through try_fill_recv). This allocation can fail and we are
falling back to schedule_delayed_work in that case.

Let's add __GFP_NOWARN to the allocation flags to get rid of the
allocator complains for failed allocations:

[22798.508903] The following is only an harmless informational message.
[22798.508909] Unless you get a _continuous_flood_ of these messages it means
[22798.508911] everything is working fine. Allocations from irqs cannot be
[22798.508913] perfectly reliable and the kernel is designed to handle that.
[22798.508917] loop3: page allocation failure. order:0, mode:0x20, alloc_flags:0x30 pflags:0x80208040

Signed-off-by: Michal Hocko <mhocko@suse.cz>
---
 drivers/net/virtio_net.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 90a23e4..aea1e51 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -477,7 +477,7 @@ again:
 	}
 
 	if (vi->num < vi->max / 2) {
-		if (!try_fill_recv(vi, GFP_ATOMIC))
+		if (!try_fill_recv(vi, GFP_ATOMIC|__GFP_NOWARN))
 			schedule_delayed_work(&vi->refill, 0);
 	}
 
-- 
1.7.2.3


-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] virtio: use __GFP_NOWARN for try_fill_recv in virtnet_poll
  2011-02-15  9:35 [PATCH] virtio: use __GFP_NOWARN for try_fill_recv in virtnet_poll Michal Hocko
@ 2011-02-15 10:11 ` Rusty Russell
  2011-02-15 10:25   ` Michal Hocko
  2011-02-15 12:39 ` Michal Hocko
  1 sibling, 1 reply; 6+ messages in thread
From: Rusty Russell @ 2011-02-15 10:11 UTC (permalink / raw)
  To: Michal Hocko; +Cc: Michael S. Tsirkin, virtualization, netdev, linux-kernel

On Tue, 15 Feb 2011 08:05:27 pm Michal Hocko wrote:
> Hi,
> we have started seeing a lot of allocator messages complaining about
> failed allocations from virtnet_poll in soft IRQ. Could you consider the
> following patch, please?

Do we really want to silence this?  Isn't warning about it kind of the
point?  Your network is probably sucking if this happens...

Cheers,
Rusty.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] virtio: use __GFP_NOWARN for try_fill_recv in virtnet_poll
  2011-02-15 10:11 ` Rusty Russell
@ 2011-02-15 10:25   ` Michal Hocko
  2011-02-15 11:09     ` Rusty Russell
  0 siblings, 1 reply; 6+ messages in thread
From: Michal Hocko @ 2011-02-15 10:25 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Michael S. Tsirkin, virtualization, netdev, linux-kernel

On Tue 15-02-11 20:41:29, Rusty Russell wrote:
> On Tue, 15 Feb 2011 08:05:27 pm Michal Hocko wrote:
> > Hi,
> > we have started seeing a lot of allocator messages complaining about
> > failed allocations from virtnet_poll in soft IRQ. Could you consider the
> > following patch, please?
> 
> Do we really want to silence this?  Isn't warning about it kind of the
> point?  Your network is probably sucking if this happens...

What can user do about it? Is the low level memory allocator message
very much usefull for him?  Maybe we can add a printk_once in the fail
path with some more useful and virtio specific message.

Thanks
-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] virtio: use __GFP_NOWARN for try_fill_recv in virtnet_poll
  2011-02-15 10:25   ` Michal Hocko
@ 2011-02-15 11:09     ` Rusty Russell
  2011-02-15 12:42       ` Michal Hocko
  0 siblings, 1 reply; 6+ messages in thread
From: Rusty Russell @ 2011-02-15 11:09 UTC (permalink / raw)
  To: Michal Hocko; +Cc: Michael S. Tsirkin, virtualization, netdev, linux-kernel

On Tue, 15 Feb 2011 08:55:50 pm Michal Hocko wrote:
> On Tue 15-02-11 20:41:29, Rusty Russell wrote:
> > On Tue, 15 Feb 2011 08:05:27 pm Michal Hocko wrote:
> > > Hi,
> > > we have started seeing a lot of allocator messages complaining about
> > > failed allocations from virtnet_poll in soft IRQ. Could you consider the
> > > following patch, please?
> > 
> > Do we really want to silence this?  Isn't warning about it kind of the
> > point?  Your network is probably sucking if this happens...
> 
> What can user do about it? Is the low level memory allocator message
> very much usefull for him?  Maybe we can add a printk_once in the fail
> path with some more useful and virtio specific message.

That's an argument against ever printing any message.

What we need to know is why does this happen with virtio_net and not other
cards?  If it happens to them too, and they silently fall back, all good.

I want to make sure we're not papering over a real problem...

Thanks,
Rusty.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] virtio: use __GFP_NOWARN for try_fill_recv in virtnet_poll
  2011-02-15  9:35 [PATCH] virtio: use __GFP_NOWARN for try_fill_recv in virtnet_poll Michal Hocko
  2011-02-15 10:11 ` Rusty Russell
@ 2011-02-15 12:39 ` Michal Hocko
  1 sibling, 0 replies; 6+ messages in thread
From: Michal Hocko @ 2011-02-15 12:39 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Michael S. Tsirkin, virtualization, netdev, linux-kernel

On Tue 15-02-11 10:35:27, Michal Hocko wrote:
[...]
> [22798.508903] The following is only an harmless informational message.
> [22798.508909] Unless you get a _continuous_flood_ of these messages it means
> [22798.508911] everything is working fine. Allocations from irqs cannot be
> [22798.508913] perfectly reliable and the kernel is designed to handle that.

I have just realized that the above text is SLES specific so only the
line below with stack trace and memory info is printed. Sorry for confusion

> [22798.508917] loop3: page allocation failure. order:0, mode:0x20, alloc_flags:0x30 pflags:0x80208040

-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] virtio: use __GFP_NOWARN for try_fill_recv in virtnet_poll
  2011-02-15 11:09     ` Rusty Russell
@ 2011-02-15 12:42       ` Michal Hocko
  0 siblings, 0 replies; 6+ messages in thread
From: Michal Hocko @ 2011-02-15 12:42 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Michael S. Tsirkin, virtualization, netdev, linux-kernel

On Tue 15-02-11 21:39:03, Rusty Russell wrote:
> On Tue, 15 Feb 2011 08:55:50 pm Michal Hocko wrote:
> > On Tue 15-02-11 20:41:29, Rusty Russell wrote:
> > > On Tue, 15 Feb 2011 08:05:27 pm Michal Hocko wrote:
> > > > Hi,
> > > > we have started seeing a lot of allocator messages complaining about
> > > > failed allocations from virtnet_poll in soft IRQ. Could you consider the
> > > > following patch, please?
> > > 
> > > Do we really want to silence this?  Isn't warning about it kind of the
> > > point?  Your network is probably sucking if this happens...
> > 
> > What can user do about it? Is the low level memory allocator message
> > very much usefull for him?  Maybe we can add a printk_once in the fail
> > path with some more useful and virtio specific message.
> 
> That's an argument against ever printing any message.

Well, honestly, I do not see much point for this message but it is there
for ages so it maybe it is valueable for somebody...

> 
> What we need to know is why does this happen with virtio_net and not other
> cards?  

The machine just happened to be short on memory due to a strong memory
pressure.

> If it happens to them too, and they silently fall back, all good.
> 
> I want to make sure we're not papering over a real problem...
> 
> Thanks,
> Rusty.

-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-02-15 12:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-15  9:35 [PATCH] virtio: use __GFP_NOWARN for try_fill_recv in virtnet_poll Michal Hocko
2011-02-15 10:11 ` Rusty Russell
2011-02-15 10:25   ` Michal Hocko
2011-02-15 11:09     ` Rusty Russell
2011-02-15 12:42       ` Michal Hocko
2011-02-15 12:39 ` Michal Hocko

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).