From: Patrick McHardy <kaber@trash.net>
To: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: netfilter-devel@vger.kernel.org, Pablo Neira Ayuso <pablo@netfilter.org>
Subject: Re: [PATCH 00/13] ipset kernel patches v2
Date: Tue, 25 Jan 2011 16:38:28 +0100 [thread overview]
Message-ID: <4D3EEE74.2010203@trash.net> (raw)
In-Reply-To: <1295618527-9583-1-git-send-email-kadlec@blackhole.kfki.hu>
On 21.01.2011 15:01, Jozsef Kadlecsik wrote:
> Eric suggested to use vzalloc instead of
> __vmalloc, however the former hasn't got a gfp_t argument, so I kept __vmalloc.
> +/* Utility functions */
> +void *
> +ip_set_alloc(size_t size, gfp_t gfp_mask)
> +{
> + void *members = NULL;
> +
> + if (size < KMALLOC_MAX_SIZE)
> + members = kzalloc(size, gfp_mask | __GFP_NOWARN);
> +
> + if (members) {
> + pr_debug("%p: allocated with kmalloc\n", members);
> + return members;
> + }
> +
> + members = __vmalloc(size, gfp_mask | __GFP_ZERO | __GFP_HIGHMEM,
> + PAGE_KERNEL);
> + if (!members)
> + return NULL;
> + pr_debug("%p: allocated with vmalloc\n", members);
> +
> + return members;
> +}
The gfp_t argument seems unnecessary since all users use GFP_KERNEL
and this is also the only reasonable choice since vmalloc() can't
be used in atomic context. So the only combination of flags that
is actually used is __GFP_ZERO | __GFP_HIGHMEM | __GFP_KERNEL,
which is exactly what vzalloc() uses.
next prev parent reply other threads:[~2011-01-25 15:38 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-21 14:01 [PATCH 00/13] ipset kernel patches v2 Jozsef Kadlecsik
2011-01-21 14:01 ` [PATCH 01/13] NFNL_SUBSYS_IPSET id and NLA_PUT_NET* macros Jozsef Kadlecsik
2011-01-21 14:01 ` [PATCH 02/13] IP set core support Jozsef Kadlecsik
2011-01-21 14:01 ` [PATCH 03/13] bitmap:ip set type support Jozsef Kadlecsik
2011-01-21 14:01 ` [PATCH 04/13] bitmap:ip,mac " Jozsef Kadlecsik
2011-01-21 14:01 ` [PATCH 05/13] bitmap:port set " Jozsef Kadlecsik
2011-01-21 14:01 ` [PATCH 06/13] hash:ip " Jozsef Kadlecsik
2011-01-21 14:02 ` [PATCH 07/13] hash:ip,port " Jozsef Kadlecsik
2011-01-21 14:02 ` [PATCH 08/13] hash:ip,port,ip " Jozsef Kadlecsik
2011-01-21 14:02 ` [PATCH 09/13] hash:ip,port,net " Jozsef Kadlecsik
2011-01-21 14:02 ` [PATCH 10/13] hash:net " Jozsef Kadlecsik
2011-01-21 14:02 ` [PATCH 11/13] hash:net,port " Jozsef Kadlecsik
2011-01-21 14:02 ` [PATCH 12/13] list:set " Jozsef Kadlecsik
2011-01-21 14:02 ` [PATCH 13/13] "set" match and "SET" target support Jozsef Kadlecsik
2011-01-25 15:18 ` Patrick McHardy
2011-01-25 21:40 ` Jozsef Kadlecsik
2011-01-25 15:05 ` [PATCH 03/13] bitmap:ip set type support Patrick McHardy
2011-01-25 21:34 ` Jozsef Kadlecsik
2011-01-27 9:06 ` Jozsef Kadlecsik
2011-01-27 9:08 ` Patrick McHardy
2011-01-21 21:39 ` [PATCH 02/13] IP set core support Jozsef Kadlecsik
2011-01-25 14:47 ` Patrick McHardy
2011-01-25 21:23 ` Jozsef Kadlecsik
2011-01-26 11:57 ` Patrick McHardy
2011-01-26 11:57 ` Patrick McHardy
2011-01-25 15:06 ` Patrick McHardy
2011-01-25 21:28 ` Jozsef Kadlecsik
2011-01-27 8:58 ` Jozsef Kadlecsik
2011-01-25 15:38 ` Patrick McHardy [this message]
2011-01-25 21:41 ` [PATCH 00/13] ipset kernel patches v2 Jozsef Kadlecsik
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=4D3EEE74.2010203@trash.net \
--to=kaber@trash.net \
--cc=kadlec@blackhole.kfki.hu \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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).