From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next] pkt_sched: fq: more robust memory allocation
Date: Sat, 14 Dec 2013 01:19:42 -0500 (EST) [thread overview]
Message-ID: <20131214.011942.1693344941253042499.davem@davemloft.net> (raw)
In-Reply-To: <1386894912.19078.130.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 12 Dec 2013 16:35:12 -0800
> @@ -578,15 +579,32 @@ static void fq_rehash(struct fq_sched_data *q,
> q->stat_gc_flows += fcnt;
> }
>
> -static int fq_resize(struct fq_sched_data *q, u32 log)
> +static void fq_free(void *addr)
> {
> + if (addr && is_vmalloc_addr(addr))
> + vfree(addr);
> + else
> + kfree(addr);
> +}
...
> + array = kmalloc_node(sz, GFP_KERNEL | __GFP_REPEAT | __GFP_NOWARN,
> + node);
> + if (!array)
> + array = vmalloc_node(sz, node);
Eric, please make a "fq_alloc()" which does this:
x = kmalloc;
if (!x)
x = vmalloc;
dance, in order to complement fq_free().
thanks.
next prev parent reply other threads:[~2013-12-14 6:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-13 0:35 [PATCH net-next] pkt_sched: fq: more robust memory allocation Eric Dumazet
2013-12-14 6:19 ` David Miller [this message]
2013-12-14 16:31 ` Eric Dumazet
2013-12-15 21:15 ` [PATCH v2 " Eric Dumazet
2013-12-17 20:25 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131214.011942.1693344941253042499.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).