From: Andi Kleen <andi@firstfloor.org>
To: Toby Goodwin <toby@mythic-beasts.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: Fixing NFS over OpenVPN
Date: Mon, 23 Apr 2012 23:14:39 -0700 [thread overview]
Message-ID: <m2ehrdodv4.fsf@firstfloor.org> (raw)
In-Reply-To: <1335200249.5607.41.camel@rocinante.mythic-beasts.com> (Toby Goodwin's message of "Mon, 23 Apr 2012 17:57:28 +0100")
Toby Goodwin <toby@mythic-beasts.com> writes:
>
> I believe I know how to fix this, but would appreciate some guidance.
> Part of the solution is to specify the "--mlock" flag to openvpn -- this
> exists so that secrets are never written to swap, but as a side effect
> it prevents openvpn from ever page faulting.
mlock does not prevent page faulting. It merely prevents existing pages
getting swapped out, but new pages can be definitely be faulted in.
Your explanation would only make sense if all swappable memory
in the system is tied up in the openvpn process, which is unlikely.
That said there may be still deadlocks if openvpn needs any new
memory for writing data, but that has nothing to do with mlock.
In fact the mlock should make it more stable under swapping, but you
still have the problem you describe next.
> userland AF_INET socket. (This is the socket through which OpenVPN sends
> its encrypted packets to the remote end of the tunnel.) I haven't
> discovered any way for userland to request a particular allocation
> policy for a socket, please let me know if I've missed something.
Just changing to GFP_NOIO will not fully solve the problem.
You really would need a preallocated mempool of pages for the socket
(similar to Mel Gorman/ Peter Ziljstra's swap-over-NFS
patchkit). Essentially the whole IO path needs to be able to work
without allocating new memory.
>
> Is there a better way to solve this?
Probably parts of openvpn would need to move into the kernel.
-Andi
--
ak@linux.intel.com -- Speaking for myself only
prev parent reply other threads:[~2012-04-24 6:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-23 16:57 Fixing NFS over OpenVPN Toby Goodwin
2012-04-24 6:14 ` Andi Kleen [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=m2ehrdodv4.fsf@firstfloor.org \
--to=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=toby@mythic-beasts.com \
/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