From: Thomas Jarosch <thomas.jarosch@intra2net.com>
To: netfilter-devel@lists.netfilter.org
Cc: Jan Engelhardt <jengelh@computergmbh.de>
Subject: Re: Memory allocation inside target handler
Date: Mon, 20 Aug 2007 11:46:32 +0200 [thread overview]
Message-ID: <200708201146.32251.thomas.jarosch@intra2net.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0708171737580.30502@fbirervta.pbzchgretzou.qr>
On Friday, 17. August 2007, Jan Engelhardt wrote:
> On Aug 17 2007 17:17, Thomas Jarosch wrote:
> >My question is now:
> >- Is it ok to use get_zeroed_page(GFP_ATOMIC) in interrupt context?
>
> I suppose so. There is code that checks for __GFP_WAIT.
> (GFP_ATOMIC has __GFP_WAIT _cleared_)
>
> >- Do I need some special locking before I can allocate memory inside
> > the target handler? Is f.e. kmalloc protected by some special locking?
>
> Only locking for your own structures, if needed.
> kmalloc alone does not. (You can write a memory leak without any locks, so
> to speak.)
ipt_ACCOUNT spinlocks the internal data structures, so that should be ok.
I've changed the code to allocate and free memory for every packet instead of
every read from userpace, now the machine survives only 10 seconds. To me it
looks like a missing locking in the kernel memory handler,
I'll try to get a backtrace via serial console.
Thomas
prev parent reply other threads:[~2007-08-20 9:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-17 15:17 Memory allocation inside target handler Thomas Jarosch
2007-08-17 15:22 ` Thomas Jarosch
2007-08-17 15:25 ` Thomas Jarosch
2007-08-17 20:39 ` Carl-Daniel Hailfinger
2007-08-20 9:29 ` Thomas Jarosch
2007-08-17 15:42 ` Jan Engelhardt
2007-08-20 9:46 ` Thomas Jarosch [this message]
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=200708201146.32251.thomas.jarosch@intra2net.com \
--to=thomas.jarosch@intra2net.com \
--cc=jengelh@computergmbh.de \
--cc=netfilter-devel@lists.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).